8#ifndef GALAXY_GRAPHICS_CAMERA_HPP_
9#define GALAXY_GRAPHICS_CAMERA_HPP_
11#include <glm/mat4x4.hpp>
12#include <glm/vec2.hpp>
25 struct alignas(16)
Data final
78 void set_projection(const
float left, const
float right, const
float bottom, const
float top) noexcept;
86 void move(const
float x, const
float y) noexcept;
93 void move_x(const
float x) noexcept;
100 void move_y(const
float y) noexcept;
107 void rotate(const
float degrees) noexcept;
143 void set_positon(const
float x, const
float y) noexcept;
167 void set_origin(const
float x, const
float y) noexcept;
172 void reset() noexcept;
180 const glm::vec2&
get_pos() const noexcept;
196 const glm::vec2&
get_scale() const noexcept;
228 const glm::mat4&
get_proj() noexcept;
void set_positon(const float x, const float y) noexcept
Set postion of camera.
void move(const float x, const float y) noexcept
Move position.
glm::mat4 m_transform
Combined transform.
Camera() noexcept
Constructor.
void set_scale_vertical(const float y) noexcept
Set entity scale.
void scale(const float scale) noexcept
Set entity scale.
void reset() noexcept
Reset transform.
void move_x(const float x) noexcept
Move on x axis.
bool m_allow_rotation
Allow camera to rotate.
float m_translation_speed
Movement speed.
const glm::mat4 & get_model_view() noexcept
Retrieve internal transformation matrix.
void set_positon_vertical(const float y) noexcept
Set postion of camera.
glm::vec2 m_pos
Cached for easy retrieval. Pos.
void set_rotation(const float degrees) noexcept
Set camera rotation.
glm::mat4 & get_transform() noexcept
Retrieve internal transformation matrix.
void recalculate() noexcept
Recalculates the model view matrix.
void set_origin(const float x, const float y) noexcept
Set the origin point.
void move_y(const float y) noexcept
Move on y axis.
const glm::vec2 & get_scale() const noexcept
Get stored scale.
float m_rotation
Cached for easy retrieval. Rotation.
const glm::vec2 & get_pos() const noexcept
Get stored position.
void rotate(const float degrees) noexcept
Rotate entity.
bool m_dirty
Flag to see if transform needs to be recalculated.
void set_positon_horizontal(const float x) noexcept
Set postion of camera.
const glm::mat4 & get_proj() noexcept
Get the Camera projection.
glm::vec2 m_scale
Cached for easy retrieval. Scale.
float get_rotation() const noexcept
Get stored rotation.
glm::vec2 m_origin
Transform origin point.
Data & get_data() noexcept
Get camera view and proj.
float m_rotation_speed
Rotational speed.
const glm::vec2 & get_origin() const noexcept
Get origin point.
void set_scale_horizontal(const float x) noexcept
Set entity scale.
void set_projection(const float left, const float right, const float bottom, const float top) noexcept
Set camera projection.
glm::mat4 m_projection
Camera projection matrix.
glm::mat4 m_model_view
Combined transformation matrix.