| Fling Engine 0.00.1 Fling Engine is a game engine written in Vulkan

Public Member Functions | Private Member Functions | Private Attributes
Fling::FirstPersonCamera Class Reference

A simple first person camera. More...

`#include <FirstPersonCamera.h>`

Inherits Fling::Camera.

## Public Member Functions
| FirstPersonCamera (float aspectRatio, float t_MoveSpeed=10.0f, float t_RotSpeed=40.f)
| FirstPersonCamera (glm::vec3 position, glm::vec3 rotation, float speed, float aspectRatio)
| FirstPersonCamera (glm::vec3 front, glm::vec3 up, glm::vec3 position, glm::vec3 rotation, float speed, float nearPlane, float farPlane, float fov, float aspectRatio)
void | Update (float dt) override
float | GetRotationSpeed () const
void | SetRotationSpeed (float t_NewSpeed)
bool | IsRotating () const
Public Member Functions inherited from Fling::Camera
| Camera ()
virtual | ~Camera ()=default
const float | GetNearPlane () const
| Gets the near plane of the view frustrum. More...
void | SetNearPlane (const float &nearPlane)
const float | GetFarPlane () const
| Gets the far plane of the view frustrum. More...
void | SetFarPlane (const float &farPlane)
const float | GetFieldOfView () const
| Gets the field of view angle from the view frustrum. More...
void | SetFieldOfView (const float &fieldOfView)
const glm::vec3 & | GetPosition () const
const glm::vec3 & | GetRotation () const
const float | GetSpeed () const
const float | GetAspectRatio () const
const glm::mat4 & | GetViewMatrix () const
| Gets the view matrix created by the current camera position and rotation. More...
const glm::mat4 & | GetProjectionMatrix () const
| Gets the projection matrix used by camera. More...
float | GetGamma () const
void | SetGamma (float t_Gam)
float | GetExposure () const
void | SetExposure (float t_Val)

## Private Member Functions
void | UpdateViewMatrix ()
void | UpdateProjectionMatrix ()
void | UpdateCameraVectors ()

## Private Attributes
glm::vec3 | m_front
glm::vec3 | m_up
glm::vec3 | m_right
glm::vec3 | m_worldUp
glm::vec3 | m_worldFront = { 0.f, 0.f, -1.0 }
float | m_RotationSpeed = 20.0f
bool | m_IsRotating = false
const float | MAX_PITCH = (glm::pi<float>() / 2.0f) - .017f
MousePos | m_PrevMousePos

## Additional Inherited Members
Protected Attributes inherited from Fling::Camera
glm::mat4 | m_viewMatrix
glm::mat4 | m_projectionMatrix
glm::vec3 | m_position
float | m_speed
glm::vec3 | m_rotation
float | m_aspectRatio
float | m_nearPlane
float | m_farPlane
float | m_fieldOfView
float | m_Gamma = 2.2f
float | m_Exposure = 4.5f

## Detailed Description

A simple first person camera.

Moves with WASD and rotates with right click + drag

## Constructor & Destructor Documentation

## ◆ FirstPersonCamera() [1/3]

Fling::FirstPersonCamera::FirstPersonCamera | ( | float | aspectRatio,
|  | float | t_MoveSpeed = `10.0f`,
|  | float | t_RotSpeed = `40.f`
| ) |  |

## ◆ FirstPersonCamera() [2/3]

Fling::FirstPersonCamera::FirstPersonCamera | ( | glm::vec3 | position,
|  | glm::vec3 | rotation,
|  | float | speed,
|  | float | aspectRatio
| ) |  |

## ◆ FirstPersonCamera() [3/3]

Fling::FirstPersonCamera::FirstPersonCamera | ( | glm::vec3 | front,
|  | glm::vec3 | up,
|  | glm::vec3 | position,
|  | glm::vec3 | rotation,
|  | float | speed,
|  | float | nearPlane,
|  | float | farPlane,
|  | float | fov,
|  | float | aspectRatio
| ) |  |

## Member Function Documentation

## ◆ GetRotationSpeed()

float Fling::FirstPersonCamera::GetRotationSpeed | ( |  | ) | const
| inline

## ◆ IsRotating()

bool Fling::FirstPersonCamera::IsRotating | ( |  | ) | const
| inline

## ◆ SetRotationSpeed()

void Fling::FirstPersonCamera::SetRotationSpeed | ( | float | t_NewSpeed | ) |
| inline

## ◆ Update()

void Fling::FirstPersonCamera::Update | ( | float | dt | ) |
| override virtual

Implements Fling::Camera.

## ◆ UpdateCameraVectors()

void Fling::FirstPersonCamera::UpdateCameraVectors | ( |  | ) |
| private

## ◆ UpdateProjectionMatrix()

void Fling::FirstPersonCamera::UpdateProjectionMatrix | ( |  | ) |
| private

## ◆ UpdateViewMatrix()

void Fling::FirstPersonCamera::UpdateViewMatrix | ( |  | ) |
| private

## Field Documentation

## ◆ m_front

glm::vec3 Fling::FirstPersonCamera::m_front
| private

## ◆ m_IsRotating

bool Fling::FirstPersonCamera::m_IsRotating = false
| private

## ◆ m_PrevMousePos

MousePos Fling::FirstPersonCamera::m_PrevMousePos
| private

## ◆ m_right

glm::vec3 Fling::FirstPersonCamera::m_right
| private

## ◆ m_RotationSpeed

float Fling::FirstPersonCamera::m_RotationSpeed = 20.0f
| private

## ◆ m_up

glm::vec3 Fling::FirstPersonCamera::m_up
| private

## ◆ m_worldFront

glm::vec3 Fling::FirstPersonCamera::m_worldFront = { 0.f, 0.f, -1.0 }
| private

## ◆ m_worldUp

glm::vec3 Fling::FirstPersonCamera::m_worldUp
| private

## ◆ MAX_PITCH

const float Fling::FirstPersonCamera::MAX_PITCH = (glm::pi<float>() / 2.0f) - .017f
| private

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

- FlingEngine/Gameplay/inc/FirstPersonCamera.h
- FlingEngine/Gameplay/src/FirstPersonCamera.cpp