#include <gl_camera.h>
Public Types | |
typedef TrackBall< math_types > | base_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. |
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) ....
typedef TrackBall<math_types> OpenTissue::gl::Camera< math_types >::base_class |
typedef math_types::matrix3x3_type OpenTissue::gl::Camera< math_types >::matrix3x3_type |
Reimplemented from OpenTissue::gl::TrackBall< math_types >.
typedef math_types::real_type OpenTissue::gl::Camera< math_types >::real_type |
Reimplemented from OpenTissue::gl::TrackBall< math_types >.
typedef math_types::vector3_type OpenTissue::gl::Camera< math_types >::vector3_type |
Reimplemented from OpenTissue::gl::TrackBall< math_types >.
OpenTissue::gl::Camera< math_types >::Camera | ( | ) | [inline] |
real_type OpenTissue::gl::Camera< math_types >::depth | ( | vector3_type const & | r | ) | const [inline] |
Get Depth.
r | Some position in world coordinate space |
vector3_type const& OpenTissue::gl::Camera< math_types >::dof | ( | ) | const [inline] |
GLfloat const* OpenTissue::gl::Camera< math_types >::get_modelview_matrix | ( | ) | const [inline] |
void OpenTissue::gl::Camera< math_types >::init | ( | vector3_type const & | position_, | |
vector3_type const & | target_, | |||
vector3_type const & | up_ | |||
) | [inline] |
position_ | ||
target_ | ||
up_ |
void OpenTissue::gl::Camera< math_types >::mouse_down | ( | real_type const & | sx, | |
real_type const & | sy | |||
) | [inline] |
sx | ||
sy |
void OpenTissue::gl::Camera< math_types >::mouse_move | ( | real_type const & | sx, | |
real_type const & | sy | |||
) | [inline] |
sx | ||
sy |
void OpenTissue::gl::Camera< math_types >::mouse_up | ( | real_type const & | sx, | |
real_type const & | sy | |||
) | [inline] |
sx | ||
sy |
void OpenTissue::gl::Camera< math_types >::move | ( | real_type const & | distance | ) | [inline] |
zoom_factor | Example double size : 2, halfside : 0.5; |
void OpenTissue::gl::Camera< math_types >::orbit | ( | matrix3x3_type const & | R | ) | [inline] |
Orbit around target.
R | The matrix indicating the rotation to orbit with. |
bool const& OpenTissue::gl::Camera< math_types >::orbit_mode | ( | ) | const [inline] |
bool& OpenTissue::gl::Camera< math_types >::orbit_mode | ( | ) | [inline] |
void OpenTissue::gl::Camera< math_types >::pan | ( | real_type const & | x, | |
real_type const & | y | |||
) | [inline] |
Pan Camera.
x | Horizontal camera displacement. | |
y | Vertical camera displacement. |
vector3_type const& OpenTissue::gl::Camera< math_types >::position | ( | ) | const [inline] |
vector3_type const& OpenTissue::gl::Camera< math_types >::right | ( | ) | const [inline] |
void OpenTissue::gl::Camera< math_types >::rotate | ( | matrix3x3_type const & | R | ) | [inline] |
Rotate Camera.
R |
vector3_type const& OpenTissue::gl::Camera< math_types >::target | ( | ) | const [inline] |
bool& OpenTissue::gl::Camera< math_types >::target_locked | ( | ) | [inline] |
bool const& OpenTissue::gl::Camera< math_types >::target_locked | ( | ) | const [inline] |
vector3_type const& OpenTissue::gl::Camera< math_types >::up | ( | ) | const [inline] |
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....
GLfloat OpenTissue::gl::Camera< math_types >::m_modelview[16] [protected] |
bool OpenTissue::gl::Camera< math_types >::m_orbit_mode [protected] |
Boolean flag indicating whether camera is orbiting or rotation duing a mouse move.
vector3_type OpenTissue::gl::Camera< math_types >::m_position [protected] |
Viewer Position (Placement of Camera in Model Space.
vector3_type OpenTissue::gl::Camera< math_types >::m_right [protected] |
Direction to the right in model space.
vector3_type OpenTissue::gl::Camera< math_types >::m_target [protected] |
Viewer Target, the spot in the model space we are looking at.
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).
vector3_type OpenTissue::gl::Camera< math_types >::m_tmp_position [protected] |
Temporaries used for handling trackball.
vector3_type OpenTissue::gl::Camera< math_types >::m_tmp_target [protected] |
Temporaries used for handling trackball.
vector3_type OpenTissue::gl::Camera< math_types >::m_tmp_up [protected] |
Temporaries used for handling trackball.
vector3_type OpenTissue::gl::Camera< math_types >::m_up [protected] |
Viwer Up, the direction in model space that is upwards.