KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Karma::PerspectiveCamera Class Reference

Class for PerspectiveCamera, meaning Camera with depth scaling. More...

#include <PerspectiveCamera.h>

Inheritance diagram for Karma::PerspectiveCamera:
Collaboration diagram for Karma::PerspectiveCamera:

Public Member Functions

 PerspectiveCamera (float fovRad, float aspectRatio, float nearPlane, float farPlane)
 Constructor for PerspectiveCamera class.
 
- Public Member Functions inherited from Karma::Camera
 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

- Protected Member Functions inherited from Karma::Camera
void InitializePitchRoll ()
 
- Protected Attributes inherited from Karma::Camera
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
 

Detailed Description

Class for PerspectiveCamera, meaning Camera with depth scaling.

Constructor & Destructor Documentation

◆ PerspectiveCamera()

Karma::PerspectiveCamera::PerspectiveCamera ( float fovRad,
float aspectRatio,
float nearPlane,
float farPlane )

Constructor for PerspectiveCamera class.

Parameters
fovRadfield of view in Radians
aspectRatioaspect ration width / height (?)
nearPlanez distance of near plane
farPlanez distance of far plane
Since
Karma 1.0.0

The documentation for this class was generated from the following files: