#include <camera.hpp>
Public Member Functions | |
Camera (void) | |
Camera-constructor. | |
Camera (float fov, float neard, float fard) | |
Camera-constructor. | |
~Camera () | |
Camera-destructor. | |
void | set_campos (float *new_pos) |
Set camera position. | |
void | set_campos3d (float nx, float ny, float nz) |
Set camera position. | |
void | set_camorientation (float *str, float *hei, float *dir) |
Set camera vectors. | |
float * | get_campos_ref (void) |
Get pointer to the camera-position. | |
float * | get_xcamdir_ref (void) |
Get pointer to the camera x-axis. | |
float * | get_ycamdir_ref (void) |
Get pointer to the camera y-axis. | |
float * | get_zcamdir_ref (void) |
Get pointer to the camera z-axis. | |
void | move_x (float amount) |
Move camera along x-axis. | |
void | move_y (float amount) |
Move camera along y-axis. | |
void | move_z (float amount) |
Move camera along z-axis. | |
void | move_x_posheight (float amount) |
Move camera along x-axis. | |
void | move_y_posheight (float amount) |
Move camera along y-axis. | |
void | move_z_posheight (float amount) |
Move camera along z-axis. | |
void | rot_x (float amount) |
Rotate the camera around its x-axis. | |
void | rot_y (float amount) |
Rotate the camera around its y-axis. | |
void | rot_z (float amount) |
Rotate the camera around its z-axis. | |
void | reorient_cam_lookdown (void) |
Reorient the camera so that it faces straight down. | |
void | set_start_time (int wct) |
Set start-time for zoom-/pan- animation. | |
sezap_view | sezapa (sezap_view from, sezap_view to, float rho, float vel, float dt) |
Perform the zoom-/pan- animation. | |
Data Fields | |
float | _campos [4] |
float | _xcamdir [4] |
float | _ycamdir [4] |
float | _zcamdir [4] |
float | _fov |
float | _nearplane_dist |
float | _farplane_dist |
Camera::Camera | ( | void | ) |
Camera-constructor.
Places the camera at (0,0,0), "looking towards the horizon".
Camera::Camera | ( | float | fov, | |
float | neard, | |||
float | fard | |||
) |
Camera-constructor.
Places the camera at (0,0,0), "looking towards the horizon". Sets additional parameters like field of view and near- and far- plane.
fov | Field of view. | |
neard | Nearplane distance. | |
fard | Farplane distance. |
void Camera::move_x | ( | float | amount | ) |
Move camera along x-axis.
amount | Determines the distance of the camera-movement along the axis. |
void Camera::move_x_posheight | ( | float | amount | ) |
Move camera along x-axis.
Make sure that the camera's y-coordinate is larger than some threshold.
amount | Determines the distance of the camera-movement along the axis. |
void Camera::move_y | ( | float | amount | ) |
Move camera along y-axis.
amount | Determines the distance of the camera-movement along the axis. |
void Camera::move_y_posheight | ( | float | amount | ) |
Move camera along y-axis.
Make sure that the camera's y-coordinate is larger than some threshold.
amount | Determines the distance of the camera-movement along the axis. |
void Camera::move_z | ( | float | amount | ) |
Move camera along z-axis.
amount | Determines the distance of the camera-movement along the axis. |
void Camera::move_z_posheight | ( | float | amount | ) |
Move camera along z-axis.
Make sure that the camera's y-coordinate is larger than some threshold.
amount | Determines the distance of the camera-movement along the axis. |
void Camera::rot_x | ( | float | drx | ) |
Rotate the camera around its x-axis.
drx | Rotationangle [rad]. |
void Camera::rot_y | ( | float | dry | ) |
Rotate the camera around its y-axis.
dry | Rotationangle [rad]. |
void Camera::rot_z | ( | float | drz | ) |
Rotate the camera around its z-axis.
drz | Rotationangle [rad]. |
void Camera::set_camorientation | ( | float * | str, | |
float * | hei, | |||
float * | dir | |||
) |
Set camera vectors.
str | Pointer to a vector which contains the new camera x-axis. | |
hei | Pointer to a vector which contains the new camera y-axis. | |
dir | Pointer to a vector which contains the new camera z-axis. |
void Camera::set_campos | ( | float * | new_pos | ) |
Set camera position.
new_pos | Pointer to an array containing the desired new coordinates. |
void Camera::set_campos3d | ( | float | nx, | |
float | ny, | |||
float | nz | |||
) |
Set camera position.
nx | The new x-position for the camera. | |
ny | The new y-position for the camera. | |
nz | The new z-position for the camera. |
void Camera::set_start_time | ( | int | wct | ) |
Set start-time for zoom-/pan- animation.
wct | The wall-clock start-time. |
sezap_view Camera::sezapa | ( | sezap_view | from, | |
sezap_view | to, | |||
float | rho, | |||
float | vel, | |||
float | dt | |||
) |
Perform the zoom-/pan- animation.
from | Start position. | |
to | End position. | |
rho | Zoom/pan tradeoff factor. | |
vel | Animation-velocity. | |
dt | Timestep. |