Used for the visualizer's camera base class. More...
#include <CCamera.H>
Public Member Functions | |
CCamera () | |
New CCamera object. | |
void | SetMoveBy (float move_by) |
Move by scale factor. | |
void | SetCamera (float x, float y, float z, float xv, float yv, float zv, float xu, float yu, float zu) |
Used to set up a default camera position. | |
void | Follow_Focus (float x, float y, float z) |
Set camera in focus mode at the specified location. | |
void | Bot_Focus (float x, float y, float z) |
Set the camera to focus on the box which is at the specified position. | |
void | Follow_Bot (float x, float y, float z) |
Set camera in follow bot mode. | |
void | MoveCamera (float direction) |
Move the camera in the specified direction. | |
void | UpdateCamera (float xDir, float yDir, float zDir, float dir) |
Update the camera position in the specified directions. | |
void | StrafeCam (float direction) |
Make the camera perform a strafing maneuver. | |
void | StrafeCam (float direction, float x, float y, float z) |
void | CalculateStrafe () |
Calculates the strafing parameters? | |
void | RotateCamera (float AngleDir, float xSpeed, float ySpeed, float zSpeed) |
Rotates the camera about the given angle. | |
void | RotateByMouse (int mousePosX, int mousePosY, int midX, int midY) |
Rotate the camera from mouse dragging input. | |
Public Attributes | |
float | xPos |
Camera position value. | |
float | yPos |
Camera position value. | |
float | zPos |
Camera position value. | |
float | xView |
Camera lookat (view) value. | |
float | yView |
Camera lookat (view) value. | |
float | zView |
Camera lookat (view) value. | |
float | xUp |
Up vector for camera. | |
float | yUp |
Up vector for camera. | |
float | zUp |
Up vector for camera. | |
float | xStrafe |
Strafing direction. | |
float | yStrafe |
Strafing direction. | |
float | zStrafe |
Strafing direction. | |
float | currentRotationAngle |
Keeps us from going too far up or down. | |
float | prev_bot_x |
Previous bot location. | |
float | prev_bot_y |
Previous bot location. | |
float | prev_bot_z |
Previous bot location. | |
float | desired_bot_x |
Desired bot location. | |
float | desired_bot_y |
Desired bot location. | |
float | desired_bot_z |
Desired bot location. | |
float | m_move_by |
Move by scale factor. |
Used for the visualizer's camera base class.
CCamera::CCamera | ( | ) |
void CCamera::Bot_Focus | ( | float | x, | |
float | y, | |||
float | z | |||
) |
Set the camera to focus on the box which is at the specified position.
x | ||
y | ||
z |
References xView, yView, and zView.
Referenced by cajun::simview_t::set_view().
void CCamera::CalculateStrafe | ( | ) |
void CCamera::Follow_Bot | ( | float | x, | |
float | y, | |||
float | z | |||
) |
Set camera in follow bot mode.
x | New bot x location. | |
y | New bot y location. | |
z | New bot z location. |
References prev_bot_x, prev_bot_y, prev_bot_z, xPos, yPos, and zPos.
Referenced by cajun::simview_t::set_view().
void CCamera::Follow_Focus | ( | float | x, | |
float | y, | |||
float | z | |||
) |
void CCamera::MoveCamera | ( | float | direction | ) |
Move the camera in the specified direction.
direction | I don't know what values should go here. |
References m_move_by, UpdateCamera(), xPos, xView, yPos, yView, zPos, and zView.
Referenced by cajun::simview_t::simview_interface_t::pressControlKey().
void CCamera::RotateByMouse | ( | int | mousePosX, | |
int | mousePosY, | |||
int | midX, | |||
int | midY | |||
) |
Rotate the camera from mouse dragging input.
mousePosX | Mouse x position. | |
mousePosY | Mouse y position. | |
midX | The middle of the screen, x coord. | |
midY | The middle of the screen, y coord. |
References RotateCamera(), xPos, xUp, xView, yPos, yUp, yView, zPos, zUp, and zView.
Referenced by cajun::simview_t::simview_interface_t::mousemotionhandler().
void CCamera::RotateCamera | ( | float | AngleDir, | |
float | xSpeed, | |||
float | ySpeed, | |||
float | zSpeed | |||
) |
Rotates the camera about the given angle.
AngleDir | ||
xSpeed | ||
ySpeed | ||
zSpeed |
References CQuaternion::Conjugate(), CQuaternion::Rotatef(), CQuaternion::w, CQuaternion::x, xPos, xView, CQuaternion::y, yPos, yView, CQuaternion::z, zPos, and zView.
Referenced by RotateByMouse().
void CCamera::SetCamera | ( | float | x, | |
float | y, | |||
float | z, | |||
float | xv, | |||
float | yv, | |||
float | zv, | |||
float | xu, | |||
float | yu, | |||
float | zu | |||
) |
void CCamera::SetMoveBy | ( | float | move_by | ) |
Move by scale factor.
move_by | The scale factor to use. |
References m_move_by.
Referenced by cajun::simview_t::simview_t().
void CCamera::StrafeCam | ( | float | direction, | |
float | x, | |||
float | y, | |||
float | z | |||
) |
void CCamera::StrafeCam | ( | float | direction | ) |
Make the camera perform a strafing maneuver.
direction | Direction to strafe in - not sure what allowable values are though. |
References CalculateStrafe(), m_move_by, UpdateCamera(), xStrafe, yStrafe, and zStrafe.
Referenced by cajun::simview_t::change_view(), and cajun::simview_t::simview_interface_t::pressControlKey().
void CCamera::UpdateCamera | ( | float | xDir, | |
float | yDir, | |||
float | zDir, | |||
float | dir | |||
) |
Update the camera position in the specified directions.
xDir | ||
yDir | ||
zDir | ||
dir |
References xPos, xView, yPos, yView, zPos, and zView.
Referenced by cajun::simview_t::change_view(), MoveCamera(), cajun::simview_t::simview_interface_t::pressControlKey(), and StrafeCam().
Keeps us from going too far up or down.
float CCamera::desired_bot_x |
Desired bot location.
float CCamera::desired_bot_y |
Desired bot location.
float CCamera::desired_bot_z |
Desired bot location.
float CCamera::m_move_by |
Move by scale factor.
Referenced by CCamera(), MoveCamera(), SetMoveBy(), and StrafeCam().
float CCamera::prev_bot_x |
Previous bot location.
Referenced by CCamera(), and Follow_Bot().
float CCamera::prev_bot_y |
Previous bot location.
Referenced by CCamera(), and Follow_Bot().
float CCamera::prev_bot_z |
Previous bot location.
Referenced by CCamera(), and Follow_Bot().
float CCamera::xPos |
Camera position value.
Referenced by CalculateStrafe(), CCamera(), Follow_Bot(), cajun::simview_t::simview_interface_t::get_camera_pos(), cajun::simview_t::simview_interface_t::get_camera_view_angles(), MoveCamera(), RotateByMouse(), RotateCamera(), cajun::simview_t::set_view(), SetCamera(), and UpdateCamera().
float CCamera::xStrafe |
Strafing direction.
Referenced by CalculateStrafe(), CCamera(), and StrafeCam().
float CCamera::xUp |
Up vector for camera.
Referenced by CalculateStrafe(), CCamera(), RotateByMouse(), cajun::simview_t::set_view(), and SetCamera().
float CCamera::xView |
Camera lookat (view) value.
Referenced by Bot_Focus(), CalculateStrafe(), CCamera(), Follow_Focus(), cajun::simview_t::simview_interface_t::get_camera_view(), cajun::simview_t::simview_interface_t::get_camera_view_angles(), MoveCamera(), RotateByMouse(), RotateCamera(), cajun::simview_t::set_view(), SetCamera(), and UpdateCamera().
float CCamera::yPos |
Camera position value.
Referenced by CalculateStrafe(), CCamera(), Follow_Bot(), cajun::simview_t::simview_interface_t::get_camera_pos(), cajun::simview_t::simview_interface_t::get_camera_view_angles(), MoveCamera(), RotateByMouse(), RotateCamera(), cajun::simview_t::set_view(), SetCamera(), and UpdateCamera().
float CCamera::yStrafe |
Strafing direction.
Referenced by CalculateStrafe(), CCamera(), and StrafeCam().
float CCamera::yUp |
Up vector for camera.
Referenced by CalculateStrafe(), CCamera(), RotateByMouse(), cajun::simview_t::set_view(), and SetCamera().
float CCamera::yView |
Camera lookat (view) value.
Referenced by Bot_Focus(), CalculateStrafe(), CCamera(), Follow_Focus(), cajun::simview_t::simview_interface_t::get_camera_view(), cajun::simview_t::simview_interface_t::get_camera_view_angles(), MoveCamera(), RotateByMouse(), RotateCamera(), cajun::simview_t::set_view(), SetCamera(), and UpdateCamera().
float CCamera::zPos |
Camera position value.
Referenced by CalculateStrafe(), CCamera(), Follow_Bot(), cajun::simview_t::simview_interface_t::get_camera_pos(), cajun::simview_t::simview_interface_t::get_camera_view_angles(), MoveCamera(), RotateByMouse(), RotateCamera(), cajun::simview_t::set_view(), SetCamera(), and UpdateCamera().
float CCamera::zStrafe |
Strafing direction.
Referenced by CalculateStrafe(), CCamera(), and StrafeCam().
float CCamera::zUp |
Up vector for camera.
Referenced by CalculateStrafe(), CCamera(), RotateByMouse(), cajun::simview_t::set_view(), and SetCamera().
float CCamera::zView |
Camera lookat (view) value.
Referenced by Bot_Focus(), CalculateStrafe(), CCamera(), Follow_Focus(), cajun::simview_t::simview_interface_t::get_camera_view(), cajun::simview_t::simview_interface_t::get_camera_view_angles(), MoveCamera(), RotateByMouse(), RotateCamera(), cajun::simview_t::set_view(), SetCamera(), and UpdateCamera().