Public Types | Public Member Functions | Protected Attributes

OpenTissue::gl::Camera< math_types > Class Template Reference

#include <gl_camera.h>

Inheritance diagram for OpenTissue::gl::Camera< math_types >:
OpenTissue::gl::TrackBall< math_types >

List of all members.

Public Types

typedef TrackBall< math_typesbase_class
typedef math_types::real_type real_type
typedef math_types::vector3_type vector3_type
typedef math_types::matrix3x3_type matrix3x3_type

Public Member Functions

vector3_type const & up () const
vector3_type const & target () const
vector3_type const & position () const
vector3_type const & right () const
vector3_type const & dof () const
GLfloat const * get_modelview_matrix () const
bool & orbit_mode ()
bool const & orbit_mode () const
bool & target_locked ()
bool const & target_locked () const
 Camera ()
void init (vector3_type const &position_, vector3_type const &target_, vector3_type const &up_)
real_type depth (vector3_type const &r) const
void rotate (matrix3x3_type const &R)
void orbit (matrix3x3_type const &R)
void pan (real_type const &x, real_type const &y)
void move (real_type const &distance)
void mouse_down (real_type const &sx, real_type const &sy)
void mouse_up (real_type const &sx, real_type const &sy)
void mouse_move (real_type const &sx, real_type const &sy)

Protected Attributes

