Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Engine::Scene::CameraComponent Class Reference

#include <Engine/Scene/CameraComponent.hpp>

+ Inheritance diagram for Ra::Engine::Scene::CameraComponent:
+ Collaboration diagram for Ra::Engine::Scene::CameraComponent:

Public Member Functions

 CameraComponent (Entity *entity, const std::string &name, Scalar height=1, Scalar width=1)
 
void initialize () override
 Pure virtual method to be overridden by any component. When this method is called you are guaranteed that all other startup systems have been loaded.
 
void show (bool on)
 Toggle on/off displaying the Camera.
 
void updateTransform ()
 Retrieve owned camera transform and apply to the RO.
 
virtual CameraComponentduplicate (Entity *cloneEntity, const std::string &cloneName) const
 Duplicate the camera under a different Entity and a different name.
 
Core::Asset::CameragetCamera () const
 
Core::Asset::CameragetCamera ()
 
const Rendering::RenderObjectgetRenderObject () const
 
- Public Member Functions inherited from Ra::Engine::Scene::Component
 Component (const std::string &name, Entity *entity)
 CONSTRUCTOR.
 
virtual ~Component ()
 DESTRUCTOR.
 
virtual void setEntity (Entity *entity)
 Set entity the component is part of. This method is called by the entity.
 
virtual EntitygetEntity () const
 Return the entity the component belongs to.
 
virtual const std::stringgetName () const
 Return the component's name.
 
virtual void setSystem (System *system)
 Set the system to which the component belongs.
 
virtual SystemgetSystem () const
 Returns the system to which the component belongs.
 
Core::Utils::Index addRenderObject (Rendering::RenderObject *renderObject)
 Add a new render object to the component. This adds the RO to the manager for drawing.
 
void removeRenderObject (const Core::Utils::Index &roIdx)
 Remove the render object from the component.
 
virtual bool canEdit (const Core::Utils::Index &) const
 Returns true if a transform can be edited with the render object index given as a key.
 
virtual Core::Transform getTransform (const Core::Utils::Index &) const
 Get the transform associated with the given RO index key.
 
virtual void setTransform (const Core::Utils::Index &, const Core::Transform &)
 Set the new transform associated with the RO index key.
 
void notifyRenderObjectExpired (const Core::Utils::Index &idx)
 
virtual Core::Aabb computeAabb ()
 
void invalidateAabb ()
 
const std::vector< Core::Utils::Index > & getRenderObjects ()
 

Protected Attributes

std::unique_ptr< Core::Asset::Cameram_camera
 
Rendering::RenderObjectm_RO { nullptr }
 Render mesh for the camera.
 
- Protected Attributes inherited from Ra::Engine::Scene::Component
std::string m_name {}
 
Entitym_entity { nullptr }
 
Systemm_system { nullptr }
 

Additional Inherited Members

- Public Attributes inherited from Ra::Engine::Scene::Component
std::vector< Core::Utils::Index > m_renderObjects
 
- Static Protected Member Functions inherited from Ra::Engine::Scene::Component
static Rendering::RenderObjectManager * getRoMgr ()
 Shortcut to access the render object manager.
 

Detailed Description

A Camera is an Engine Component storing a Camera object.

Todo
attached camera do not take entity's transformation into account. This prevents, for now, keyframed animation of the Camera from its entity ...

Definition at line 18 of file CameraComponent.hpp.

Constructor & Destructor Documentation

◆ CameraComponent()

Ra::Engine::Scene::CameraComponent::CameraComponent ( Entity * entity,
const std::string & name,
Scalar height = 1,
Scalar width = 1 )

Definition at line 20 of file CameraComponent.cpp.

Member Function Documentation

◆ duplicate()

CameraComponent * Ra::Engine::Scene::CameraComponent::duplicate ( Entity * cloneEntity,
const std::string & cloneName ) const
virtual

Duplicate the camera under a different Entity and a different name.

Definition at line 91 of file CameraComponent.cpp.

+ Here is the call graph for this function:

◆ getCamera() [1/2]

Core::Asset::Camera * Ra::Engine::Scene::CameraComponent::getCamera ( )
inline

Definition at line 37 of file CameraComponent.hpp.

◆ getCamera() [2/2]

Core::Asset::Camera * Ra::Engine::Scene::CameraComponent::getCamera ( ) const
inline

Definition at line 36 of file CameraComponent.hpp.

◆ getRenderObject()

const Rendering::RenderObject * Ra::Engine::Scene::CameraComponent::getRenderObject ( ) const
inline

Definition at line 38 of file CameraComponent.hpp.

◆ initialize()

void Ra::Engine::Scene::CameraComponent::initialize ( )
overridevirtual

Pure virtual method to be overridden by any component. When this method is called you are guaranteed that all other startup systems have been loaded.

Implements Ra::Engine::Scene::Component.

Definition at line 30 of file CameraComponent.cpp.

+ Here is the call graph for this function:

◆ show()

void Ra::Engine::Scene::CameraComponent::show ( bool on)

Toggle on/off displaying the Camera.

Definition at line 78 of file CameraComponent.cpp.

◆ updateTransform()

void Ra::Engine::Scene::CameraComponent::updateTransform ( )

Retrieve owned camera transform and apply to the RO.

Definition at line 83 of file CameraComponent.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_camera

std::unique_ptr<Core::Asset::Camera> Ra::Engine::Scene::CameraComponent::m_camera
protected

Definition at line 41 of file CameraComponent.hpp.

◆ m_RO

Rendering::RenderObject* Ra::Engine::Scene::CameraComponent::m_RO { nullptr }
protected

Render mesh for the camera.

Definition at line 42 of file CameraComponent.hpp.


The documentation for this class was generated from the following files: