Added Resource Lib and handle for CameraDirector into camera system
This commit is contained in:
parent
29b6e7050d
commit
31ad8b8c87
|
@ -178,6 +178,20 @@ namespace SHADE
|
|||
{
|
||||
system->UpdateCameraComponent(cam);
|
||||
}
|
||||
for (auto& handle : system->directorHandleList)
|
||||
{
|
||||
handle->UpdateMatrix();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Handle<SHCameraDirector> SHCameraSystem::CreateDirector() noexcept
|
||||
{
|
||||
auto handle = directorLibrary.Create();
|
||||
directorHandleList.emplace_back(handle);
|
||||
return handle;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
#include "SHCameraComponent.h"
|
||||
#include "ECS_Base/System/SHSystemRoutine.h"
|
||||
#include "Resource/ResourceLibrary.h"
|
||||
|
||||
#include "SHCameraDirector.h"
|
||||
#include "Resource/Handle.h"
|
||||
#include "SH_API.h"
|
||||
|
||||
namespace SHADE
|
||||
|
@ -16,7 +17,8 @@ namespace SHADE
|
|||
//This is not tied to any entity. Hence this EID should not be used.
|
||||
SHCameraComponent editorCamera;
|
||||
|
||||
|
||||
ResourceLibrary<SHCameraDirector> directorLibrary;
|
||||
std::vector<Handle<SHCameraDirector>> directorHandleList;
|
||||
|
||||
public:
|
||||
SHCameraSystem(void) = default;
|
||||
|
@ -46,6 +48,7 @@ namespace SHADE
|
|||
|
||||
SHCameraComponent* GetEditorCamera (void) noexcept;
|
||||
void GetCameraAxis(SHCameraComponent const& camera, SHVec3& forward, SHVec3& right, SHVec3& up) const noexcept;
|
||||
Handle<SHCameraDirector> CreateDirector() noexcept;
|
||||
protected:
|
||||
|
||||
void UpdateCameraComponent(SHCameraComponent& camera) noexcept;
|
||||
|
|
Loading…
Reference in New Issue