A Camera is used to view a scene from a particular vantage point.
More...
#include <camera.h>
|
| Camera (Vector3Gf position=Vector3Gf(0.0f, 0.0f, 0.0f), Vector3Gf up=Vector3Gf(0.0f, 1.0f, 0.0f), GLfloat yaw=-90.0f, GLfloat pitch=0.0f) |
|
Eigen::Matrix< GLfloat, 4, 4 > | GetViewMatrix () |
|
void | ProcessKeyboard (Camera_Movement direction, GLfloat deltaTime) |
|
void | ProcessMouseMovement (GLfloat xoffset, GLfloat yoffset, GLboolean constrainPitch=true) |
|
void | ProcessMouseScroll (GLfloat yoffset) |
|
|
Vector3Gf | m_position |
|
Vector3Gf | m_front |
|
Vector3Gf | m_up |
|
Vector3Gf | m_right |
|
Vector3Gf | m_world_up |
|
GLfloat | m_yaw |
|
GLfloat | m_pitch |
|
GLfloat | m_movement_speed |
|
GLfloat | m_mouse_sensitivity |
|
GLfloat | m_zoom |
|
A Camera is used to view a scene from a particular vantage point.
A Camera requires a position,orientation, and direction to look in space. These things together define a camera centered coordinate system. This camera system is based on the camera system from here
Camera::Camera |
( |
Vector3Gf |
position = Vector3Gf(0.0f, 0.0f, 0.0f) , |
|
|
Vector3Gf |
up = Vector3Gf(0.0f, 1.0f, 0.0f) , |
|
|
GLfloat |
yaw = -90.0f , |
|
|
GLfloat |
pitch = 0.0f |
|
) |
| |
Constructs a Camera
- Parameters
-
position | position of the camera in world coordinates |
up | up direction in world cordinates for the camera. This is used to define up in the Camera coordinate system |
yaw | yaw value for the camera |
pitch | pitch value for the camera |
Eigen::Matrix< GLfloat, 4, 4 > Camera::GetViewMatrix |
( |
| ) |
|
- Returns
- the view matrix calculated using Eular Angles and the LookAt Matrix
void Camera::ProcessKeyboard |
( |
Camera_Movement |
direction, |
|
|
GLfloat |
deltaTime |
|
) |
| |
Processes input received from any keyboard-like input system. Accepts input parameter in the form of camera defined ENUM
- Parameters
-
direction | direction to move the camera in |
deltaTime | time in seconds between rendering cycles. Helps smooth camera movement |
void Camera::ProcessMouseMovement |
( |
GLfloat |
xoffset, |
|
|
GLfloat |
yoffset, |
|
|
GLboolean |
constrainPitch = true |
|
) |
| |
Processes input received from a mouse input system. Expects the offset value in both the x and y direction.
- Parameters
-
xoffset | change in x position of mouse |
yoffset | change in y position of mouse |
constrainPitch | controls if pitch is constrained within [-89,89] degrees |
void Camera::ProcessMouseScroll |
( |
GLfloat |
yoffset | ) |
|
Processes input received from a mouse scroll-wheel event. Only requires input on the vertical wheel-axis
- Parameters
-
yoffset | change in scroll value |
The documentation for this class was generated from the following files: