Fling Engine
0.00.1
Fling Engine is a game engine written in Vulkan
|
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 |
![]() | |
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... | |
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 |
float | m_RotationSpeed = 20.0f |
bool | m_IsRotating = false |
MousePos | m_PrevMousePos |
Additional Inherited Members | |
![]() | |
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 |
A simple first person camera.
Moves with WASD and rotates with right click + drag
Fling::FirstPersonCamera::FirstPersonCamera | ( | float | aspectRatio, |
float | t_MoveSpeed = 10.0f , |
||
float | t_RotSpeed = 40.f |
||
) |
Fling::FirstPersonCamera::FirstPersonCamera | ( | glm::vec3 | position, |
glm::vec3 | rotation, | ||
float | speed, | ||
float | aspectRatio | ||
) |
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 | ||
) |
|
inline |
|
inline |
|
inline |
|
overridevirtual |
Implements Fling::Camera.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |