Particle Simulation Documentation
|
#include <camera.h>
Public Member Functions | |
Camera (const glm::vec3 &position=glm::vec3(0.0f, 0.0f, 0.0f), const glm::vec3 &front=glm::vec3(1.0f, 0.0f, 0.0f), const glm::vec3 &up=glm::vec3(0.0f, 1.0f, 0.0f), float azimuth=0.0f, float elevation=0.0f, float speed=50.0f, float fov=45.0f, const float minRenderDistance=1, const float maxRenderDistance=10000) | |
void | configurePerspective (double aspectRatio) |
Configure camera perspective. | |
void | update () |
Updates the camera position and orientation. | |
void | computeNewPosition (const std::array< bool, 1024 > &keyStates, float deltaTime) |
Compute new camera position. | |
void | computeNewOrientation (const double xOffset, const double yOffset) |
Compute new camera orientation. | |
void | setPosition (const glm::vec3 &position) |
void | setSpeed (float speed) |
const glm::vec3 & | getPosition () const |
const glm::vec3 & | getFront () const |
const glm::vec3 & | getUp () const |
const float | getSpeed () const |
Private Attributes | |
glm::vec3 | m_position |
Camera position (in scene unit). | |
glm::vec3 | m_front |
Normalized direction towards which the camera is oriented (in scene unit). | |
glm::vec3 | m_up |
Normalized direction to top of camera (in scene unit). | |
glm::vec3 | m_right |
Normalized direction to the right of camera (in scene unit). | |
float | m_azimuth |
Azimut angle of the camera (in °). | |
float | m_elevation |
Elevation angle of the camera (in °). | |
float | m_speed |
Camera speed (in scene unit/sec). | |
float | m_fov |
Camera field of view (in °). | |
const float | m_minRenderDistance |
Minimal rendering distance (in scene unit). | |
const float | m_maxRenderDistance |
Maximal rendering distance (in scene unit). | |
Camera::Camera | ( | const glm::vec3 & | position = glm::vec3(0.0f, 0.0f, 0.0f), |
const glm::vec3 & | front = glm::vec3(1.0f, 0.0f, 0.0f), | ||
const glm::vec3 & | up = glm::vec3(0.0f, 1.0f, 0.0f), | ||
float | azimuth = 0.0f, | ||
float | elevation = 0.0f, | ||
float | speed = 50.0f, | ||
float | fov = 45.0f, | ||
const float | minRenderDistance = 1, | ||
const float | maxRenderDistance = 10000 ) |
void Camera::computeNewOrientation | ( | const double | xOffset, |
const double | yOffset ) |
Compute new camera orientation.
[in] | xOffset | The offset |
[in] | yOffset | The y offset |
void Camera::computeNewPosition | ( | const std::array< bool, 1024 > & | keyStates, |
float | deltaTime ) |
Compute new camera position.
keyStates | Array of all key states. |
deltaTime | Time since the last frame (in seconds). |
void Camera::configurePerspective | ( | double | aspectRatio | ) |
Configure camera perspective.
[in] | aspectRatio | The aspect ratio |
|
inline |
|
inline |
|
inline |
|
inline |
void Camera::setPosition | ( | const glm::vec3 & | position | ) |
void Camera::setSpeed | ( | float | speed | ) |
void Camera::update | ( | ) |
Updates the camera position and orientation.
|
private |
Azimut angle of the camera (in °).
|
private |
Elevation angle of the camera (in °).
|
private |
Camera field of view (in °).
|
private |
Normalized direction towards which the camera is oriented (in scene unit).
|
private |
Maximal rendering distance (in scene unit).
|
private |
Minimal rendering distance (in scene unit).
|
private |
Camera position (in scene unit).
|
private |
Normalized direction to the right of camera (in scene unit).
|
private |
Camera speed (in scene unit/sec).
|
private |
Normalized direction to top of camera (in scene unit).