OpenArena::Camera Class Reference

The Camera class represents a camera or view in 3-dimensional space. More...

#include <camera.h>

List of all members.

Public Member Functions

 Camera ()
 Creates a new Camera object.
Vec3f Position ()
 Returns this Camera's position.
Vec3d View ()
 Returns the view vector of this camera.
Vec3d UpVector ()
 Returns a vector pointing up with respect to the view.
Vec3d Strafe ()
 Returns this Camera's strafe vector.
void PositionCamera (double xpos, double ypos, double zpos, double xview, double yview, double zview, double xup, double yup, double zup)
 Relocates and reorients this Camera.
void PositionCamera (Vec3d pos, Vec3d view, Vec3d up)
 Relocates and reorients this Camera.
void RotateView (double angle, Vec3d axis)
 Rotates the camera a given ammount around a given axis.
void RotateView (double angle, double X, double Y, double Z)
 Rotates the camera a given ammount around a given axis.
void SetViewByMouse (Window window)
 Updates the view and up vectors based on mouse movement.
void StrafeCamera (double speed)
 Moves the camera along its strafe axis a given distance.
void MoveCamera (double speed)
 Moves the camera along its view vector a given number of units.
void Update ()
 Recalculates the strafe vector.
void Look ()
 Calls gluLookAt to tell OpenGL where to render from.
void RotateHorizontal (float angle)
 Write brief comment for RotateHorizontal here.
void RotateVertical (float angle)
 Write brief comment for RotateVertical here.

Private Member Functions

Vec3f GetUpVector ()
 Write brief comment for GetUpVector here.
Vec3f GetRightVector ()
 Write brief comment for GetRightVector here.
Vec3f GetForwardVector ()
 Write brief comment for GetForwardVector here.
void UpdateVectors ()

Private Attributes

Vec3f m_vPosition
Vec3f m_vView
Vec3f m_vUpVector
Vec3f m_vStrafe


Detailed Description

The Camera class represents a camera or view in 3-dimensional space.

The Camera class maintains location, view, and orientation (up view) vectors. The Camera can be moved and rotated in any direction. It includes a wrapper, Look(), for gluLookAt.

Remarks:
See also:


Constructor & Destructor Documentation

OpenArena::Camera::Camera (  ) 

Creates a new Camera object.

Creates a new Camera object located at the origin, pointing at the negative z-axis with up being the positive y-axis.


Member Function Documentation

Vec3f OpenArena::Camera::GetForwardVector (  )  [private]

Write brief comment for GetForwardVector here.

Returns:
Write description of return value here.
Exceptions:
<exception class> Description of criteria for throwing this exception.
Write detailed description for GetForwardVector here.

Remarks:
Write remarks for GetForwardVector here.
See also:
Separate items with the '|' character.

Vec3f OpenArena::Camera::GetRightVector (  )  [private]

Write brief comment for GetRightVector here.

Returns:
Write description of return value here.
Exceptions:
<exception class> Description of criteria for throwing this exception.
Write detailed description for GetRightVector here.

Remarks:
Write remarks for GetRightVector here.
See also:
Separate items with the '|' character.

Vec3f OpenArena::Camera::GetUpVector (  )  [private]

Write brief comment for GetUpVector here.

Returns:
Write description of return value here.
Exceptions:
<exception class> Description of criteria for throwing this exception.
Write detailed description for GetUpVector here.

Remarks:
Write remarks for GetUpVector here.
See also:
Separate items with the '|' character.

void OpenArena::Camera::Look (  ) 

Calls gluLookAt to tell OpenGL where to render from.

Remarks:
Uses the position, view, and up vectors.
See also:

void OpenArena::Camera::MoveCamera ( double  speed  ) 

Moves the camera along its view vector a given number of units.

Parameters:
speed The distance to move the camera.
Remarks:
See also:

Vec3f OpenArena::Camera::Position (  ) 

Returns this Camera's position.

Returns:
This Camera's position as a Vec3d vector.
Returns this Camera's position.

