SLProject 4.0.000
|
Wrapper around Oculus Rift Devkit 2. More...
#include <SLGLOculus.h>
Public Member Functions | |
SLGLOculus (SLstring shaderDir) | |
~SLGLOculus () | |
void | init () |
const SLQuat4f & | orientation (SLEyeType eye) |
const SLVec3f & | position (SLEyeType eye) |
const SLVec3f & | viewAdjust (SLEyeType eye) |
const SLMat4f & | projection (SLEyeType eye) |
const SLMat4f & | orthoProjection (SLEyeType eye) |
SLfloat | resolutionScale () |
void | renderResolution (SLint width, SLint height) |
void | beginFrame () |
void | renderDistortion (SLint width, SLint height, SLuint tex, const SLCol4f &background) |
void | lowPersistance (SLbool val) |
void | timeWarp (SLbool val) |
void | positionTracking (SLbool val) |
void | displaySleep (SLbool val) |
SLbool | isConnected () |
SLbool | isCameraConnected () |
SLbool | isPositionTracked () |
SLbool | isPositionTrackingEnabled () |
SLbool | isLowPersistanceEnabled () |
SLbool | isTimeWarpEnabled () |
Private Member Functions | |
void | dispose () |
void | calculateHmdValues () |
recalculate HMD settings changed More... | |
Private Attributes | |
SLVec2i | _outputRes |
output resolution used for ortho projection More... | |
SLQuat4f | _orientation [2] |
eye orientation More... | |
SLVec3f | _position [2] |
eye position More... | |
SLMat4f | _projection [2] |
projection matrices for left and right eye More... | |
SLMat4f | _orthoProjection [2] |
projection for 2d elements More... | |
SLVec3f | _viewAdjust [2] |
view adjust vector More... | |
SLGLVertexArray | _distortionMeshVAO [2] |
distortion meshes for left and right eye More... | |
SLfloat | _resolutionScale |
required resolution scale for a 1.0 min pixel density More... | |
SLbool | _usingDebugHmd |
we're using a debug HMD More... | |
SLbool | _positionTrackingEnabled |
is position tracking enabled More... | |
SLbool | _lowPersistanceEnabled |
low persistence rendering enabled More... | |
SLbool | _timeWarpEnabled |
time warp correction enabled More... | |
SLbool | _displaySleep |
is the display of the rift currently off More... | |
SLbool | _isConnected |
is HMD connected More... | |
SLbool | _isCameraConnected |
is position tracker camera connected More... | |
SLbool | _isPositionTracked |
is the position tracked (false if out of range) More... | |
SLVec2i | _resolution |
Resolution of the HMD. More... | |
SLVec2i | _rtSize |
Required resolution for the render target. More... | |
SLbool | _hmdSettingsChanged |
settings need to be updated flag More... | |
SLGLProgram * | _stereoOculusDistProgram = nullptr |
SLstring | _shaderFileDir |
Wrapper around Oculus Rift Devkit 2.
This class is depricated since the lib_ovr from Oculus completely changed The lib_ovr that connects the Oculus hardware was removed since it only worked for devkit2 under windows.
SLGLOculus::SLGLOculus | ( | SLstring | shaderDir | ) |
Constructor initializing with default values
SLGLOculus::~SLGLOculus | ( | ) |
Destructor calling dispose
void SLGLOculus::beginFrame | ( | ) |
Updates rift status and collects data for timewarp
|
private |
recalculate HMD settings changed
Recalculates values such as projection or render target size This function gets called whenever some settings changed.
void SLGLOculus::displaySleep | ( | SLbool | val | ) |
enable or disable position tracking
|
private |
Deletes the buffer object
void SLGLOculus::init | ( | ) |
Initialization of the Oculus Rift SDK and the device recognition.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void SLGLOculus::lowPersistance | ( | SLbool | val | ) |
enable or disable low persistance
Returns the Oculus orientation as quaternion. If no Oculus Rift is recognized it returns a unit quaternion.
Returns an orthogonal projection matrix for the specified eye
void SLGLOculus::positionTracking | ( | SLbool | val | ) |
enable or disable position tracking
Returns an perspective projection matrix for the specified eye
void SLGLOculus::renderDistortion | ( | SLint | width, |
SLint | height, | ||
SLuint | tex, | ||
const SLCol4f & | background | ||
) |
Renders the distortion mesh with time warp and chromatic abberation
Specify the final output resolution for this rift
|
inline |
void SLGLOculus::timeWarp | ( | SLbool | val | ) |
enable or disable timewarp
Returns the view adjust vector as reported by the HMD for the specified eye
|
private |
is the display of the rift currently off
|
private |
distortion meshes for left and right eye
|
private |
settings need to be updated flag
|
private |
is position tracker camera connected
|
private |
is HMD connected
|
private |
is the position tracked (false if out of range)
|
private |
low persistence rendering enabled
|
private |
eye orientation
|
private |
projection for 2d elements
|
private |
output resolution used for ortho projection
|
private |
eye position
|
private |
is position tracking enabled
|
private |
projection matrices for left and right eye
|
private |
Resolution of the HMD.
|
private |
required resolution scale for a 1.0 min pixel density
|
private |
Required resolution for the render target.
|
private |
|
private |
|
private |
time warp correction enabled
|
private |
we're using a debug HMD
|
private |
view adjust vector