ReTo  0.3.7
reto::Camera Class Reference

Class to manage camera. More...

#include <Camera.h>

+ Collaboration diagram for reto::Camera:

Public Member Functions

 Camera (float fov_=45.0f, float ratio_=16.0f/9, float nearPlane_=10.0f, float farPlane_=10000.0f)
 use as session name to disable ZEROEQ More...
 
 Camera (const std::string &session_, float fov_=45.0f, float ratio_=16.0f/9, float nearPlane_=10.0f, float farPlane_=10000.0f)
 Camera constructor. More...
 
 ~Camera (void)
 Default destructor.
 
void setZeqSession (const std::string &session_=std::string())
 Method to start or change the camera zeqSession. More...
 
float nearPlane (void) const
 Method to obtain the near plane distance. More...
 
void nearPlane (float nearPlane_)
 Method to establish the near plane distance. More...
 
float farPlane (void) const
 Method to obtain the far plane distance. More...
 
void farPlane (float farPlane_)
 Method to establish the far plane distance. More...
 
float fieldOfView (void) const
 Method to obtain the field of view angle value. More...
 
void fieldOfView (float fov_)
 Method to establish field of view angle. More...
 
float * projectionMatrix (void)
 Method to get the pointer to projection matrix of the camera vectorized in columns. More...
 
float * viewMatrix (void)
 Method to get the pointer to view matrix of the camera vectorized in columns. More...
 
float * projectionViewMatrix (void)
 Method to get the pointer to view-projection matrix of the camera vectorized in columns. More...
 

Static Public Attributes

static const std::string NO_ZEROEQ
 

Protected Member Functions

void _setFov (float fov_)
 
void _setRatio (float ratio_)
 
void _setNearPlane (float nearPlane_)
 
void _setFarPlane (float farPlane_)
 
void _buildProjectionMatrix (void)
 
void _setEnableZeqConnChanges (bool enableZeqConnChanges_)
 

Protected Attributes

float _fovTan
 Factor to calculate the camera projection matrix based on the camera far plane, near plane, field of view and ratio.
 
float _fov
 Camera fild of view.
 
float _ratio
 Camera ratio.
 
float _nearPlane
 Camera near plane.
 
float _farPlane
 Camera far plane.
 
Eigen::Matrix4f _projectionMatrix
 Projection matrix.
 
bool _isProjMatClean
 Bool to check the clean state of projection matrix.
 
Eigen::Matrix4f _viewMatrix
 View matrix.
 
Eigen::Matrix4f _projectionViewMatrix
 Projection view matrix.
 
bool _enableZeqConnChanges
 Bool to enable zeq changes in view matrix.
 

Friends

class AbstractCameraController
 

Detailed Description

Class to manage camera.

This class manage the camera: allows synchronize the camera with other applications using of ZeroEQ

Definition at line 64 of file Camera.h.

Constructor & Destructor Documentation

reto::Camera::Camera ( float  fov_ = 45.0f,
float  ratio_ = 16.0f/9,
float  nearPlane_ = 10.0f,
float  farPlane_ = 10000.0f 
)

use as session name to disable ZEROEQ

Camera constructor

Parameters
fovcamera field of view
ratiocamera ratio
nearPlanecamera near plane
farPlanecamera far plane
reto::Camera::Camera ( const std::string &  session_,
float  fov_ = 45.0f,
float  ratio_ = 16.0f/9,
float  nearPlane_ = 10.0f,
float  farPlane_ = 10000.0f 
)

Camera constructor.

Parameters
sessionZeroEq session to synchronize the camera with other applications
fovcamera field of view
ratiocamera ratio
nearPlanecamera near plane
farPlancamera far plane

Member Function Documentation

float reto::Camera::farPlane ( void  ) const

Method to obtain the far plane distance.

Returns
camera far plane distance.
void reto::Camera::farPlane ( float  farPlane_)

Method to establish the far plane distance.

Parameters
farPlane_new value to be assigned as far plane distance.
float reto::Camera::fieldOfView ( void  ) const

Method to obtain the field of view angle value.

Returns
field of view angle.
void reto::Camera::fieldOfView ( float  fov_)

Method to establish field of view angle.

Parameters
fov_new value to be assigned as field of view.
float reto::Camera::nearPlane ( void  ) const

Method to obtain the near plane distance.

Returns
camera near plane distance.
void reto::Camera::nearPlane ( float  nearPlane_)

Method to establish the near plane distance.

Parameters
nearPlane_new value to be assigned as near plane distance.
float* reto::Camera::projectionMatrix ( void  )

Method to get the pointer to projection matrix of the camera vectorized in columns.

Returns
pointer to float whit the column vectorized projection matrix of the camera
float* reto::Camera::projectionViewMatrix ( void  )

Method to get the pointer to view-projection matrix of the camera vectorized in columns.

Returns
pointer to float with the column vectorized view-projection matrix of the camera
void reto::Camera::setZeqSession ( const std::string &  session_ = std::string())

Method to start or change the camera zeqSession.

Parameters
sessionZeroEq session to synchronize the camera with other applications
float* reto::Camera::viewMatrix ( void  )

Method to get the pointer to view matrix of the camera vectorized in columns.

Returns
pointer to float with the column vectorized view matrix of the camera

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