void OpenArena::Camera::PositionCamera ( Vec3d  pos,
Vec3d  view,
Vec3d  up 
)

Relocates and reorients this Camera.

Parameters:
pos The new position vector.
view The new view vector.
up The new up vector.
Remarks:
See also:

void OpenArena::Camera::PositionCamera ( double  xpos,
double  ypos,
double  zpos,
double  xview,
double  yview,
double  zview,
double  xup,
double  yup,
double  zup 
)

Relocates and reorients this Camera.

Parameters:
xpos The x-coordinate of the new position vector.
ypos The y-coordinate of the new position vector.
zpos The z-coordinate of the new position vector.
xview The x-coordinate of the new view vector.
yview The y-coordinate of the new view vector.
zview The z-coordinate of the new view vector.
xup The x-coordinate of the new up vector.
yup The y-coordinate of the new up vector.
zup The z-coordinate of the new up vector.
Remarks:
See also:

void OpenArena::Camera::RotateHorizontal ( float  angle  ) 

Write brief comment for RotateHorizontal here.

Parameters:
angle Description of parameter angle.
Exceptions:
<exception class> Description of criteria for throwing this exception.
Write detailed description for RotateHorizontal here.

Remarks:
Write remarks for RotateHorizontal here.
See also:
Separate items with the '|' character.

void OpenArena::Camera::RotateVertical ( float  angle  ) 

Write brief comment for RotateVertical here.

Parameters:
angle Description of parameter angle.
Exceptions:
<exception class> Description of criteria for throwing this exception.
Write detailed description for RotateVertical here.

Remarks:
Write remarks for RotateVertical here.
See also:
Separate items with the '|' character.

void OpenArena::Camera::RotateView ( double  angle,
double  X,
double  Y,
double  Z 
)

Rotates the camera a given ammount around a given axis.

Parameters:
angle The number of degrees to rotate.
X The x component of the vector representing the axis to rotate around
Y The y component of the vector representing the axis to rotate around
Z The z component of the vector representing the axis to rotate around
Remarks:
The vector should be normalized as the values get passed directly to glRotatef().
See also:

void OpenArena::Camera::RotateView ( double  angle,
Vec3d  axis 
)

Rotates the camera a given ammount around a given axis.

Parameters:
angle The number of degrees to rotate.
axis A vector representing the axis to rotate around.
This method passes the arguments to glRotatef()

Remarks:
See also:

void OpenArena::Camera::SetViewByMouse ( Window  window  ) 

Updates the view and up vectors based on mouse movement.

Parameters:
window The Window used to get the mouse coordinates.
Remarks:
This will be removed in favor of some sort of event trigger.
See also:

Vec3f OpenArena::Camera::Strafe (  ) 

Returns this Camera's strafe vector.

The strafe axis is an axis perpendicular to both the up vector and the view vector.

Returns:
This Camera's strafe vector.
Remarks:
See also:

void OpenArena::Camera::StrafeCamera ( double  speed  ) 

Moves the camera along its strafe axis a given distance.

Parameters:
speed The distance to move.
Remarks:
See also:

void OpenArena::Camera::Update (  ) 

Recalculates the strafe vector.

Remarks:
See also:

void OpenArena::Camera::UpdateVectors (  )  [private]

Vec3f OpenArena::Camera::UpVector (  ) 

Returns a vector pointing up with respect to the view.

Returns:
A vector pointing up with respect to the view.
Remarks:
See also:

Vec3f OpenArena::Camera::View (  ) 

Returns the view vector of this camera.

Returns:
The view vector of this camera.
Remarks:
See also:


Member Data Documentation

Vec3f OpenArena::Camera::m_vPosition [private]

Vec3f OpenArena::Camera::m_vStrafe [private]

Vec3f OpenArena::Camera::m_vUpVector [private]

Vec3f OpenArena::Camera::m_vView [private]


The documentation for this class was generated from the following files:
Generated on Tue Jul 11 00:17:52 2006 for OpenArena by  doxygen 1.4.7