Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

Camera Class Reference

#include <Camera.h>

List of all members.

Public Member Functions

 Camera ()
virtual ~Camera ()
void changeHeading (float degrees)
void setHeading (float degrees)
void changePitch (float degrees)
void setPitch (float degrees)
void setPrespective (float dTime=0.0f, bool movePos=true)
void setProjection (float angle, int width, int height, float n, float f)
void moveForward (float val)
void strafeRight (float val)
void moveUp (float val)
void setPosition (Vec3 position)
Vec3 getPosition ()
Vec3 getUp ()
Vec3 getDir ()
void shake (float time, float speed, float intensity)
void updateFrustum ()
float getPitch ()
float getHeading ()
bool sphereInFrustum (Vec3 pos, float r)

Protected Member Functions

void setPos (float dTime)

Protected Attributes

bool isMoved
float m_headingDegrees
float m_pitchDegrees
Quaternion m_heading
Quaternion m_pitch
Vec3 m_position
Vec3 m_direction
Vec3 m_up
Vec3 m_strafe
float m_shakeTime
float m_shakeSpeed
float m_shakeIntensity
GLfloat m_Frustum [6][4]


Detailed Description

Camera.h

Author: Petter Alstermark, petter@alstermark.com

Definition at line 14 of file Camera.h.


Constructor & Destructor Documentation

Camera::Camera  ) 
 

Camera.cpp

Author: Petter Alstermark, petter@alstermark.com

Definition at line 9 of file Camera.cpp.

References isMoved, m_headingDegrees, m_pitchDegrees, m_shakeIntensity, and m_shakeTime.

Camera::~Camera  )  [virtual]
 

Definition at line 21 of file Camera.cpp.


Member Function Documentation

void Camera::changeHeading float  degrees  ) 
 

Definition at line 98 of file Camera.cpp.

References m_headingDegrees, and m_pitchDegrees.

void Camera::changePitch float  degrees  ) 
 

Definition at line 85 of file Camera.cpp.

References m_pitchDegrees.

Vec3 Camera::getDir  )  [inline]
 

Definition at line 30 of file Camera.h.

References m_direction.

float Camera::getHeading  )  [inline]
 

Definition at line 34 of file Camera.h.

References m_headingDegrees.

Referenced by Menu::drawFrame(), Join::drawFrame(), Menu::setCamera(), and Join::setCamera().

float Camera::getPitch  )  [inline]
 

Definition at line 33 of file Camera.h.

References m_pitchDegrees.

Referenced by Menu::drawFrame(), Join::drawFrame(), Menu::setCamera(), and Join::setCamera().

Vec3 Camera::getPosition  ) 
 

Definition at line 131 of file Camera.cpp.

References m_position, Vec3::x, Vec3::y, and Vec3::z.

Referenced by Menu::drawFrame(), Join::drawGalaxies(), Menu::setCamera(), and Join::setCamera().

Vec3 Camera::getUp  )  [inline]
 

Definition at line 29 of file Camera.h.

References m_up.

Referenced by Menu::drawFrame().

void Camera::moveForward float  val  ) 
 

Definition at line 115 of file Camera.cpp.

References m_direction, and m_position.

void Camera::moveUp float  val  ) 
 

Definition at line 123 of file Camera.cpp.

References m_position, and m_up.

void Camera::setHeading float  degrees  ) 
 

Definition at line 110 of file Camera.cpp.

References m_headingDegrees.

Referenced by Menu::drawFrame(), Join::drawFrame(), Menu::load(), Join::load(), Menu::setCamera(), Join::setCamera(), and Play::setPlayerCam().

void Camera::setPitch float  degrees  ) 
 

Definition at line 94 of file Camera.cpp.

References m_pitchDegrees.

Referenced by Menu::drawFrame(), Join::drawFrame(), Menu::load(), Join::load(), Menu::setCamera(), Join::setCamera(), and Play::setPlayerCam().

void Camera::setPos float  dTime  )  [protected]
 

Definition at line 61 of file Camera.cpp.

References isMoved, m_position, m_shakeIntensity, m_shakeSpeed, m_shakeTime, Vec3::x, Vec3::y, and Vec3::z.

Referenced by setPrespective().

