SLProject
4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
|
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.
Definition at line 36 of file SLGLOculus.h.
SLGLOculus::SLGLOculus | ( | SLstring | shaderDir | ) |
Constructor initializing with default values
Definition at line 19 of file SLGLOculus.cpp.
SLGLOculus::~SLGLOculus | ( | ) |
Destructor calling dispose
Definition at line 34 of file SLGLOculus.cpp.
void SLGLOculus::beginFrame | ( | ) |
Updates rift status and collects data for timewarp
Definition at line 195 of file SLGLOculus.cpp.
|
private |
recalculate HMD settings changed
Recalculates values such as projection or render target size This function gets called whenever some settings changed.
Definition at line 151 of file SLGLOculus.cpp.
|
private |
void SLGLOculus::init | ( | ) |
Initialization of the Oculus Rift SDK and the device recognition.
Definition at line 53 of file SLGLOculus.cpp.
|
inline |
Definition at line 66 of file SLGLOculus.h.
|
inline |
Definition at line 65 of file SLGLOculus.h.
|
inline |
Definition at line 70 of file SLGLOculus.h.
|
inline |
Definition at line 67 of file SLGLOculus.h.
|
inline |
Definition at line 69 of file SLGLOculus.h.
|
inline |
Definition at line 71 of file SLGLOculus.h.
Returns the Oculus orientation as quaternion. If no Oculus Rift is recognized it returns a unit quaternion.
Definition at line 205 of file SLGLOculus.cpp.
Returns an orthogonal projection matrix for the specified eye
Definition at line 140 of file SLGLOculus.cpp.
Returns the Oculus position.
Definition at line 215 of file SLGLOculus.cpp.
Returns an perspective projection matrix for the specified eye
Definition at line 129 of file SLGLOculus.cpp.
void SLGLOculus::renderDistortion | ( | SLint | width, |
SLint | height, | ||
SLuint | tex, | ||
const SLCol4f & | background | ||
) |
Renders the distortion mesh with time warp and chromatic abberation
Definition at line 79 of file SLGLOculus.cpp.
|
inline |
Definition at line 51 of file SLGLOculus.h.
Returns the view adjust vector as reported by the HMD for the specified eye
Definition at line 118 of file SLGLOculus.cpp.
|
private |
is the display of the rift currently off
Definition at line 94 of file SLGLOculus.h.
|
private |
distortion meshes for left and right eye
Definition at line 85 of file SLGLOculus.h.
|
private |
settings need to be updated flag
Definition at line 103 of file SLGLOculus.h.
|
private |
is position tracker camera connected
Definition at line 97 of file SLGLOculus.h.
|
private |
is HMD connected
Definition at line 96 of file SLGLOculus.h.
|
private |
is the position tracked (false if out of range)
Definition at line 98 of file SLGLOculus.h.
|
private |
low persistence rendering enabled
Definition at line 92 of file SLGLOculus.h.
|
private |
eye orientation
Definition at line 80 of file SLGLOculus.h.
|
private |
projection for 2d elements
Definition at line 83 of file SLGLOculus.h.
|
private |
output resolution used for ortho projection
Definition at line 78 of file SLGLOculus.h.
|
private |
eye position
Definition at line 81 of file SLGLOculus.h.
|
private |
is position tracking enabled
Definition at line 91 of file SLGLOculus.h.
|
private |
projection matrices for left and right eye
Definition at line 82 of file SLGLOculus.h.
|
private |
Resolution of the HMD.
Definition at line 100 of file SLGLOculus.h.
|
private |
required resolution scale for a 1.0 min pixel density
Definition at line 87 of file SLGLOculus.h.
|
private |
Required resolution for the render target.
Definition at line 101 of file SLGLOculus.h.
|
private |
Definition at line 107 of file SLGLOculus.h.
|
private |
Definition at line 105 of file SLGLOculus.h.
|
private |
time warp correction enabled
Definition at line 93 of file SLGLOculus.h.
|
private |
we're using a debug HMD
Definition at line 90 of file SLGLOculus.h.
|
private |
view adjust vector
Definition at line 84 of file SLGLOculus.h.