Class PerspectiveCamera
Defined in File PerspectiveCamera.hpp
Inheritance Relationships
Base Type
public Cacao::Camera
(Class Camera)
Class Documentation
-
class PerspectiveCamera : public Cacao::Camera
Camera implementing a perspective view.
Public Functions
-
PerspectiveCamera(float fov = 60)
Create a perspective camera.
- Parameters:
fov – The FOV in degrees
- Throws:
BadInitStateException – If the window is not open
-
inline virtual glm::vec3 GetPosition() const override
Get the position of the camera.
- Returns:
The camera position in world space
-
inline virtual void SetPosition(glm::vec3 pos) override
Set the position of the camera.
- Parameters:
pos – The new position
-
inline virtual glm::vec3 GetRotation() const override
Get the rotation of the camera.
- Returns:
The camera rotation
-
inline virtual void SetRotation(glm::vec3 rot) override
Set the rotation of the camera.
- Parameters:
rot – The new rotation
-
inline virtual glm::mat4 GetProjectionMatrix() const override
Get the projection matrix.
- Returns:
The projection matrix
-
inline virtual glm::mat4 GetViewMatrix() const override
Get the view matrix.
- Returns:
The view matrix
-
inline glm::vec3 GetFrontVector() const
Get the camera’s front vector.
- Returns:
The unit vector pointing out at the camera’s rotation
-
inline glm::vec3 GetRightVector() const
Get the camera’s up vector.
- Returns:
The unit vector perpendicular to both the front and world up vectors
-
inline glm::vec3 GetUpVector() const
Get the camera’s up vector.
- Returns:
The unit vector perpendicular to both the front and right vectors
-
PerspectiveCamera(float fov = 60)