BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BALL::VIEW::Camera Class Reference

#include <BALL/VIEW/KERNEL/stage.h>

Public Types

enum  ProjectionMode { PERSPECTIVE = 0, ORTHOGRAPHIC }
 Enumeration of different projection modes. More...
 

Public Member Functions

virtual void dump (std::ostream &s=std::cout, Size depth=0) const
 
Constructors and Destructors
 Camera ()
 Constructor. More...
 
 Camera (const Camera &camera)
 Copy Constructor. More...
 
 Camera (const Vector3 &view_point, const Vector3 &look_at, const Vector3 &look_up_vector, const ProjectionMode &mode=PERSPECTIVE)
 
virtual ~Camera ()
 Destructor. More...
 
Cameraoperator= (const Camera &camera)
 
Accessors
void moveRight (float translation)
 Move the camera along the right vector. More...
 
void moveUp (float translation)
 Move the camera along the up vector. More...
 
void moveForward (float translation)
 Move the camera along the view vector. More...
 
const Vector3getViewPoint () const
 Get the position of the camera. More...
 
void setViewPoint (const Vector3 &view_point)
 Set the position of the camera. More...
 
const Vector3getLookAtPosition () const
 Get the direction of the camera. More...
 
void setLookAtPosition (const Vector3 &look_at)
 Set the direction of the camera. More...
 
const Vector3getLookUpVector () const
 Get the look up vector. More...
 
void setLookUpVector (const Vector3 &look_up_vector)
 Set the look up vector. More...
 
float getDistance () const
 Get the distance between the view point and the look at point. More...
 
Vector3 getViewVector () const
 Get the view vector. More...
 
Vector3 getRightVector () const
 Get an vector orthogonal to the viewing vector and showing to the right. More...
 
void translate (const Vector3 &v)
 Translate the view point and the point the camera is looking to by a given vector. More...
 
void rotate (const Quaternion &q, const Vector3 &origin)
 Rotate the camera. More...
 
void rotate (const Matrix4x4 &mat, const Vector3 &origin)
 Rotate the camera. More...
 
virtual void clear ()
 Reset Camera to standard values. More...
 
void setProjectionMode (ProjectionMode const &mode)
 Set the projection mode. More...
 
ProjectionMode getProjectionMode () const
 Get the projection mode. More...
 
String toString () const
 
bool readFromString (const String &data)
 
Predicates
bool operator== (const Camera &camera) const
 
bool operator< (const Camera &camera) const
 Needed for MSVC. More...
 

Protected Member Functions

void calculateVectors_ ()
 

Protected Attributes

Vector3 view_point_
 
Vector3 look_at_
 
Vector3 look_up_vector_
 
Vector3 view_vector_
 
Vector3 right_vector_
 
ProjectionMode projection_mode_
 

Detailed Description

Camera with viewpoint, a look at point and an up-vector.

Definition at line 228 of file stage.h.

Member Enumeration Documentation

Enumeration of different projection modes.

Enumerator
PERSPECTIVE 
ORTHOGRAPHIC 

Definition at line 233 of file stage.h.

Constructor & Destructor Documentation

BALL::VIEW::Camera::Camera ( )

Constructor.

BALL::VIEW::Camera::Camera ( const Camera camera)

Copy Constructor.

BALL::VIEW::Camera::Camera ( const Vector3 view_point,
const Vector3 look_at,
const Vector3 look_up_vector,
const ProjectionMode mode = PERSPECTIVE 
)
virtual BALL::VIEW::Camera::~Camera ( )
inlinevirtual

Destructor.

Definition at line 252 of file stage.h.

Member Function Documentation

void BALL::VIEW::Camera::calculateVectors_ ( )
protected
virtual void BALL::VIEW::Camera::clear ( )
inlinevirtual

Reset Camera to standard values.

Definition at line 326 of file stage.h.

