KarmaEngine
Game Engine for practical learning and research purposes
|
Class for PerspectiveCamera, meaning Camera with depth scaling. More...
#include <PerspectiveCamera.h>
Public Member Functions | |
PerspectiveCamera (float fovRad, float aspectRatio, float nearPlane, float farPlane) | |
Constructor for PerspectiveCamera class. | |
![]() | |
Camera (const glm::vec3 &initialCameraPosition) | |
Default constructor. | |
virtual | ~Camera () |
Destructor. | |
const glm::vec3 & | GetPosition () const |
Getter for current position of the Camers. | |
float | GetRotation () const |
Getter for current rotation. | |
void | LeftMouseButtonPressed () |
Differentiates between single button press and drag. | |
void | LeftMouseButtonReleased () |
Setting m_IsLeftMouseButtonPressed to false. | |
void | ComputeCameraFront () |
Computes the pointing vector of the camera (outward positive) given the current pitch, and roll. (no yaw) | |
void | SetPosition (const glm::vec3 &position) |
Sets the current position of the Camera. | |
void | SetRotation (float rotation) |
Sets the current rotation of the Camera. | |
void | SetCameraFront (const glm::vec3 &front) |
Set the front vector of Camera. | |
void | SetCameraUp (const glm::vec3 &up) |
Set the up vector of Camera. | |
void | MoveForward (float amount) |
Translate in the direction of front vector. | |
void | MoveSideways (float amount) |
Move sideways in the direction of cross product of front vector and up vector. | |
void | MoveUp (float amount) |
Move in the direction of Up. | |
void | RotateAboutYAxis (float amount) |
Rotate about Y-axis. | |
void | RotateAboutXAxis (float amount) |
Rotate about X-axis. | |
const glm::mat4 & | GetProjectionMatrix () const |
Getter for ProjectionMatrix. | |
const glm::mat4 & | GetViewMatirx () const |
Getter for ViewMatrix. | |
Additional Inherited Members | |
![]() | |
void | InitializePitchRoll () |
![]() | |
glm::mat4 | m_ProjectionMatrix |
glm::mat4 | m_ViewMatrix |
glm::vec3 | m_Position |
glm::vec3 | m_CameraFront |
glm::vec3 | m_CameraUp |
float | m_Rotation = 0.0f |
bool | m_IsLeftMouseButtonPressed = false |
float | m_LastMouseX |
float | m_LastMouseY |
const float | m_Sensitivity = 0.1f |
float | m_Roll = 0.0f |
float | m_Pitch = 0.0f |
Class for PerspectiveCamera, meaning Camera with depth scaling.
Karma::PerspectiveCamera::PerspectiveCamera | ( | float | fovRad, |
float | aspectRatio, | ||
float | nearPlane, | ||
float | farPlane ) |
Constructor for PerspectiveCamera class.
fovRad | field of view in Radians |
aspectRatio | aspect ration width / height (?) |
nearPlane | z distance of near plane |
farPlane | z distance of far plane |