Radium Engine  1.5.0
CameraComponent.hpp
1 #pragma once
2 
3 #include <Core/Asset/Camera.hpp>
4 #include <Core/Math/Math.hpp>
5 #include <Core/Types.hpp>
6 #include <Engine/RaEngine.hpp>
7 #include <Engine/Scene/Component.hpp>
8 
9 namespace Ra {
10 namespace Engine {
11 namespace Scene {
12 
13 class Entity;
14 
18 class RA_ENGINE_API CameraComponent : public Scene::Component
19 {
20  public:
21  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
22 
23  CameraComponent( Entity* entity, const std::string& name, Scalar height = 1, Scalar width = 1 );
24 
25  ~CameraComponent() override;
26 
27  void initialize() override;
28 
30  void show( bool on );
31 
33  void updateTransform();
34 
36  virtual CameraComponent* duplicate( Entity* cloneEntity, const std::string& cloneName ) const;
37 
38  Core::Asset::Camera* getCamera() const { return m_camera.get(); }
39  Core::Asset::Camera* getCamera() { return m_camera.get(); }
40  const Rendering::RenderObject* getRenderObject() const { return m_RO; }
41 
42  protected:
43  std::unique_ptr<Core::Asset::Camera> m_camera;
44  Rendering::RenderObject* m_RO { nullptr };
45 };
46 } // namespace Scene
47 } // namespace Engine
48 } // namespace Ra
Camera class storing the Camera frame and the projection properties The view direction is -z in camer...
Definition: Camera.hpp:16
A component is an element that can be updated by a system. It is also linked to some other components...
Definition: Component.hpp:31
An entity is an scene element. It ties together components with a transform.
Definition: Entity.hpp:23
Definition: Cage.cpp:3