Skip to content

EntropyCanvas::CameraComponent

Camera component for viewports and render-to-texture. More…

#include <CameraComponent.h>

Name
glm::mat4viewProjectionMatrix(const Transform & transform) const
Compute the combined view-projection matrix.
glm::mat4viewMatrix(const Transform & transform)
Compute the view matrix from a transform.
glm::mat4projectionMatrix() const
Compute the projection matrix with standard-Z (default).
glm::mat4projectionMatrix(bool useReverseZ) const
Compute the projection matrix with configurable depth strategy.
ENTROPY_REGISTER_TYPE(CameraComponent )
ENTROPY_FIELD(ProjectionType , projectionType )
ENTROPY_FIELD(float , fov )
ENTROPY_FIELD(float , orthoSize )
virtualENTROPY_FIELD(float , nearPlane ) =0
ENTROPY_FIELD(float , farPlane )
ENTROPY_FIELD(float , aspectRatio )
ENTROPY_FIELD(bool , isActive )
ENTROPY_FIELD(bool , rendersToSwapchain )
ENTROPY_FIELD(CameraRenderMode , renderMode )
virtualENTROPY_FIELD(uint32_t , renderWidth ) =0
virtualENTROPY_FIELD(uint32_t , renderHeight ) =0
struct EntropyCanvas::CameraComponent;

Camera component for viewports and render-to-texture.

Combined with Transform to define view parameters.

Properties are individually addressable via PropertyRegistry for efficient network synchronization (using ENTROPY_FIELD macros).

inline glm::mat4 viewProjectionMatrix(
const Transform & transform
) const

Compute the combined view-projection matrix.

static inline glm::mat4 viewMatrix(
const Transform & transform
)

Compute the view matrix from a transform.

inline glm::mat4 projectionMatrix() const

Compute the projection matrix with standard-Z (default).

inline glm::mat4 projectionMatrix(
bool useReverseZ
) const

Compute the projection matrix with configurable depth strategy.

Parameters:

  • useReverseZ If true, swap near/far for reverse-Z projection (better depth precision).
ENTROPY_REGISTER_TYPE(
CameraComponent
)
ENTROPY_FIELD(
ProjectionType ,
projectionType
)
ENTROPY_FIELD(
float ,
fov
)
ENTROPY_FIELD(
float ,
orthoSize
)
virtual ENTROPY_FIELD(
float ,
nearPlane
) =0
ENTROPY_FIELD(
float ,
farPlane
)
ENTROPY_FIELD(
float ,
aspectRatio
)
ENTROPY_FIELD(
bool ,
isActive
)
ENTROPY_FIELD(
bool ,
rendersToSwapchain
)
ENTROPY_FIELD(
CameraRenderMode ,
renderMode
)
virtual ENTROPY_FIELD(
uint32_t ,
renderWidth
) =0
virtual ENTROPY_FIELD(
uint32_t ,
renderHeight
) =0

Updated on 2026-01-26 at 17:14:35 -0500