SO3Engine
Classes | Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
SO3::StereoManager Class Reference

#include <SO3StereoManager.h>

Public Types

enum  StereoMode {
  SO3_NONE_STEREO = 0 , SO3_ANAGLYPH_RC_STEREO = 1 , SO3_ANAGLYPH_YB_STEREO = 2 , SO3_INTERLACED_V_STEREO = 3 ,
  SO3_INTERLACED_H_STEREO = 4 , SO3_INTERLACED_CB_STEREO = 5 , SO3_SIDE_BY_SIDE_STEREO = 6 , SO3_UP_DOWN_STEREO = 7 ,
  SO3_QUAD_BUFFER_STEREO = 8 , SO3_OCULUS_STEREO = 9 , SO3_OCULUS2_STEREO = 10 , SO3_CARDBOARD_STEREO = 11 ,
  SO3_OPENVR_STEREO = 12 , SO3_OCULUSM_STEREO = 13 , SO3_OPENXR_STEREO = 14 , SO3_MONO_STEREO = 15
}
 

Public Member Functions

 StereoManager (SWindow *buffer)
 
 ~StereoManager ()
 
void ReloadStereo ()
 
void RestoreStereoCamera (Ogre::Viewport *ogreViewportInstance)
 
void UpdateStereoCamera (Ogre::Viewport *ogreViewportInstance, Ogre::Camera *camera)
 
void UpdateStereoCameraMatrix (Ogre::Viewport *ogreViewportInstance, Ogre::Camera *camera)
 
bool UpdateStereoCompositorState (Ogre::Viewport *ogreViewportInstance, const Ogre::String compname, bool state)
 
void RegisterViewport (SViewPort *viewportInstance)
 
void UnregisterViewport (SViewPort *viewportInstance)
 
void SynchViewportSetup (SViewPort *viewportInstance, bool overlay=false, bool shadow=false)
 
bool IsViewportRegistered (Ogre::Viewport *ogreViewportInstance)
 
StereoMode GetStereoMode () const
 
void SetStereoMode (const StereoMode &newStereoMode)
 
Ogre::Real GetEyesSpacing () const
 
void SetEyesSpacing (Ogre::Real l)
 
void SetStereoProjectionOffset (Ogre::Real offset)
 
void SetStereoAspectRatio (Ogre::Real ratio)
 
Ogre::Real GetStereoAspectRatio ()
 
void SetStereoFOVy (Ogre::Real fov)
 
void SetRotateView (bool state)
 
bool GetRotateView ()
 
void SetStereoChromaticAbCorrection (bool enable, Ogre::Vector4 chromAbC)
 
void SetStereoDistortion (bool enable, Ogre::Vector4 dist)
 
void SetCustomProjectonMatrices (bool enable, const Ogre::Matrix4 &leftMatrix, const Ogre::Matrix4 &rightMatrix)
 
void GetCustomProjectonMatrices (bool &enabled, Ogre::Matrix4 &leftMatrix, Ogre::Matrix4 &rightMatrix) const
 
void SetTimeWarpMatrix (const Ogre::Matrix4 &leftStartMatrix, const Ogre::Matrix4 &leftEndMatrix, const Ogre::Matrix4 &rightStartMatrix, const Ogre::Matrix4 &rightEndMatrix)
 
void SetStereoMeshUVConfig (Ogre::Vector2 leftuvscale, Ogre::Vector2 leftuvoffset, Ogre::Vector2 rightuvscale, Ogre::Vector2 rightuvoffset)
 
void SetStereoMeshRttSize (SO3::SPoint< int > leftsize, SO3::SPoint< int > rightsize)
 
void SetStereoMeshLeft (std::vector< Ogre::Vector3 > vertices, std::vector< std::vector< Ogre::Vector2 > > uvs, std::vector< Ogre::Real > vignetteColor, std::vector< Ogre::Real > warp, std::vector< int > indexs)
 
void SetStereoMeshRight (std::vector< Ogre::Vector3 > vertices, std::vector< std::vector< Ogre::Vector2 > > uvs, std::vector< Ogre::Real > vignetteColor, std::vector< Ogre::Real > warp, std::vector< int > indexs)
 
void SetStereoWindow (SO3::SPoint< int > pos, SO3::SPoint< int > size, int index, bool state)
 
std::array< SCOL_PTR_TYPE, 2 > GetStereoTextures ()
 
std::array< SO3::SPoint< int >, 2 > GetStereoViewportSize ()
 

Protected Member Functions

void ReleaseRttTarget (StereoViewportData *viewportData)
 
void ConstructRttTarget (StereoViewportData *viewportData)
 

Friends

class DeviceLostListener
 
class StereoCameraListener
 
class StereoViewportListener
 
class StereoFrameListener
 

Detailed Description

Definition at line 50 of file SO3StereoManager.h.

Member Enumeration Documentation

◆ StereoMode

Enumerator
SO3_NONE_STEREO 
SO3_ANAGLYPH_RC_STEREO 

