Radium Engine
1.5.20
|
#include <Engine/Scene/CameraManager.hpp>
Public Member Functions | |
CameraManager () | |
Constructor. | |
CameraManager (const CameraManager &)=delete | |
CameraManager & | operator= (const CameraManager &)=delete |
~CameraManager () override=default | |
Virtual destructor. | |
virtual const CameraComponent * | getCamera (size_t i) const =0 |
Get a pointer to the i-th Camera. | |
virtual void | addCamera (CameraComponent *cam)=0 |
Add a Camera to the manager ... | |
virtual Core::Utils::Index | getCameraIndex (const CameraComponent *cam) |
virtual void | initialize () |
Add a default camera. | |
void | activate (Core::Utils::Index index) |
void | updateActiveCameraData () |
update the active camera data | |
virtual size_t | count () const |
Number of managed Cameras. | |
void | generateTasks (Core::TaskQueue *taskQueue, const Engine::FrameInfo &frameInfo) override |
Pure virtual method to be overridden by any system. Must register in taskQueue the operations that must be done ate each frame. | |
void | handleAssetLoading (Entity *entity, const Core::Asset::FileData *data) override |
Ra::Core::Asset::Camera * | getActiveCamera () |
Get the pointer on the active camera data. | |
Core::Utils::Index | getActiveCameraIndex () const |
Get the index of the currently active camera. | |
void | resetActiveCamera () |
reset the active camera data to default camera | |
Core::Utils::Observable< Core::Utils::Index > & | activeCameraObservers () |
get a ref to active camera observers to add/remove an observer | |
Public Member Functions inherited from Ra::Engine::Scene::System | |
std::vector< Component * > | getEntityComponents (const Entity *entity) |
void | addComponent (Entity *entity, Component *component) |
Static Public Attributes | |
static Ra::Core::Asset::Camera | defaultCamera |
Protected Member Functions | |
void | registerComponent (const Entity *entity, Component *component) final |
void | unregisterComponent (const Entity *entity, Component *component) final |
void | unregisterAllComponents (const Entity *entity) final |
Protected Member Functions inherited from Ra::Engine::Scene::System |
Protected Attributes | |
std::unique_ptr< CameraStorage > | m_data { nullptr } |
Stores the object that stores the Cameras... | |
Ra::Core::Asset::Camera | m_activeCamera |
active camera data, active camera hasn't any component just pure data. | |
Core::Utils::Index | m_activeIndex |
active camera index | |
Core::Utils::Observable< Core::Utils::Index > | m_activeCameraObservers |
Observers on active camera changes. | |
Protected Attributes inherited from Ra::Engine::Scene::System | |
std::vector< std::pair< const Entity *, Component * > > | m_components |
List of active components. | |
Interface providing functions to manage a group or type of Cameras in a specific way. CameraManager handle one "active camera" for rendering as m_activeCamera; this rendering camera has no Component associated, and it can retrieve it's data from any managed camera with activate(index). Manipulator and renderer can access (and even store as a visiting ptr) this data with getActiveCamera() Default camera data is used to intializad camera. Client code can set this static data to control default camera initialization.
Definition at line 25 of file CameraManager.hpp.
Ra::Engine::Scene::CameraManager::CameraManager | ( | ) |
Constructor.
Definition at line 24 of file CameraManager.cpp.
void Ra::Engine::Scene::CameraManager::activate | ( | Core::Utils::Index | index | ) |
activate camera at index given its index. index-th camera data is copied to the "active camera" stored explicitly by the manager. width and height of previous active camera is kept during this process, since it's likely to be screen size, while index-th camera width height might be something else. When a camera is activated, the frame of the active camera is computed to take the entity's transformation into account.
index | camera's index to activate, if invalid or out of bound, activation is ignored. |
Definition at line 39 of file CameraManager.cpp.
|
inline |
get a ref to active camera observers to add/remove an observer
Definition at line 98 of file CameraManager.hpp.
|
pure virtual |
Add a Camera to the manager ...
Implemented in Ra::Engine::Scene::DefaultCameraManager.
|
virtual |
Number of managed Cameras.
Definition at line 71 of file CameraManager.cpp.
|
overridevirtual |
Pure virtual method to be overridden by any system. Must register in taskQueue the operations that must be done ate each frame.
taskQueue | The queue to fill |
frameInfo | Information about the current frame ( |
Implements Ra::Engine::Scene::System.
Definition at line 75 of file CameraManager.cpp.
|
inline |
Get the pointer on the active camera data.
Definition at line 85 of file CameraManager.hpp.
|
inline |
Get the index of the currently active camera.
Definition at line 88 of file CameraManager.hpp.
|
pure virtual |
Get a pointer to the i-th Camera.
Implemented in Ra::Engine::Scene::DefaultCameraManager.
|
virtual |
get camera component's index, if this component is managed.
Definition at line 64 of file CameraManager.cpp.
|
overridevirtual |
Factory method for component creation from file data. From a given file and the corresponding entity, the system will create the corresponding components, add them to the entity, and register the component.
Reimplemented from Ra::Engine::Scene::System.
Definition at line 98 of file CameraManager.cpp.
|
virtual |
Add a default camera.
Definition at line 31 of file CameraManager.cpp.
|
finalprotectedvirtual |
Inherited method marked as final to ensure correct memory management even in child classes (e.g. CameraStorage).
register the manager to the entity's transformationObservers to update active camera data on entity's transformation changes
Reimplemented from Ra::Engine::Scene::System.
Definition at line 113 of file CameraManager.cpp.
|
inline |
reset the active camera data to default camera
Definition at line 91 of file CameraManager.hpp.
|
finalprotectedvirtual |
Inherited method marked as final to ensure correct memory management even in child classes (e.g. CameraStorage).
Reimplemented from Ra::Engine::Scene::System.
Definition at line 129 of file CameraManager.cpp.
|
finalprotectedvirtual |
Inherited method marked as final to ensure correct memory management even in child classes (e.g. CameraStorage).
Reimplemented from Ra::Engine::Scene::System.
Definition at line 124 of file CameraManager.cpp.
void Ra::Engine::Scene::CameraManager::updateActiveCameraData | ( | ) |
update the active camera data
Definition at line 49 of file CameraManager.cpp.
|
static |
this static data member handles default camera values. can be tweaked after ctor and before initalization, or for any kind of reset.
Definition at line 82 of file CameraManager.hpp.
|
protected |
active camera data, active camera hasn't any component just pure data.
Definition at line 121 of file CameraManager.hpp.
|
protected |
Observers on active camera changes.
Definition at line 127 of file CameraManager.hpp.
|
protected |
active camera index
Definition at line 124 of file CameraManager.hpp.
|
protected |
Stores the object that stores the Cameras...
Definition at line 118 of file CameraManager.hpp.