virtual void BALL::VIEW::Camera::dump ( std::ostream &  s = std::cout,
Size  depth = 0 
) const
virtual

Internal value dump. Dump the current state of this instance to the output ostream s with dumping depth depth.

Parameters
soutput stream
depththe dumping depth
float BALL::VIEW::Camera::getDistance ( ) const
inline

Get the distance between the view point and the look at point.

Definition at line 304 of file stage.h.

const Vector3& BALL::VIEW::Camera::getLookAtPosition ( ) const
inline

Get the direction of the camera.

Definition at line 288 of file stage.h.

const Vector3& BALL::VIEW::Camera::getLookUpVector ( ) const
inline

Get the look up vector.

Definition at line 296 of file stage.h.

ProjectionMode BALL::VIEW::Camera::getProjectionMode ( ) const
inline

Get the projection mode.

Definition at line 334 of file stage.h.

Vector3 BALL::VIEW::Camera::getRightVector ( ) const
inline

Get an vector orthogonal to the viewing vector and showing to the right.

Definition at line 312 of file stage.h.

const Vector3& BALL::VIEW::Camera::getViewPoint ( ) const
inline

Get the position of the camera.

Definition at line 280 of file stage.h.

Vector3 BALL::VIEW::Camera::getViewVector ( ) const
inline

Get the view vector.

Definition at line 308 of file stage.h.

void BALL::VIEW::Camera::moveForward ( float  translation)
inline

Move the camera along the view vector.

Definition at line 271 of file stage.h.

void BALL::VIEW::Camera::moveRight ( float  translation)
inline

Move the camera along the right vector.

Definition at line 263 of file stage.h.

void BALL::VIEW::Camera::moveUp ( float  translation)
inline

Move the camera along the up vector.

Definition at line 267 of file stage.h.

bool BALL::VIEW::Camera::operator< ( const Camera camera) const

Needed for MSVC.

Camera& BALL::VIEW::Camera::operator= ( const Camera camera)
bool BALL::VIEW::Camera::operator== ( const Camera camera) const
bool BALL::VIEW::Camera::readFromString ( const String data)
void BALL::VIEW::Camera::rotate ( const Quaternion q,
const Vector3 origin 
)

Rotate the camera.

void BALL::VIEW::Camera::rotate ( const Matrix4x4 mat,
const Vector3 origin 
)

Rotate the camera.

void BALL::VIEW::Camera::setLookAtPosition ( const Vector3 look_at)
inline

Set the direction of the camera.

Definition at line 292 of file stage.h.

void BALL::VIEW::Camera::setLookUpVector ( const Vector3 look_up_vector)
inline

Set the look up vector.

Definition at line 300 of file stage.h.

void BALL::VIEW::Camera::setProjectionMode ( ProjectionMode const &  mode)
inline

Set the projection mode.

Definition at line 330 of file stage.h.

void BALL::VIEW::Camera::setViewPoint ( const Vector3 view_point)
inline

Set the position of the camera.

Definition at line 284 of file stage.h.

String BALL::VIEW::Camera::toString ( ) const
void BALL::VIEW::Camera::translate ( const Vector3 v)
inline

Translate the view point and the point the camera is looking to by a given vector.

Definition at line 316 of file stage.h.

Member Data Documentation

Vector3 BALL::VIEW::Camera::look_at_
protected

Definition at line 373 of file stage.h.

Vector3 BALL::VIEW::Camera::look_up_vector_
protected

Definition at line 376 of file stage.h.

ProjectionMode BALL::VIEW::Camera::projection_mode_
protected

Definition at line 390 of file stage.h.

Vector3 BALL::VIEW::Camera::right_vector_
protected

Definition at line 386 of file stage.h.

Vector3 BALL::VIEW::Camera::view_point_
protected

Definition at line 370 of file stage.h.

Vector3 BALL::VIEW::Camera::view_vector_
protected

Definition at line 381 of file stage.h.