9#include <glm/gtc/matrix_transform.hpp>
57 virtual void Update(
float deltaTime);
130 float left,
float right,
131 float top,
float bottom,
132 float nearPlane,
float farPlane)
const;
glm::mat4 ComputeOrthographicMatrix(float left, float right, float top, float bottom, float nearPlane, float farPlane) const
glm::mat4 GetProjectionMatrix() const
Returns the current orthographic projection matrix.
void SetRotation(float angleDegrees)
Sets the camera rotation angle in degrees (counterclockwise, around Z).
void SetPosition(const glm::vec2 &position)
Sets the camera position.
glm::vec2 GetPosition() const
Gets the camera position.
std::unique_ptr< SceneComponent2D > mSceneComponent
void Reset()
Resets the camera to the default view (origin, zero rotation, unit zoom).
void SetViewportSize(float width, float height)
Sets the viewport dimensions used to compute the projection matrix.
void SetZoom(float zoom)
Sets the camera zoom (uniform scale).
const glm::mat4 & GetWorldView() const
Gets the world-view (model) matrix for the camera.
Camera2D(IApplication &app)
Constructs a 2D camera at the origin, with no rotation and unit zoom.
virtual ~Camera2D()=default
Virtual destructor.
float GetRotation() const
Gets the camera rotation angle in degrees.
virtual void Update(float deltaTime)
Updates the camera logic (no-op for now).
float GetZoom() const
Gets the current zoom factor.
virtual void Initialize()
Initializes the camera (calls Reset()).
Defines a generic application interface for rendering-based programs.
Represents a 2D transformable scene component with position, rotation, and scale.