Direct Graphical Models  v.1.7.0
DirectGraphicalModels::vis::CTrackballCamera Class Reference

Trackball camera class. More...

#include <TrackballCamera.h>

Inheritance diagram for DirectGraphicalModels::vis::CTrackballCamera:

Public Member Functions

 CTrackballCamera (float theta, float phi, float radius)
 Constructor. More...
 
virtual ~CTrackballCamera (void)
 
void reset (void)
 Resets the camera position. More...
 
glm::mat4 getViewMatrix (void)
 Returns the view matrix within the camera coordinate. More...
 

Protected Member Functions

void rotate (float dTheta, float dPhi)
 
void zoom (float dRadius)
 
void pan (float dx, float dy)
 
glm::vec3 getCameraOrintation (void) const
 
glm::vec3 getCameraPosition (void) const
 
void updateViewMatrix (void)
 

Private Attributes

float m_initTheta
 
float m_initPhi
 
float m_initRadius
 
float m_theta
 
float m_phi
 
float m_radius
 
float m_up
 
glm::vec3 m_target
 
glm::mat4 m_view
 
bool m_viewNeedsUpdate
 

Detailed Description

Trackball camera class.

This class inplements the trackball camera, defined in polar coordinate system and looking at origin point \(O\).

Author
Sergey G. Kosov, serge.nosp@m.y.ko.nosp@m.sov@p.nosp@m.roje.nosp@m.ct-10.nosp@m..de

Definition at line 16 of file TrackballCamera.h.

Constructor & Destructor Documentation

◆ CTrackballCamera()

DirectGraphicalModels::vis::CTrackballCamera::CTrackballCamera ( float  theta,
float  phi,
float  radius 
)
inline

Constructor.

The camera is defined in polar coordinate system with the parameters theta, phi and radius in point \(P\) and looks at the origin \(O\), which is initially situated at the zero point.

Parameters
thetaThe azimuth (or azimuthal angle) measured from the azimuth reference direction to the orthogonal projection of the line segment \(OP\) on the reference plane
phiThe inclination (or polar angle) between the zenith direction and the line segment \(OP\)
radiusThe radial distance of the camera to origin, i.e. the Euclidian distance between \(O\) and \(P\)

Definition at line 27 of file TrackballCamera.h.

◆ ~CTrackballCamera()

virtual DirectGraphicalModels::vis::CTrackballCamera::~CTrackballCamera ( void  )
inlinevirtual

Definition at line 39 of file TrackballCamera.h.

Member Function Documentation

◆ getCameraOrintation()

glm::vec3 DirectGraphicalModels::vis::CTrackballCamera::getCameraOrintation ( void  ) const
inlineprotected

Definition at line 57 of file TrackballCamera.h.

Here is the caller graph for this function:

◆ getCameraPosition()

glm::vec3 DirectGraphicalModels::vis::CTrackballCamera::getCameraPosition ( void  ) const
inlineprotected

Definition at line 58 of file TrackballCamera.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getViewMatrix()

glm::mat4 DirectGraphicalModels::vis::CTrackballCamera::getViewMatrix ( void  )

Returns the view matrix within the camera coordinate.

Returns
The view matrix within the camera coordinate

Definition at line 15 of file TrackballCamera.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pan()

void DirectGraphicalModels::vis::CTrackballCamera::pan ( float  dx,
float  dy 
)
protected

Definition at line 50 of file TrackballCamera.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void DirectGraphicalModels::vis::CTrackballCamera::reset ( void  )

Resets the camera position.

Definition at line 5 of file TrackballCamera.cpp.

Here is the caller graph for this function:

◆ rotate()

void DirectGraphicalModels::vis::CTrackballCamera::rotate ( float  dTheta,
float  dPhi 
)
protected

Definition at line 25 of file TrackballCamera.cpp.

Here is the caller graph for this function:

◆ updateViewMatrix()

void DirectGraphicalModels::vis::CTrackballCamera::updateViewMatrix ( void  )
inlineprotected

Definition at line 59 of file TrackballCamera.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zoom()

void DirectGraphicalModels::vis::CTrackballCamera::zoom ( float  dRadius)
protected

Definition at line 43 of file TrackballCamera.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ m_initPhi

float DirectGraphicalModels::vis::CTrackballCamera::m_initPhi
private

Definition at line 64 of file TrackballCamera.h.

◆ m_initRadius

float DirectGraphicalModels::vis::CTrackballCamera::m_initRadius
private

Definition at line 65 of file TrackballCamera.h.

◆ m_initTheta

float DirectGraphicalModels::vis::CTrackballCamera::m_initTheta
private

Definition at line 63 of file TrackballCamera.h.

◆ m_phi

float DirectGraphicalModels::vis::CTrackballCamera::m_phi
private

Definition at line 67 of file TrackballCamera.h.

◆ m_radius

float DirectGraphicalModels::vis::CTrackballCamera::m_radius
private

Definition at line 68 of file TrackballCamera.h.

◆ m_target

glm::vec3 DirectGraphicalModels::vis::CTrackballCamera::m_target
private

Definition at line 71 of file TrackballCamera.h.

◆ m_theta

float DirectGraphicalModels::vis::CTrackballCamera::m_theta
private

Definition at line 66 of file TrackballCamera.h.

◆ m_up

float DirectGraphicalModels::vis::CTrackballCamera::m_up
private

Definition at line 69 of file TrackballCamera.h.

◆ m_view

glm::mat4 DirectGraphicalModels::vis::CTrackballCamera::m_view
private

Definition at line 72 of file TrackballCamera.h.

◆ m_viewNeedsUpdate

bool DirectGraphicalModels::vis::CTrackballCamera::m_viewNeedsUpdate
private

Definition at line 74 of file TrackballCamera.h.


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