void Camera::setPosition Vec3  position  ) 
 

Definition at line 127 of file Camera.cpp.

References m_position, Vec3::x, Vec3::y, and Vec3::z.

Referenced by MainApp::initialize(), Menu::load(), Join::load(), Menu::setCamera(), Join::setCamera(), and Play::setPlayerCam().

void Camera::setPrespective float  dTime = 0.0f,
bool  movePos = true
 

Definition at line 24 of file Camera.cpp.

References Quaternion::createFromAxisAngle(), Quaternion::createMatrix(), isMoved, m_direction, m_heading, m_headingDegrees, m_pitch, m_pitchDegrees, m_strafe, m_up, setPos(), Vec3::x, Vec3::y, and Vec3::z.

Referenced by Play::drawFrame(), Menu::drawFrame(), and Join::drawFrame().

Here is the call graph for this function:

void Camera::setProjection float  angle,
int  width,
int  height,
float  n,
float  f
 

Definition at line 77 of file Camera.cpp.

Referenced by Menu::drawFrame(), and Join::drawFrame().

void Camera::shake float  time,
float  speed,
float  intensity
 

Definition at line 135 of file Camera.cpp.

References m_shakeIntensity, m_shakeSpeed, and m_shakeTime.

Referenced by Play::grenadeExplode().

bool Camera::sphereInFrustum Vec3  pos,
float  r
 

Definition at line 261 of file Camera.cpp.

References m_Frustum, Vec3::x, Vec3::y, and Vec3::z.

Referenced by Menu::drawCreate(), Menu::drawFrame(), Menu::drawJoin(), Menu::drawMain(), Play::drawParticleSystems(), Play::drawPlayer(), and Menu::drawSettings().

void Camera::strafeRight float  val  ) 
 

Definition at line 119 of file Camera.cpp.

References m_position, and m_strafe.

void Camera::updateFrustum  ) 
 

Definition at line 141 of file Camera.cpp.

References m_Frustum.

Referenced by Play::drawFrame(), Menu::drawFrame(), and Join::drawFrame().


Member Data Documentation

bool Camera::isMoved [protected]
 

Definition at line 40 of file Camera.h.

Referenced by Camera(), setPos(), and setPrespective().

Vec3 Camera::m_direction [protected]
 

Definition at line 47 of file Camera.h.

Referenced by getDir(), moveForward(), and setPrespective().

GLfloat Camera::m_Frustum[6][4] [protected]
 

Definition at line 53 of file Camera.h.

Referenced by sphereInFrustum(), and updateFrustum().

Quaternion Camera::m_heading [protected]
 

Definition at line 44 of file Camera.h.

Referenced by setPrespective().

float Camera::m_headingDegrees [protected]
 

Definition at line 42 of file Camera.h.

Referenced by Camera(), changeHeading(), getHeading(), setHeading(), and setPrespective().

Quaternion Camera::m_pitch [protected]
 

Definition at line 45 of file Camera.h.

Referenced by setPrespective().

float Camera::m_pitchDegrees [protected]
 

Definition at line 43 of file Camera.h.

Referenced by Camera(), changeHeading(), changePitch(), getPitch(), setPitch(), and setPrespective().

Vec3 Camera::m_position [protected]
 

Definition at line 46 of file Camera.h.

Referenced by getPosition(), moveForward(), moveUp(), setPos(), setPosition(), and strafeRight().

float Camera::m_shakeIntensity [protected]
 

Definition at line 52 of file Camera.h.

Referenced by Camera(), setPos(), and shake().

float Camera::m_shakeSpeed [protected]
 

Definition at line 51 of file Camera.h.

Referenced by setPos(), and shake().

float Camera::m_shakeTime [protected]
 

Definition at line 50 of file Camera.h.

Referenced by Camera(), setPos(), and shake().

Vec3 Camera::m_strafe [protected]
 

Definition at line 49 of file Camera.h.

Referenced by setPrespective(), and strafeRight().

Vec3 Camera::m_up [protected]
 

Definition at line 48 of file Camera.h.

Referenced by getUp(), moveUp(), and setPrespective().


Generated on Sun Jun 5 15:49:22 2005 for Defacto by  doxygen 1.4.3