Anaglyph red/cyan.

SO3_ANAGLYPH_YB_STEREO 

Anaglyph yellow/blue.

SO3_INTERLACED_V_STEREO 

Verticaly interlaced mode.

SO3_INTERLACED_H_STEREO 

Horizontaly interlaced mode.

SO3_INTERLACED_CB_STEREO 

Interlaced mode with a checkerboard pattern.

SO3_SIDE_BY_SIDE_STEREO 

Side by side image.

SO3_UP_DOWN_STEREO 

Up/down image.

SO3_QUAD_BUFFER_STEREO 

OpenGL QuadBuffer.

SO3_OCULUS_STEREO 

Oculus rift.

SO3_OCULUS2_STEREO 

Oculus rift DK2.

SO3_CARDBOARD_STEREO 

Google card board.

SO3_OPENVR_STEREO 

OpenVR.

SO3_OCULUSM_STEREO 

OculusM.

SO3_OPENXR_STEREO 

OculusM.

SO3_MONO_STEREO 

Definition at line 53 of file SO3StereoManager.h.

Constructor & Destructor Documentation

◆ StereoManager()

SO3::StereoManager::StereoManager ( SWindow buffer)

Constructor

Definition at line 66 of file SO3StereoManager.cpp.

◆ ~StereoManager()

SO3::StereoManager::~StereoManager ( )

Destructor

Definition at line 117 of file SO3StereoManager.cpp.

Member Function Documentation

◆ ConstructRttTarget()

void SO3::StereoManager::ConstructRttTarget ( StereoViewportData *  viewportData)
protected

Definition at line 764 of file SO3StereoManager.cpp.

◆ GetCustomProjectonMatrices()

void SO3::StereoManager::GetCustomProjectonMatrices ( bool &  enabled,
Ogre::Matrix4 &  leftMatrix,
Ogre::Matrix4 &  rightMatrix 
) const

Definition at line 1226 of file SO3StereoManager.cpp.

◆ GetEyesSpacing()

Ogre::Real SO3::StereoManager::GetEyesSpacing ( ) const

Definition at line 1201 of file SO3StereoManager.cpp.

◆ GetRotateView()

bool SO3::StereoManager::GetRotateView ( )

Definition at line 1768 of file SO3StereoManager.cpp.

◆ GetStereoAspectRatio()

Ogre::Real SO3::StereoManager::GetStereoAspectRatio ( )

Definition at line 1738 of file SO3StereoManager.cpp.

◆ GetStereoMode()

StereoManager::StereoMode SO3::StereoManager::GetStereoMode ( ) const

Retrieve the actual stereo mode.

Definition at line 122 of file SO3StereoManager.cpp.

◆ GetStereoTextures()

std::array< SCOL_PTR_TYPE, 2 > SO3::StereoManager::GetStereoTextures ( )

Definition at line 1273 of file SO3StereoManager.cpp.

◆ GetStereoViewportSize()

std::array< SO3::SPoint< int >, 2 > SO3::StereoManager::GetStereoViewportSize ( )

Definition at line 1308 of file SO3StereoManager.cpp.

◆ IsViewportRegistered()

bool SO3::StereoManager::IsViewportRegistered ( Ogre::Viewport *  ogreViewportInstance)

Definition at line 445 of file SO3StereoManager.cpp.

◆ RegisterViewport()

void SO3::StereoManager::RegisterViewport ( SViewPort viewportInstance)

Add stereo support for the given viewport.

Definition at line 422 of file SO3StereoManager.cpp.

◆ ReleaseRttTarget()

void SO3::StereoManager::ReleaseRttTarget ( StereoViewportData *  viewportData)
protected

Definition at line 673 of file SO3StereoManager.cpp.

◆ ReloadStereo()

void SO3::StereoManager::ReloadStereo ( )

Definition at line 127 of file SO3StereoManager.cpp.

◆ RestoreStereoCamera()

void SO3::StereoManager::RestoreStereoCamera ( Ogre::Viewport *  ogreViewportInstance)

Restore the camera properties

Definition at line 270 of file SO3StereoManager.cpp.

◆ SetCustomProjectonMatrices()

void SO3::StereoManager::SetCustomProjectonMatrices ( bool  enable,
const Ogre::Matrix4 &  leftMatrix,
const Ogre::Matrix4 &  rightMatrix 
)

Use a custom projections matrix for each eye

Definition at line 1211 of file SO3StereoManager.cpp.

◆ SetEyesSpacing()

void SO3::StereoManager::SetEyesSpacing ( Ogre::Real  l)

Definition at line 1206 of file SO3StereoManager.cpp.

◆ SetRotateView()

void SO3::StereoManager::SetRotateView ( bool  state)

Definition at line 1756 of file SO3StereoManager.cpp.

◆ SetStereoAspectRatio()

void SO3::StereoManager::SetStereoAspectRatio ( Ogre::Real  ratio)

Definition at line 1725 of file SO3StereoManager.cpp.

◆ SetStereoChromaticAbCorrection()

