Class CameraBase

Inheritance Relationships

Derived Types

Class Documentation

class CameraBase

Tracks projection and view changes by revision.

The game or a render pass chooses when to use these matrices; the camera does not set render policy. Mutable state is unsynchronized: use one owner and copy matrices into frames. Matrix references borrow this camera and must not race with its setters.

Subclassed by CE::Rendering::Camera2D, CE::Rendering::Camera3D

Public Functions

virtual ~CameraBase() = default
void set_framebuffer_size(::CE::Platform::FramebufferSize size)
void set_view_matrix(const glm::mat4 &view)
inline ::CE::Platform::FramebufferSize framebuffer_size() const

Declaration: [[nodiscard]]

inline const glm::mat4 &projection_matrix() const

Declaration: [[nodiscard]]

inline const glm::mat4 &view_matrix() const

Declaration: [[nodiscard]]

inline std::uint64_t revision() const

Declaration: [[nodiscard]]

Protected Functions

virtual void recalculate_projection() = 0

Protected Attributes

::CE::Platform::FramebufferSize framebuffer_size_ = {}
glm::mat4 projection_matrix_ = {1.0f}
glm::mat4 view_matrix_ = {1.0f}
std::uint64_t revision_ = 0