Camera Class Reference

A camera is a class that can be used to setup the projection matrix in a simple way. More...

#include <Camera.h>

Collaboration diagram for Camera:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Camera ()
 Creates a camera in (0,0,0) with the CAMERA_GAME_MAIN mode.
void setup ()
 Set up the camera (i.e.
void setMode (CameraMode mode)
 Set the mode of the camera.
void setTrack (Sprite *new_track)
 Set the sprite the camera should look at.
void setFollow (Sprite *new_follow)
 Set the sprite the camera should follow.
float getFrustumDepth (void)
 Returns the depth of the frustum.
void setFrustumDepth (float depth)
 Sets the depth of the frustum.

Public Attributes

Spritefollow
 The camera should follow this object.
Spritetrack
 The camera should look at this object.
float where [3]
 Where the camera is now.
float frustum_depth
 How far the camera sees.
float spin
float tilt
float dist
 used when in rotation mode
CameraMode currentMode
 Mode of the camera.

Protected Member Functions

void gameSetup ()
void paneSetup (bool firstTime)
void binocularSetup (void)

Detailed Description

A camera is a class that can be used to setup the projection matrix in a simple way.

A camera object can contain logic and as such be able to do nice pans and sweeps or follow objects.

Before the scene is drawn the current cameras setup() method should be called.

Author:
Daniel Aarno and Erik Ytterberg
Version:
v0.0.0


Constructor & Destructor Documentation

Camera::Camera (  ) 

Creates a camera in (0,0,0) with the CAMERA_GAME_MAIN mode.


Member Function Documentation

void Camera::binocularSetup ( void   )  [protected]

void Camera::gameSetup (  )  [protected]

float Camera::getFrustumDepth ( void   ) 

Returns the depth of the frustum.

void Camera::paneSetup ( bool  firstTime  )  [protected]

void Camera::setFollow ( Sprite new_follow  ) 

Set the sprite the camera should follow.

void Camera::setFrustumDepth ( float  depth  ) 

Sets the depth of the frustum.

void Camera::setMode ( CameraMode  mode  ) 

Set the mode of the camera.

void Camera::setTrack ( Sprite new_track  ) 

Set the sprite the camera should look at.

void Camera::setup (  ) 

Set up the camera (i.e.

MV-matrix etc for the current mode.


Member Data Documentation

CameraMode Camera::currentMode

Mode of the camera.

float Camera::dist

used when in rotation mode

Sprite* Camera::follow

The camera should follow this object.

float Camera::frustum_depth

How far the camera sees.

float Camera::spin

float Camera::tilt

Sprite* Camera::track

The camera should look at this object.

float Camera::where[3]

Where the camera is now.


The documentation for this class was generated from the following file:
Generated on Sun Mar 11 15:33:26 2007 for MetalWarriors by  doxygen 1.4.7