void SO3::StereoManager::SetStereoChromaticAbCorrection ( bool  enable,
Ogre::Vector4  chromAbC 
)

Definition at line 1773 of file SO3StereoManager.cpp.

◆ SetStereoDistortion()

void SO3::StereoManager::SetStereoDistortion ( bool  enable,
Ogre::Vector4  dist 
)

Definition at line 1787 of file SO3StereoManager.cpp.

◆ SetStereoFOVy()

void SO3::StereoManager::SetStereoFOVy ( Ogre::Real  fov)

Definition at line 1743 of file SO3StereoManager.cpp.

◆ SetStereoMeshLeft()

void SO3::StereoManager::SetStereoMeshLeft ( std::vector< Ogre::Vector3 >  vertices,
std::vector< std::vector< Ogre::Vector2 > >  uvs,
std::vector< Ogre::Real >  vignetteColor,
std::vector< Ogre::Real >  warp,
std::vector< int >  indexs 
)

Definition at line 1376 of file SO3StereoManager.cpp.

◆ SetStereoMeshRight()

void SO3::StereoManager::SetStereoMeshRight ( std::vector< Ogre::Vector3 >  vertices,
std::vector< std::vector< Ogre::Vector2 > >  uvs,
std::vector< Ogre::Real >  vignetteColor,
std::vector< Ogre::Real >  warp,
std::vector< int >  indexs 
)

Definition at line 1544 of file SO3StereoManager.cpp.

◆ SetStereoMeshRttSize()

void SO3::StereoManager::SetStereoMeshRttSize ( SO3::SPoint< int >  leftsize,
SO3::SPoint< int >  rightsize 
)

Definition at line 1242 of file SO3StereoManager.cpp.

◆ SetStereoMeshUVConfig()

void SO3::StereoManager::SetStereoMeshUVConfig ( Ogre::Vector2  leftuvscale,
Ogre::Vector2  leftuvoffset,
Ogre::Vector2  rightuvscale,
Ogre::Vector2  rightuvoffset 
)

Definition at line 1233 of file SO3StereoManager.cpp.

◆ SetStereoMode()

void SO3::StereoManager::SetStereoMode ( const StereoMode newStereoMode)

Sets the stereo mode to use.

Definition at line 174 of file SO3StereoManager.cpp.

◆ SetStereoProjectionOffset()

void SO3::StereoManager::SetStereoProjectionOffset ( Ogre::Real  offset)

Definition at line 1712 of file SO3StereoManager.cpp.

◆ SetStereoWindow()

void SO3::StereoManager::SetStereoWindow ( SO3::SPoint< int >  pos,
SO3::SPoint< int >  size,
int  index,
bool  state 
)

Definition at line 1331 of file SO3StereoManager.cpp.

◆ SetTimeWarpMatrix()

void SO3::StereoManager::SetTimeWarpMatrix ( const Ogre::Matrix4 &  leftStartMatrix,
const Ogre::Matrix4 &  leftEndMatrix,
const Ogre::Matrix4 &  rightStartMatrix,
const Ogre::Matrix4 &  rightEndMatrix 
)

Definition at line 1218 of file SO3StereoManager.cpp.

◆ SynchViewportSetup()

void SO3::StereoManager::SynchViewportSetup ( SViewPort viewportInstance,
bool  overlay = false,
bool  shadow = false 
)

Definition at line 454 of file SO3StereoManager.cpp.

◆ UnregisterViewport()

void SO3::StereoManager::UnregisterViewport ( SViewPort viewportInstance)

Remove stereo support for the given viewport.

Definition at line 434 of file SO3StereoManager.cpp.

◆ UpdateStereoCamera()

void SO3::StereoManager::UpdateStereoCamera ( Ogre::Viewport *  ogreViewportInstance,
Ogre::Camera *  camera 
)

Update the camera properties

Definition at line 311 of file SO3StereoManager.cpp.

◆ UpdateStereoCameraMatrix()

void SO3::StereoManager::UpdateStereoCameraMatrix ( Ogre::Viewport *  ogreViewportInstance,
Ogre::Camera *  camera 
)

Update the camera properties

Definition at line 392 of file SO3StereoManager.cpp.

◆ UpdateStereoCompositorState()

bool SO3::StereoManager::UpdateStereoCompositorState ( Ogre::Viewport *  ogreViewportInstance,
const Ogre::String  compname,
bool  state 
)

Definition at line 229 of file SO3StereoManager.cpp.

Friends And Related Symbol Documentation

◆ DeviceLostListener

friend class DeviceLostListener
friend

Definition at line 287 of file SO3StereoManager.h.

◆ StereoCameraListener

friend class StereoCameraListener
friend

Definition at line 288 of file SO3StereoManager.h.

◆ StereoFrameListener

friend class StereoFrameListener
friend

Definition at line 290 of file SO3StereoManager.h.

◆ StereoViewportListener

friend class StereoViewportListener
friend

Definition at line 289 of file SO3StereoManager.h.


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