Loading...
Searching...
No Matches
BALL::VIEW::Camera Class Reference
Visualisation » Kernel » Setup of the Stage, Camera and LightSources

`#include <BALL/VIEW/RENDERING/camera.h>`

## Public Types

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

## Public Member Functions

Constructors and Destructors
| Camera ()
| Constructor.
| Camera (const Camera &camera)
| Copy Constructor.
| Camera (const Vector3 &view_point, const Vector3 &look_at, const Vector3 &look_up_vector, const ProjectionMode &mode=PERSPECTIVE)
virtual | ~Camera ()
| Destructor.
Camera & | operator= (const Camera &camera)
Accessors
void | moveRight (float translation)
| Move the camera along the right vector.
void | moveUp (float translation)
| Move the camera along the up vector.
void | moveForward (float translation)
| Move the camera along the view vector.
const Vector3 & | getViewPoint () const
| Get the position of the camera.
void | setViewPoint (const Vector3 &view_point)
| Set the position of the camera.
const Vector3 & | getLookAtPosition () const
| Get the direction of the camera.
void | setLookAtPosition (const Vector3 &look_at)
| Set the direction of the camera.
const Vector3 & | getLookUpVector () const
| Get the look up vector.
void | setLookUpVector (const Vector3 &look_up_vector)
| Set the look up vector and compute the new right vector.
void | rotateAboutView (float degree)
| Rotate up and right around the view vector.
float | getDistance () const
| Get the distance between the view point and the look at point.
Vector3 | getViewVector () const
| Get the view vector.
Vector3 | getRightVector () const
| Get an vector orthogonal to the viewing vector and showing to the right.
void | translate (const Vector3 &v)
| Translate the view point and the point the camera is looking to by a given vector.
Vector3 | convertCameraToSceneCoordinates (const Vector3 &v)
| Convert the given vector from camera system to cartesian coordinates.
void | rotate (const Quaternion &q, const Vector3 &origin)
| Rotate the camera.
void | rotate (const Matrix4x4 &mat, const Vector3 &origin)
| Rotate the camera.
virtual void | clear ()
| Reset Camera to standard values.
void | setProjectionMode (ProjectionMode const &mode)
| Set the projection mode.
ProjectionMode | getProjectionMode () const
| Get the projection mode.
String | toString () const
bool | readFromString (const String &data)

## Predicates

Vector3 | view_point_
Vector3 | look_at_
Vector3 | look_up_vector_
Vector3 | view_vector_
Vector3 | right_vector_
ProjectionMode | projection_mode_
bool | operator== (const Camera &camera) const
bool | operator< (const Camera &camera) const
| Needed for MSVC.
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const
void | calculateVectors_ ()

## Detailed Description

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

Definition at line 23 of file camera.h.

## Member Enumeration Documentation

## ProjectionMode

enum BALL::VIEW::Camera::ProjectionMode

Enumeration of different projection modes.

Enumerator
PERSPECTIVE |
ORTHOGRAPHIC |

Definition at line 27 of file camera.h.

## Constructor & Destructor Documentation

## Camera() [1/3]

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

Constructor.

## Camera() [2/3]

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

Copy Constructor.

## Camera() [3/3]

BALL::VIEW::Camera::Camera | ( | const Vector3 & | view_point,
|  | const Vector3 & | look_at,
|  | const Vector3 & | look_up_vector,
|  | const ProjectionMode & | mode = PERSPECTIVE )

## ~Camera()

virtual BALL::VIEW::Camera::~Camera | ( |  | ) |

inline virtual

Destructor.

Definition at line 46 of file camera.h.

## Member Function Documentation

## calculateVectors_()

void BALL::VIEW::Camera::calculateVectors_ | ( |  | ) |

protected

## clear()

virtual void BALL::VIEW::Camera::clear | ( |  | ) |

inline virtual

Reset Camera to standard values.

Definition at line 125 of file camera.h.

## convertCameraToSceneCoordinates()

Vector3 BALL::VIEW::Camera::convertCameraToSceneCoordinates | ( | const Vector3 & | v | ) |

Convert the given vector from camera system to cartesian coordinates.

## dump()

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

  s | output stream
  depth | the dumping depth

## getDistance()

float BALL::VIEW::Camera::getDistance | ( |  | ) | const

inline

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

Definition at line 101 of file camera.h.

## getLookAtPosition()

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

inline

Get the direction of the camera.

Definition at line 82 of file camera.h.

## getLookUpVector()

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

inline

Get the look up vector.

Definition at line 90 of file camera.h.

## getProjectionMode()

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

inline

Get the projection mode.

Definition at line 133 of file camera.h.

## getRightVector()

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

inline

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

Definition at line 109 of file camera.h.

## getViewPoint()

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

inline

Get the position of the camera.

Definition at line 74 of file camera.h.

## getViewVector()

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

inline

Get the view vector.

Definition at line 105 of file camera.h.

## moveForward()

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

inline

Move the camera along the view vector.

Definition at line 65 of file camera.h.

## moveRight()

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

inline

Move the camera along the right vector.

Definition at line 57 of file camera.h.

## moveUp()

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

inline

Move the camera along the up vector.

Definition at line 61 of file camera.h.

## operator<()

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

Needed for MSVC.

## operator=()

Camera & BALL::VIEW::Camera::operator= | ( | const Camera & | camera | ) |

## operator==()

bool BALL::VIEW::Camera::operator== | ( | const Camera & | camera | ) | const

## readFromString()

bool BALL::VIEW::Camera::readFromString | ( | const String & | data | ) |

## rotate() [1/2]

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

Rotate the camera.

## rotate() [2/2]

void BALL::VIEW::Camera::rotate | ( | const Quaternion & | q,
|  | const Vector3 & | origin )

Rotate the camera.

## rotateAboutView()

void BALL::VIEW::Camera::rotateAboutView | ( | float | degree | ) |

Rotate up and right around the view vector.

## setLookAtPosition()

void BALL::VIEW::Camera::setLookAtPosition | ( | const Vector3 & | look_at | ) |

inline

Set the direction of the camera.

Definition at line 86 of file camera.h.

## setLookUpVector()

void BALL::VIEW::Camera::setLookUpVector | ( | const Vector3 & | look_up_vector | ) |

inline

Set the look up vector and compute the new right vector.

Definition at line 94 of file camera.h.

## setProjectionMode()

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

inline

Set the projection mode.

Definition at line 129 of file camera.h.

## setViewPoint()

void BALL::VIEW::Camera::setViewPoint | ( | const Vector3 & | view_point | ) |

inline

Set the position of the camera.

Definition at line 78 of file camera.h.

## toString()

String BALL::VIEW::Camera::toString | ( |  | ) | const

## translate()

void BALL::VIEW::Camera::translate | ( | const Vector3 & | v | ) |

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

## Member Data Documentation

## look_at_

Vector3 BALL::VIEW::Camera::look_at_

protected

Definition at line 171 of file camera.h.

## look_up_vector_

Vector3 BALL::VIEW::Camera::look_up_vector_

protected

Definition at line 174 of file camera.h.

## projection_mode_

ProjectionMode BALL::VIEW::Camera::projection_mode_

protected

Definition at line 188 of file camera.h.

## right_vector_

Vector3 BALL::VIEW::Camera::right_vector_

protected

Definition at line 184 of file camera.h.

## view_point_

Vector3 BALL::VIEW::Camera::view_point_

protected

Definition at line 168 of file camera.h.

## view_vector_

Vector3 BALL::VIEW::Camera::view_vector_

protected

Definition at line 179 of file camera.h.