21#include "aeongames/AeonEngine.hpp"
23#include "aeongames/Buffer.hpp"
24#include "aeongames/Renderer.hpp"
26#include "aeongames/Node.hpp"
30 static const StringId CameraStringId{
"Camera"};
33 return CameraStringId;
40 Camera::~Camera() =
default;
44 return CameraStringId;
47 static constexpr std::array<const StringId, 3> CameraPropertyIds
58 return CameraPropertyIds.size();
63 return CameraPropertyIds.data();
80 mFieldOfView = aFieldOfView;
84 mNearPlane = aNearPlane;
88 mFarPlane = aFarPlane;
95 case CameraPropertyIds[0]:
97 case CameraPropertyIds[1]:
99 case CameraPropertyIds[2]:
109 case CameraPropertyIds[0]:
110 if ( std::holds_alternative<float> ( aProperty ) )
115 case CameraPropertyIds[1]:
116 if ( std::holds_alternative<float> ( aProperty ) )
121 case CameraPropertyIds[2]:
122 if ( std::holds_alternative<float> ( aProperty ) )
133 if ( scene && scene->GetCamera() == &aNode )
135 scene->SetFieldOfView ( mFieldOfView );
136 scene->SetNear ( mNearPlane );
137 scene->SetFar ( mFarPlane );
Header for 4x4 matrix class.
Header for the Scene class.
void SetFarPlane(float aFarPlane)
Sets the far clipping plane distance.
void SetFieldOfView(float aFieldOfView)
Sets the field of view.
const StringId & GetId() const final
Get the unique identifier for this component type.
void ProcessMessage(Node &aNode, uint32_t aMessageType, const void *aMessageData) final
Process an incoming message.
size_t GetPropertyCount() const final
Get the number of properties exposed by this component.
void SetProperty(uint32_t, const Property &aProperty) final
Set the value aProperty for the property identified by aId.
void SetNearPlane(float aNearPlane)
Sets the near clipping plane distance.
float GetNearPlane() const
Returns the near clipping plane distance.
void Render(const Node &aNode, Renderer &aRenderer, void *aWindowId) final
Render the component.
float GetFarPlane() const
Returns the far clipping plane distance.
Camera()
Default constructor.
Property GetProperty(const StringId &aId) const final
Get the value of a property.
void Update(Node &aNode, double aDelta) final
Update the component state.
static const StringId & GetClassId()
Returns the class identifier for the Camera component.
const StringId * GetPropertyInfoArray() const final
Get the array of property identifiers.
float GetFieldOfView() const
Returns the field of view in degrees.
Abstract base class for node components.
Scene graph node representing an entity in the game world.
DLL Scene * GetScene() const
Retrieve a pointer to the scene containing the node instance.
Abstract base class for rendering backends.
CRC-based compile-time string identifier.
<- This is here just for the literals
std::variant< int, long, long long, unsigned, unsigned long, unsigned long long, float, double, std::string, std::filesystem::path > Property
A variant type that can hold any commonly used property value.