12 Camera(
const glm::vec3& initialCameraPosition);
15 const glm::vec3& GetPosition()
const {
return m_Position; }
16 float GetRotation()
const {
return m_Rotation; }
18 void LeftMouseButtonPressed();
19 void LeftMouseButtonReleased();
20 void ComputeCameraFront();
22 void SetPosition(
const glm::vec3& position);
23 void SetRotation(
float rotation) { m_Rotation = rotation; RecalculateViewMatrix(); }
24 inline void SetCameraFront(
const glm::vec3& front) { m_CameraFront = front; }
25 inline void SetCameraUp(
const glm::vec3& up) { m_CameraUp = up; }
27 void MoveForward(
float amount);
28 void MoveSideways(
float amount);
29 void MoveUp(
float amount);
30 void RotateAboutYAxis(
float amount);
31 void RotateAboutXAxis(
float amount);
33 const glm::mat4& GetProjectionMatrix()
const {
return m_ProjectionMatrix; }
34 const glm::mat4& GetViewMatirx()
const {
return m_ViewMatrix; }
37 void RecalculateViewMatrix();
40 void InitializePitchRoll();
43 glm::mat4 m_ProjectionMatrix;
44 glm::mat4 m_ViewMatrix;
47 glm::vec3 m_CameraFront;
49 float m_Rotation = 0.0f;
51 bool m_IsLeftMouseButtonPressed =
false;
52 float m_LastMouseX, m_LastMouseY;
54 const float m_Sensitivity = 0.1f;