OVRWindow
All Classes Functions Enumerations
Classes | Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
OVRWindow Class Reference
Inheritance diagram for OVRWindow:
Inheritance graph
[legend]
Collaboration diagram for OVRWindow:
Collaboration graph
[legend]

Classes

struct  FrameRenderContext
 A frame's render context. More...
 

Public Types

enum  Feature : unsigned int {
  LowPersistence = ovrHmdCap_LowPersistence, LatencyTesting = ovrHmdCap_LatencyTest, DynamicPrediction = ovrHmdCap_DynamicPrediction, OrientationTracking = ovrSensorCap_Orientation,
  YawCorrection = ovrSensorCap_YawCorrection, PositionalTracking = ovrSensorCap_Position, ChromaticAberrationCorrection = ovrDistortionCap_Chromatic, Timewarp = ovrDistortionCap_TimeWarp,
  Vignette = ovrDistortionCap_Vignette
}
 
enum  Vision { Monocular, Binocular }
 
enum  LOD {
  Lowest, Low, Medium, High,
  Highest
}
 

Public Slots

void toggleVision ()
 Toggle vision modes.
 
void reduceLOD ()
 Reduce the interface's level of detail.
 
void increaseLOD ()
 Increase the interface's level of detail.
 
void toggleDynamicLOD ()
 Toggle dynamic LOD.
 
void toggleMultisampling ()
 Toggle multisampling.
 

Signals

void initialized ()
 
void LODChanged (const OVRWindow::LOD &currentLOD)
 

Public Member Functions

 OVRWindow (const unsigned int &index, const std::initializer_list< OVRWindow::Feature > &features)
 Instantiate an OVRWindow object that is attached to an Oculus Rift device. More...
 
 OVRWindow ()
 Instantiate an OVRWindow object that is attached to an Oculus Rift device. More...
 
virtual ~OVRWindow ()
 The destructor.
 
bool hasValidGL () const
 Returns true if the OVRWindow has a valid OpenGL context, false otherwise.
 
QOpenGLContext & getGL ()
 Return the OVRWindow's OpenGL context.
 
const ovrHmdDesc & getDeviceInfo () const
 Return the Oculus Rift's information.
 
const QSet< OVRWindow::Feature > & getEnabledFeatures () const
 Return a set of all enabled features.
 
void enableFeature (const OVRWindow::Feature &feature, const bool enable=true)
 
void enableFeatures (const std::initializer_list< OVRWindow::Feature > &features, const bool enable=true)
 
bool isFeatureEnabled (const OVRWindow::Feature &feature) const
 
bool isFeatureSupported (const OVRWindow::Feature &feature) const
 
const OVRWindow::VisiongetVision () const
 
void setVision (const OVRWindow::Vision &vision)
 
const OVRWindow::LODgetLOD () const
 
void setLOD (const OVRWindow::LOD &lod)
 
void enableDynamicLOD (const bool enable=true)
 
float getIPD () const
 
void setIPD (const float &ipd)
 
void forceZeroIPD (const bool &force)
 
const float & getPixelDensity () const
 
void setPixelDensity (const float &density)
 
const float & getNearClippingDistance () const
 
void setNearClippingDistance (const float &near)
 
const float & getFarClippingDistance () const
 
void setFarClippingDistance (const float &far)
 
bool isMultisamplingEnabled () const
 
void enableMultisampling (const bool enable=true)
 

Protected Member Functions

virtual void initializeGL ()
 Initialize OpenGL.
 
virtual void paintGL (const OVRWindow::FrameRenderContext &context, const float &dt)
 This virtual function is called whenever a new frame needs to be rendered.
 
virtual void resizeGL (const unsigned int &width, const unsigned int &height)
 This virtual function is called whenever the window is resized. More...
 
void makeCurrent ()
 
void doneCurrent ()
 
virtual void changeLOD (const OVRWindow::LOD &lod)
 This virtual function is called whenever the level of detail (LOD) is changed. More...
 

Member Enumeration Documentation

enum OVRWindow::Feature : unsigned int
strong

TODO Explain me better.

An enumeration of features that can be toggled. Be careful when disabling certain features as it may induce simulator sickness.

  • LowPersistence eliminates motion blur and judder. Note that disabling this feature may induce simulator sickness.
  • LatencyTesting ???
  • DynamicPrediction ???
  • OrientationTracking tracks head orientation.
  • YawCorrection ???
  • PositionalTracking tracks the head's position.
  • ChromaticAberrationCorrection corrects chromatic aberration, a distortion caused by the Rift's lenses.
  • Timewarp reduces motion-to-photon latency. Note that disabling this feature may induce simulator sickness.
  • Vignette ???
enum OVRWindow::LOD
strong

TODO Explain me.

enum OVRWindow::Vision
strong

TODO Explain me.

Constructor & Destructor Documentation

