Visualization Library 2.0.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | List of all members
vl::StereoCamera Class Reference

Utility class to setup a pair of left/right cameras for stereo rendering. More...

#include <StereoCamera.hpp>

+ Inheritance diagram for vl::StereoCamera:

Public Member Functions

 StereoCamera ()
 
void setConvergence (float convergence)
 Distance of the convergence plane from the camera. More...
 
float convergence () const
 Distance of the convergence plane from the camera. More...
 
void setEyeSeparation (float eye_separation)
 The distance between the center of the two eyes. More...
 
float eyeSeparation () const
 The distance between the center of the two eyes. More...
 
void setMonoCamera (Camera *camera)
 The Camera used to drive the left and right cameras. More...
 
CameramonoCamera ()
 The Camera used to drive the left and right cameras. More...
 
const CameramonoCamera () const
 The Camera used to drive the left and right cameras. More...
 
void setLeftCamera (Camera *camera)
 The Camera representing the left eye. More...
 
CameraleftCamera ()
 The Camera representing the left eye. More...
 
const CameraleftCamera () const
 The Camera representing the left eye. More...
 
void setRightCamera (Camera *camera)
 The Camera representing the right eye. More...
 
CamerarigthCamera ()
 The Camera representing the right eye. More...
 
const CamerarightCamera () const
 The Camera representing the right eye. More...
 
void updateLeftRightCameras ()
 Updates the left and right cameras based on the mono camera view matrix and viewport. More...
 
- Public Member Functions inherited from vl::Object
 Object ()
 Constructor. More...
 
 Object (const Object &other)
 Copy constructor: copies the name, ref count mutex and user data. More...
 
Objectoperator= (const Object &other)
 Copy operator: copies the object's name, ref count mutex and user data. More...
 
const std::string & objectName () const
 The name of the object, by default set to the object's class name. More...
 
void setObjectName (const char *name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setObjectName (const std::string &name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setRefCountMutex (IMutex *mutex)
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
IMutexrefCountMutex ()
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
const IMutexrefCountMutex () const
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
int referenceCount () const
 Returns the number of references of an object. More...
 
void incReference () const
 Increments the reference count of an object. More...
 
void decReference ()
 Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More...
 
void setAutomaticDelete (bool autodel_on)
 If set to true the Object is deleted when its reference count reaches 0. More...
 
bool automaticDelete () const
 If set to true the Object is deleted when its reference count reaches 0. More...
 
template<class T >
T * as ()
 Casts an Object to the specified class. More...
 
template<class T >
const T * as () const
 Casts an Object to the specified class. More...
 

Additional Inherited Members

- Protected Member Functions inherited from vl::Object
virtual ~Object ()
 
- Protected Attributes inherited from vl::Object
std::string mObjectName
 
IMutexmRefCountMutex
 
int mReferenceCount
 
bool mAutomaticDelete
 

Detailed Description

Utility class to setup a pair of left/right cameras for stereo rendering.

Usage
See also
App_Stereo.cpp for a basic example of how to setup stereo rendering using anaglyphs.

Definition at line 47 of file StereoCamera.hpp.

Constructor & Destructor Documentation

◆ StereoCamera()

vl::StereoCamera::StereoCamera ( )
inline

Definition at line 52 of file StereoCamera.hpp.

Member Function Documentation

◆ convergence()

float vl::StereoCamera::convergence ( ) const
inline

Distance of the convergence plane from the camera.

The points laying on the convergence plane look the same from both the left and right camera.

Definition at line 63 of file StereoCamera.hpp.

Referenced by setConvergence().

◆ eyeSeparation()

float vl::StereoCamera::eyeSeparation ( ) const
inline

The distance between the center of the two eyes.

Definition at line 68 of file StereoCamera.hpp.

◆ leftCamera() [1/2]

Camera* vl::StereoCamera::leftCamera ( )
inline

The Camera representing the left eye.

Definition at line 83 of file StereoCamera.hpp.

◆ leftCamera() [2/2]

const Camera* vl::StereoCamera::leftCamera ( ) const
inline

The Camera representing the left eye.

Definition at line 85 of file StereoCamera.hpp.

◆ monoCamera() [1/2]

Camera* vl::StereoCamera::monoCamera ( )
inline

The Camera used to drive the left and right cameras.

The mono camera viewport will be automatically used by the left and right cameras as well.

Definition at line 75 of file StereoCamera.hpp.

◆ monoCamera() [2/2]

const Camera* vl::StereoCamera::monoCamera ( ) const
inline

The Camera used to drive the left and right cameras.

The mono camera viewport will be automatically used by the left and right cameras as well.

Definition at line 78 of file StereoCamera.hpp.

◆ rightCamera()

const Camera* vl::StereoCamera::rightCamera ( ) const
inline

The Camera representing the right eye.

Definition at line 92 of file StereoCamera.hpp.

◆ rigthCamera()

Camera* vl::StereoCamera::rigthCamera ( )
inline

The Camera representing the right eye.

Definition at line 90 of file StereoCamera.hpp.

◆ setConvergence()

void vl::StereoCamera::setConvergence ( float  convergence)
inline

Distance of the convergence plane from the camera.

The points laying on the convergence plane look the same from both the left and right camera.

Definition at line 60 of file StereoCamera.hpp.

References convergence().

◆ setEyeSeparation()

void vl::StereoCamera::setEyeSeparation ( float  eye_separation)
inline

The distance between the center of the two eyes.

Definition at line 66 of file StereoCamera.hpp.

◆ setLeftCamera()

void vl::StereoCamera::setLeftCamera ( Camera camera)
inline

The Camera representing the left eye.

Definition at line 81 of file StereoCamera.hpp.

◆ setMonoCamera()

void vl::StereoCamera::setMonoCamera ( Camera camera)
inline

The Camera used to drive the left and right cameras.

The mono camera viewport will be automatically used by the left and right cameras as well.

Definition at line 72 of file StereoCamera.hpp.

◆ setRightCamera()

void vl::StereoCamera::setRightCamera ( Camera camera)
inline

The Camera representing the right eye.

Definition at line 88 of file StereoCamera.hpp.

◆ updateLeftRightCameras()

void vl::StereoCamera::updateLeftRightCameras ( )
inline

Updates the left and right cameras based on the mono camera view matrix and viewport.

Definition at line 95 of file StereoCamera.hpp.

References vl::fDEG_TO_RAD, vl::Matrix4< float >::getTranslation(), vl::radians(), and vl::tan().


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