vector3_type m_position
 Viewer Position (Placement of Camera in Model Space.
vector3_type m_target
 Viewer Target, the spot in the model space we are looking at.
vector3_type m_up
 Viwer Up, the direction in model space that is upwards.
vector3_type m_dof
 Direction of Flight, i.e. the direction in model space we are moving forward in....
vector3_type m_right
 Direction to the right in model space.
GLfloat m_modelview [16]
 Model to Camera Space Transformation Matrix. In column-major order.
bool m_orbit_mode
 Boolean flag indicating whether camera is orbiting or rotation duing a mouse move.
bool m_target_locked
 Boolean flag indicating whether target positions is locked (ie. we allways look at the same spot).
vector3_type m_tmp_position
 Temporaries used for handling trackball.
vector3_type m_tmp_target
 Temporaries used for handling trackball.
vector3_type m_tmp_up
 Temporaries used for handling trackball.

Detailed Description

template<typename math_types>
class OpenTissue::gl::Camera< math_types >

Camera Class. The camera class provides functionality for computing the coordinate transformation that brings you from your world space into your local camera coordinate frame.

In terms of GLU this similar to what the function gluLookAt() does.

When you want to use a Camera, then in your display handler write

... glMatrixMode( GL_MODELVIEW ); LoadCameraMatrix( camera) ....


Member Typedef Documentation

template<typename math_types>
typedef TrackBall<math_types> OpenTissue::gl::Camera< math_types >::base_class
template<typename math_types>
typedef math_types::real_type OpenTissue::gl::Camera< math_types >::real_type

Constructor & Destructor Documentation

template<typename math_types>
OpenTissue::gl::Camera< math_types >::Camera (  )  [inline]

Member Function Documentation

template<typename math_types>
real_type OpenTissue::gl::Camera< math_types >::depth ( vector3_type const &  r  )  const [inline]

Get Depth.

Parameters:
r Some position in world coordinate space
Returns:
The depth, i.e. signed distance along dof wrt. camera position.
template<typename math_types>
vector3_type const& OpenTissue::gl::Camera< math_types >::dof (  )  const [inline]
template<typename math_types>
GLfloat const* OpenTissue::gl::Camera< math_types >::get_modelview_matrix (  )  const [inline]
template<typename math_types>
void OpenTissue::gl::Camera< math_types >::init ( vector3_type const &  position_,
vector3_type const &  target_,
vector3_type const &  up_ 
) [inline]
Parameters:
position_ 
target_ 
up_ 
template<typename math_types>
void OpenTissue::gl::Camera< math_types >::mouse_down ( real_type const &  sx,
real_type const &  sy 
) [inline]
Parameters:
sx 
sy 
template<typename math_types>
void OpenTissue::gl::Camera< math_types >::mouse_move ( real_type const &  sx,
real_type const &  sy 
) [inline]
Parameters:
sx 
sy 
template<typename math_types>
void OpenTissue::gl::Camera< math_types >::mouse_up ( real_type const &  sx,
real_type const &  sy 
) [inline]
Parameters:
sx 
sy 
template<typename math_types>
void OpenTissue::gl::Camera< math_types >::move ( real_type const &  distance  )  [inline]
Parameters:
zoom_factor Example double size : 2, halfside : 0.5;
template<typename math_types>
void OpenTissue::gl::Camera< math_types >::orbit ( matrix3x3_type const &  R  )  [inline]

Orbit around target.

Parameters:
R The matrix indicating the rotation to orbit with.
template<typename math_types>
bool const& OpenTissue::gl::Camera< math_types >::orbit_mode (  )  const [inline]
template<typename math_types>
bool& OpenTissue::gl::Camera< math_types >::orbit_mode (  )  [inline]
template<typename math_types>
void OpenTissue::gl::Camera< math_types >::pan ( real_type const &  x,
real_type const &  y 
) [inline]

Pan Camera.

Parameters:
x Horizontal camera displacement.
y Vertical camera displacement.
template<typename math_types>
vector3_type const& OpenTissue::gl::Camera< math_types >::position (  )  const [inline]
template<typename math_types>
vector3_type const& OpenTissue::gl::Camera< math_types >::right (  )  const [inline]
template<typename math_types>
void OpenTissue::gl::Camera< math_types >::rotate ( matrix3x3_type const &  R  )  [inline]

Rotate Camera.

Parameters:
R 
template<typename math_types>
vector3_type const& OpenTissue::gl::Camera< math_types >::target (  )  const [inline]
template<typename math_types>
bool& OpenTissue::gl::Camera< math_types >::target_locked (  )  [inline]
template<typename math_types>
bool const& OpenTissue::gl::Camera< math_types >::target_locked (  )  const [inline]
template<typename math_types>
vector3_type const& OpenTissue::gl::Camera< math_types >::up (  )  const [inline]

Member Data Documentation

template<typename math_types>
vector3_type OpenTissue::gl::Camera< math_types >::m_dof [protected]

Direction of Flight, i.e. the direction in model space we are moving forward in....

template<typename math_types>
GLfloat OpenTissue::gl::Camera< math_types >::m_modelview[16] [protected]

Model to Camera Space Transformation Matrix. In column-major order.

template<typename math_types>
bool OpenTissue::gl::Camera< math_types >::m_orbit_mode [protected]

Boolean flag indicating whether camera is orbiting or rotation duing a mouse move.

template<typename math_types>
vector3_type OpenTissue::gl::Camera< math_types >::m_position [protected]

Viewer Position (Placement of Camera in Model Space.

template<typename math_types>
vector3_type OpenTissue::gl::Camera< math_types >::m_right [protected]

Direction to the right in model space.

template<typename math_types>
vector3_type OpenTissue::gl::Camera< math_types >::m_target [protected]

Viewer Target, the spot in the model space we are looking at.

template<typename math_types>
bool OpenTissue::gl::Camera< math_types >::m_target_locked [protected]

Boolean flag indicating whether target positions is locked (ie. we allways look at the same spot).

template<typename math_types>
vector3_type OpenTissue::gl::Camera< math_types >::m_tmp_position [protected]

Temporaries used for handling trackball.

template<typename math_types>
vector3_type OpenTissue::gl::Camera< math_types >::m_tmp_target [protected]

Temporaries used for handling trackball.

template<typename math_types>
vector3_type OpenTissue::gl::Camera< math_types >::m_tmp_up [protected]

Temporaries used for handling trackball.

template<typename math_types>
vector3_type OpenTissue::gl::Camera< math_types >::m_up [protected]

Viwer Up, the direction in model space that is upwards.


The documentation for this class was generated from the following file: