gramods
Public Member Functions | Public Attributes | List of all members
gramods::gmGraphics::Camera Class Reference

The base of graphics Camera implementations. More...

#include <Camera.hh>

Collaboration diagram for gramods::gmGraphics::Camera:
Collaboration graph
[legend]

Public Member Functions

 Camera (size_t frame_number)
 Creates a camera for rendering the specified frame number. More...
 
 Camera (const Camera &other)
 
Cameraoperator= (const Camera &other)
 
template<class T >
 Camera (const T &object)
 Creates a camera copying frame number from another object. More...
 
Eigen::Matrix4f getProjectionMatrix () const
 Computes and returns a projection matrix for the current camera and near and far distances. More...
 
Eigen::Affine3f getViewMatrix () const
 Computes and returns a view matrix for the current camera. More...
 
Eigen::Vector3f getPosition () const
 Get the position of the camera. More...
 
void setPosition (Eigen::Vector3f p)
 Set the position of the camera. More...
 
Eigen::Quaternionf getOrientation () const
 Get the orientation of the camera. More...
 
void setOrientation (Eigen::Quaternionf q)
 Set the orientation of the camera. More...
 
void setClipPlanes (float l, float r, float b, float t)
 Explicitly sets the frustum clip planes at a distance of 1. More...
 
void getClipPlanes (float &l, float &r, float &b, float &t) const
 Gets the frustum clip planes at a distance of 1. More...
 
void setFieldOfView (float fov_h, float fov_v)
 Sets the frustum planes of a symmetric frustum for the camera based on horizontal and vertical field-of-view, expressed in radians. More...
 
void setClipAngles (float l, float r, float b, float t)
 Sets the frustum planes of an asymmetric frustum for the camera based on left, right, bottom and top field-of-view, expressed in radians. More...
 
void setPose (Eigen::Vector3f p, Eigen::Quaternionf r)
 Sets the pose of the camera. More...
 
bool setLookAtPoints (Eigen::Vector3f p, const std::vector< Eigen::Vector3f > &pts, bool symmetric=true, Eigen::Vector3f up=Eigen::Vector3f::Zero())
 Set the position, orientation and frustum of this camera based on a eye position and a set of points that should be made visible from this point. More...
 
void setNearFar (float near, float far)
 Sets the near and far planes. More...
 
void setEye (Eye e)
 Sets which eye the camera is supposed to render. More...
 
Eye getEye () const
 Sets which eye the camera is supposed to render. More...
 

Public Attributes

const size_t frame_number
 The frame currently being rendered. More...
 

Detailed Description

The base of graphics Camera implementations.

Constructor & Destructor Documentation

◆ Camera() [1/2]

gramods::gmGraphics::Camera::Camera ( size_t  frame_number)
inline

Creates a camera for rendering the specified frame number.

◆ Camera() [2/2]

template<class T >
gramods::gmGraphics::Camera::Camera ( const T &  object)
inline

Creates a camera copying frame number from another object.

Member Function Documentation

◆ getClipPlanes()

void gramods::gmGraphics::Camera::getClipPlanes ( float &  l,
float &  r,
float &  b,
float &  t 
) const
inline

Gets the frustum clip planes at a distance of 1.

◆ getEye()

Eye gramods::gmGraphics::Camera::getEye ( ) const
inline

Sets which eye the camera is supposed to render.

Use this for example to select between left or right eye textures.

◆ getOrientation()

Eigen::Quaternionf gramods::gmGraphics::Camera::getOrientation ( ) const
inline

Get the orientation of the camera.

◆ getPosition()

Eigen::Vector3f gramods::gmGraphics::Camera::getPosition ( ) const
inline

Get the position of the camera.

◆ getProjectionMatrix()

Eigen::Matrix4f gramods::gmGraphics::Camera::getProjectionMatrix ( ) const

Computes and returns a projection matrix for the current camera and near and far distances.

◆ getViewMatrix()

Eigen::Affine3f gramods::gmGraphics::Camera::getViewMatrix ( ) const

Computes and returns a view matrix for the current camera.

◆ setClipAngles()

void gramods::gmGraphics::Camera::setClipAngles ( float  l,
float  r,
float  b,
float  t 
)

Sets the frustum planes of an asymmetric frustum for the camera based on left, right, bottom and top field-of-view, expressed in radians.

The left field-of-view increase left-wise while the right field-of-view increase right-wise.

◆ setClipPlanes()

void gramods::gmGraphics::Camera::setClipPlanes ( float  l,
float  r,
float  b,
float  t 
)
inline

Explicitly sets the frustum clip planes at a distance of 1.

Near and far planes are defined by the renderer that requests a projection matrix for the camera.

◆ setEye()

void gramods::gmGraphics::Camera::setEye ( Eye  e)
inline

Sets which eye the camera is supposed to render.

◆ setFieldOfView()

void gramods::gmGraphics::Camera::setFieldOfView ( float  fov_h,
float  fov_v 
)

Sets the frustum planes of a symmetric frustum for the camera based on horizontal and vertical field-of-view, expressed in radians.

◆ setLookAtPoints()

bool gramods::gmGraphics::Camera::setLookAtPoints ( Eigen::Vector3f  p,
const std::vector< Eigen::Vector3f > &  pts,
bool  symmetric = true,
Eigen::Vector3f  up = Eigen::Vector3f::Zero() 
)

Set the position, orientation and frustum of this camera based on a eye position and a set of points that should be made visible from this point.

◆ setNearFar()

void gramods::gmGraphics::Camera::setNearFar ( float  near,
float  far 
)
inline

Sets the near and far planes.

◆ setOrientation()

void gramods::gmGraphics::Camera::setOrientation ( Eigen::Quaternionf  q)
inline

Set the orientation of the camera.

◆ setPose()

void gramods::gmGraphics::Camera::setPose ( Eigen::Vector3f  p,
Eigen::Quaternionf  r 
)
inline

Sets the pose of the camera.

◆ setPosition()

void gramods::gmGraphics::Camera::setPosition ( Eigen::Vector3f  p)
inline

Set the position of the camera.

Member Data Documentation

◆ frame_number

const size_t gramods::gmGraphics::Camera::frame_number

The frame currently being rendered.


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