OVRWindow::OVRWindow ( const unsigned int &  index,
const std::initializer_list< OVRWindow::Feature > &  features 
)

Instantiate an OVRWindow object that is attached to an Oculus Rift device.

The instantiated object is attached to a device with the specified index, and has has a set of enabled features. If no hardware device is detected, a debug device that emulates some of the DK1's features is used.

Parameters
indexa positive integer used to access an Oculus Rift device.
featuresa set of device features to enable.
OVRWindow::OVRWindow ( )

Instantiate an OVRWindow object that is attached to an Oculus Rift device.

The instantiated object is attached to a device with the index '0', and has all device features enabled. If no hardware device is detected, a debug device that emulates some of the DK1's features is used.

Member Function Documentation

void OVRWindow::changeLOD ( const OVRWindow::LOD lod)
protectedvirtual

This virtual function is called whenever the level of detail (LOD) is changed.

Parameters
lodthe new level of detail.
void OVRWindow::doneCurrent ( )
protected

Makes no GL context the current context. This may be useful in multi-threaded environments.

void OVRWindow::enableDynamicLOD ( const bool  enable = true)

Enable or disable dynamic level of detail (LOD). Dynamic LOD adjusts the level of detail to make sure the frame rate either matches, or is better than the device's refresh rate.

Parameters
enabletrue to enable dynamic LOD, false to disable.
void OVRWindow::enableFeature ( const OVRWindow::Feature feature,
const bool  enable = true 
)

Enable or disable a feature.

Parameters
featurethe feature to enable or disable.
enabletrue to enable the feature, false to disable it.
void OVRWindow::enableFeatures ( const std::initializer_list< OVRWindow::Feature > &  features,
const bool  enable = true 
)

Enable or disable a set of features.

Parameters
featuresthe features to enable or disable.
enabletrue to enable the features, false to disable them.
void OVRWindow::enableMultisampling ( const bool  enable = true)

Enable or disable multisampling.

Parameters
enabletrue to enable multisampling, false to disable.
void OVRWindow::forceZeroIPD ( const bool &  force)

TODO Explain me.

const float & OVRWindow::getFarClippingDistance ( ) const

Return the viewing frustum's far clipping plane distance.

float OVRWindow::getIPD ( ) const

Return the current interpupillary distance (IPD) in millimeters.

const OVRWindow::LOD & OVRWindow::getLOD ( ) const

Return the current level of detail.

const float & OVRWindow::getNearClippingDistance ( ) const

Return the viewing frustum's near clipping plane distance.

const float & OVRWindow::getPixelDensity ( ) const

TODO Explain me.

const OVRWindow::Vision & OVRWindow::getVision ( ) const

Return the current vision mode.

void OVRWindow::initialized ( )
signal

This signal is emitted when the interface has been correctly initialized and is ready for use.

bool OVRWindow::isFeatureEnabled ( const OVRWindow::Feature feature) const

Returns true if the specified feature is enabled, false otherwise.

Parameters
featurethe feature to query.
bool OVRWindow::isFeatureSupported ( const OVRWindow::Feature feature) const

Returns true if the specified feature is supported by the device, false otherwise.

Parameters
featurethe feature to query.
bool OVRWindow::isMultisamplingEnabled ( ) const

Returns true if multisampling is enabled, false otherwise.

void OVRWindow::LODChanged ( const OVRWindow::LOD currentLOD)
signal

This signal is emitted when the interface's level of detail (LOD) has been changed.

Parameters
currentLODthe interface's current level of detail.
void OVRWindow::makeCurrent ( )
protected

Make the window's rendering context the current OpenGL context.

void OVRWindow::resizeGL ( const unsigned int &  width,
const unsigned int &  height 
)
protectedvirtual

This virtual function is called whenever the window is resized.

Parameters
widththe window's new width.
heightthe window's new height.
void OVRWindow::setFarClippingDistance ( const float &  far)

Set the viewing frustum's far clipping plane distance.

Parameters
farthe far clipping plane's distance.
void OVRWindow::setIPD ( const float &  ipd)

Set the interpupillary distance (IPD) in millimeters.

Parameters
ipdthe distance to set.
void OVRWindow::setLOD ( const OVRWindow::LOD lod)

Set the current level of detail (LOD). The LOD determines which features are enabled or disabled with the goal of reducing frame render time, thereby increasing performance. Note that unless dynamic LOD is disabled, the LOD set by this member function will change.

Parameters
lodthe level of detail to set.
void OVRWindow::setNearClippingDistance ( const float &  near)

Set the viewing frustum's near clipping plane distance.

Parameters
nearthe near clipping plane's distance.
void OVRWindow::setPixelDensity ( const float &  density)

TODO Explain me.

void OVRWindow::setVision ( const OVRWindow::Vision vision)

Set the vision.

Parameters
visionthe vision to set.