Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Moteur3D::Camera Class Reference

The Camera class is designed to provide simple transformations in situations where you want your scene to be "filmed" from a position and in a specified direction. This is the most common situation. More...

#include <Camera.h>

Inheritance diagram for Moteur3D::Camera:

Moteur3D::SGTransformation Moteur3D::SphericalCamera List of all members.

Public Member Functions

 Camera ()
 Constructor.
 ~Camera ()
 Destructor.
Cameraoperator= (const Camera &c)
 Affectation operand.
void LookAt (Vector3 destination)
 Makes the Camera look at the desired coordinates.
void TranslateX (float x)
 Translates the Camera on its X axis. If the Camera is locked on an object, it will keep on looking at it.
void TranslateY (float y)
 Translates the Camera on its Y axis. If the Camera is locked on an object, it will keep on looking at it.
void TranslateZ (float z)
 Translates the Camera on its Z axis. If the Camera is locked on an object, it will keep on looking at it.
void Translate (Vector3 v)
 Translates the Camera on its X, Y and Z axis at the same time. If the Camera is locked on an object, it will keep on looking at it.
void SetPosition (Vector3 *pos)
 Sets the Camera's X, Y and Z position. If the Camera is locked on an object, it will keep on looking at it.
Vector3 GetPosition ()
 Returns the Camera's current position.
Vector3 GetDestination ()
 Returns the Camera's current destination.
void LockView ()
 Locks the view to the current destination position, which is set by calling LookAt().
void UnlockView ()
 Unlocks the view that was previously locked by LockView().
virtual void ApplyTransformation ()
 Applies the current transformation to the OpenGL's modelview matrix. This is a graphical-only function that should only use gl stuff.

Protected Member Functions

void CalcTrans ()
 Calculates the current transformation matrix from the Camera's coordinates and view destination. Used by ApplyTransformation only.

Protected Attributes

bool m_LockView
 is the view locked to a target ?
bool m_TransCalculated
 is the translation matrix already calculated ?
Vector3 m_Pos
 Camera's current position.
Vector3 m_Look
 Point the Camera is looking at.
Matrix4 m_TransMat
 Translation matrix used in display transformations.

Detailed Description

The Camera class is designed to provide simple transformations in situations where you want your scene to be "filmed" from a position and in a specified direction. This is the most common situation.


Constructor & Destructor Documentation

Moteur3D::Camera::Camera  ) 
 

Constructor.

Moteur3D::Camera::~Camera  ) 
 

Destructor.


Member Function Documentation

virtual void Moteur3D::Camera::ApplyTransformation  )  [virtual]
 

Applies the current transformation to the OpenGL's modelview matrix. This is a graphical-only function that should only use gl stuff.

Implements Moteur3D::SGTransformation.

void Moteur3D::Camera::CalcTrans  )  [protected]
 

Calculates the current transformation matrix from the Camera's coordinates and view destination. Used by ApplyTransformation only.

Vector3 Moteur3D::Camera::GetDestination  )  [inline]
 

Returns the Camera's current destination.

Returns:
Camera's position vector.

Vector3 Moteur3D::Camera::GetPosition  )  [inline]
 

Returns the Camera's current position.

Returns:
Camera's position vector.

void Moteur3D::Camera::LockView  )  [inline]
 

Locks the view to the current destination position, which is set by calling LookAt().

void Moteur3D::Camera::LookAt Vector3  destination  ) 
 

Makes the Camera look at the desired coordinates.

Parameters:
destination Coordinates Vector

Camera& Moteur3D::Camera::operator= const Camera c  )  [inline]
 

Affectation operand.

Parameters:
c Camera to copy data from
Returns:
this Camera

void Moteur3D::Camera::SetPosition Vector3 pos  ) 
 

Sets the Camera's X, Y and Z position. If the Camera is locked on an object, it will keep on looking at it.

Parameters:
pos position vector that will REPLACE the current camera's position.

void Moteur3D::Camera::Translate Vector3  v  ) 
 

Translates the Camera on its X, Y and Z axis at the same time. If the Camera is locked on an object, it will keep on looking at it.

Parameters:
v translation vector, to ADD to the current camera's position.

void Moteur3D::Camera::TranslateX float  x  ) 
 

Translates the Camera on its X axis. If the Camera is locked on an object, it will keep on looking at it.

Parameters:
x translation distance on the X axis

void Moteur3D::Camera::TranslateY float  y  ) 
 

Translates the Camera on its Y axis. If the Camera is locked on an object, it will keep on looking at it.

Parameters:
y translation distance on the Y axis

void Moteur3D::Camera::TranslateZ float  z  ) 
 

Translates the Camera on its Z axis. If the Camera is locked on an object, it will keep on looking at it.

Parameters:
z translation distance on the Z axis

void Moteur3D::Camera::UnlockView  )  [inline]
 

Unlocks the view that was previously locked by LockView().


Member Data Documentation

bool Moteur3D::Camera::m_LockView [protected]
 

is the view locked to a target ?

Vector3 Moteur3D::Camera::m_Look [protected]
 

Point the Camera is looking at.

Vector3 Moteur3D::Camera::m_Pos [protected]
 

Camera's current position.

bool Moteur3D::Camera::m_TransCalculated [protected]
 

is the translation matrix already calculated ?

Matrix4 Moteur3D::Camera::m_TransMat [protected]
 

Translation matrix used in display transformations.


The documentation for this class was generated from the following file:
Generated on Sat Oct 15 15:05:51 2005 for Moteur3D by  doxygen 1.4.4