Processes input and calculates the View Matrix for OpenGL rendering.
More...
#include <src/core/camera.h>
|
| | Camera (Vec3 startPos=Vec3(0.0f, 0.0f, 0.0f), Vec3 startUP=Vec3(0.0f, 1.0f, 0.0f)) |
| | Constructs the camera at a specific position.
|
| |
| Mat4 | GetViewMatrix () |
| | Calculates the LookAt View Matrix.
|
| |
| void | ProcessKeyboard (int iDirection, float fDeltaTime) |
| | Moves the camera based on keyboard input direction.
|
| |
| void | ProcessMouseMovement (float fXOffset, float fYOffset, bool bConstrainPitch=true) |
| | Rotates the camera based on mouse movement.
|
| |
| void | ProcessMousePan (float fXOffset, float fYOffset) |
| | Pans the camera (Editor style movement).
|
| |
| void | ProcessMouseScroll (float fYOffset) |
| | Zooms (changes FOV) based on scroll wheel.
|
| |
| Vec3 | GetUp () const |
| |
| Vec3 | GetFront () const |
| |
| Vec3 | GetRight () const |
| |
| Vec3 | GetCameraPosition () const |
| |
| float | GetZoom () const |
| |
| void | SetCameraPosition (const Vec3 &position) |
| |
| void | SetCameraFront (const Vec3 &front) |
| |
| void | SetCameraZoom (float zoom) |
| |
| void | SetCameraYawPitch (float yaw, float pitch) |
| |
| void | UpdateCameraVectors () |
| | Recalculates Front, Right, and Up vectors from Euler angles.
|
| |
Processes input and calculates the View Matrix for OpenGL rendering.
- Implements a standard Euler Angle (Yaw/Pitch) FPS camera.
◆ Camera()
| Core::Camera::Camera |
( |
Vec3 |
startPos = Vec3(0.0f, 0.0f, 0.0f), |
|
|
Vec3 |
startUP = Vec3(0.0f, 1.0f, 0.0f) |
|
) |
| |
|
inline |
Constructs the camera at a specific position.
- Parameters
-
| startPos | Initial world space position. |
| startUP | World's "Up" direction (usually 0,1,0). |
◆ GetCameraPosition()
| Vec3 Core::Camera::GetCameraPosition |
( |
| ) |
const |
|
inline |
◆ GetFront()
| Vec3 Core::Camera::GetFront |
( |
| ) |
const |
|
inline |
◆ GetRight()
| Vec3 Core::Camera::GetRight |
( |
| ) |
const |
|
inline |
◆ GetUp()
| Vec3 Core::Camera::GetUp |
( |
| ) |
const |
|
inline |
◆ GetViewMatrix()
| Mat4 Core::Camera::GetViewMatrix |
( |
| ) |
|
|
inline |
Calculates the LookAt View Matrix.
◆ GetZoom()
| float Core::Camera::GetZoom |
( |
| ) |
const |
|
inline |
◆ ProcessKeyboard()
| void Core::Camera::ProcessKeyboard |
( |
int |
iDirection, |
|
|
float |
fDeltaTime |
|
) |
| |
|
inline |
Moves the camera based on keyboard input direction.
- Parameters
-
| iDirection | Enum/Int representing direction (0=Fwd, 1=Back, 2=Left, 3=Right, 4=Up, 5=Down). |
| fDeltaTime | Time elapsed per frame. |
◆ ProcessMouseMovement()
| void Core::Camera::ProcessMouseMovement |
( |
float |
fXOffset, |
|
|
float |
fYOffset, |
|
|
bool |
bConstrainPitch = true |
|
) |
| |
|
inline |
Rotates the camera based on mouse movement.
- Parameters
-
| fXOffset | Mouse X delta. |
| fYOffset | Mouse Y delta. |
| bConstrainPitch | If true, prevents camera from flipping upside down. |
◆ ProcessMousePan()
| void Core::Camera::ProcessMousePan |
( |
float |
fXOffset, |
|
|
float |
fYOffset |
|
) |
| |
|
inline |
Pans the camera (Editor style movement).
◆ ProcessMouseScroll()
| void Core::Camera::ProcessMouseScroll |
( |
float |
fYOffset | ) |
|
|
inline |
Zooms (changes FOV) based on scroll wheel.
◆ SetCameraFront()
| void Core::Camera::SetCameraFront |
( |
const Vec3 & |
front | ) |
|
|
inline |
◆ SetCameraPosition()
| void Core::Camera::SetCameraPosition |
( |
const Vec3 & |
position | ) |
|
|
inline |
◆ SetCameraYawPitch()
| void Core::Camera::SetCameraYawPitch |
( |
float |
yaw, |
|
|
float |
pitch |
|
) |
| |
|
inline |
◆ SetCameraZoom()
| void Core::Camera::SetCameraZoom |
( |
float |
zoom | ) |
|
|
inline |
◆ UpdateCameraVectors()
| void Core::Camera::UpdateCameraVectors |
( |
| ) |
|
|
inline |
Recalculates Front, Right, and Up vectors from Euler angles.
◆ m_fPitch
| float Core::Camera::m_fPitch = PITCH |
|
private |
◆ m_fSensitivity
◆ m_fSpeed
| float Core::Camera::m_fSpeed = SPEED |
|
private |
◆ m_fYaw
| float Core::Camera::m_fYaw = YAW |
|
private |
◆ m_fZoom
| float Core::Camera::m_fZoom = ZOOM |
|
private |
◆ m_objPtPosition
| Vec3 Core::Camera::m_objPtPosition |
|
private |
◆ m_objVecFront
| Vec3 Core::Camera::m_objVecFront |
|
private |
◆ m_objVecRight
| Vec3 Core::Camera::m_objVecRight |
|
private |
◆ m_objVecUp
| Vec3 Core::Camera::m_objVecUp |
|
private |
◆ m_objWorldUp
| Vec3 Core::Camera::m_objWorldUp |
|
private |
The documentation for this class was generated from the following file: