13 Camera(CameraType type = CameraType::Orthographic);
16 void setCameraType(CameraType type);
18 void setPerspective(
float fov,
float aspect,
float near,
float far);
19 void setOrthographic(
float left,
float right,
float bottom,
float top);
21 void setAspectRatio(
float aspect);
22 void setClip(
float near,
float far);
24 void setPosition(
const glm::vec3 &position);
25 void setRotation(
float yaw,
float pitch,
float roll);
27 void setSpeed(
float speed);
28 void setSensitivity(
float sensitivity);
30 CameraType type()
const;
31 const glm::vec3 &position()
const;
32 glm::vec3 rotation()
const;
34 float sensitivity()
const;
35 float aspectRatio()
const;
37 const glm::mat4 &projectionMatrix()
const;
38 const glm::mat4 &viewMatrix()
const;
39 glm::mat4 viewProjectionMatrix()
const;
42 void updateProjection();
44 void updateDirection();
47 CameraType m_cameraType;
49 glm::vec3 m_position = {0.0f, 0.0f, 0.0f};
50 glm::vec3 m_front = {0.0f, 0.0f, -1.0f};
51 glm::vec3 m_up = {0.0f, 1.0f, 0.0f};
52 glm::vec3 m_right = {1.0f, 0.0f, 0.0f};
53 glm::vec3 m_worldUp = {0.0f, 1.0f, 0.0f};
57 glm::mat4 m_projection{1.0f};
58 glm::mat4 m_view{1.0f};
65 float m_aspectRatio = 16.0f / 9.0f;
67 float m_far = 1000.0f;
69 float m_orthoLeft{-10.0f};
70 float m_orthoRight{+10.0f};
71 float m_orthoBottom{-10.0f};
72 float m_orthoTop{+10.0f};
74 float m_cameraSpeed = 1.5f;
75 float m_cameraSensitivity = 0.1f;