This website uses cookies to improve our services and deliver relevant ads.
By interacting with this site, you agree to this use. For more information, see our Cookies Policy
| #define | OVR_HMD_CONNECTED_EVENT_NAME This is the Windows Named Event name that is used to check for HMD connected state. |
| #define | ovr_CalcEyePoses |
| #define | ovr_GetEyePoses |
| enum | ovrProjectionModifier { ovrProjectionModifier.ovrProjection_None = 0x00, ovrProjectionModifier.ovrProjection_LeftHanded = 0x01, ovrProjectionModifier.ovrProjection_FarLessThanNear = 0x02, ovrProjectionModifier.ovrProjection_FarClipAtInfinity = 0x04, ovrProjectionModifier.ovrProjection_ClipRangeOpenGL = 0x08 } Enumerates modifications to the projection matrix based on the application's needs. |
| enum | ovrHapticsGenMode { } Modes used to generate Touch Haptics from audio PCM buffer. |
| ovrDetectResult | ovr_Detect ( int timeoutMilliseconds ) Detects Oculus Runtime and Device Status. |
| ovrMatrix4f | Used to generate projection from ovrEyeDesc::Fov. |
| ovrTimewarpProjectionDesc | ovrTimewarpProjectionDesc_FromProjection ( ovrMatrix4f projection, unsigned int projectionModFlags ) Extracts the required data from the result of ovrMatrix4f_Projection. |
| ovrMatrix4f | ovrMatrix4f_OrthoSubProjection ( ovrMatrix4f projection, ovrVector2f orthoScale, float orthoDistance, float HmdToEyeOffsetX ) Generates an orthographic sub-projection. |
| void | Computes offset eye poses based on headPose returned by ovrTrackingState. |
| void | |
| void | ovr_GetEyePoses ( ovrSession session, long long frameIndex, ovrBool latencyMarker, const ovrVector3f hmdToEyeOffset, ovrPosef outEyePoses, double * outSensorSampleTime ) Returns the predicted head pose in outHmdTrackingState and offset eye poses in outEyePoses. |
| void | ovr_GetEyePoses2 ( ovrSession session, long long frameIndex, ovrBool latencyMarker, const ovrPosef HmdToEyePose, ovrPosef outEyePoses, double * outSensorSampleTime ) |
| void | Tracking poses provided by the SDK come in a right-handed coordinate system. |
| ovrResult | ovr_ReadWavFromBuffer ( ovrAudioChannelData * outAudioChannel, const void * inputData, int dataSizeInBytes, int stereoChannelToUse ) Reads an audio channel from Wav (Waveform Audio File) data. |
| ovrResult | ovr_GenHapticsFromAudioData ( ovrHapticsClip * outHapticsClip, const ovrAudioChannelData * audioChannel, ovrHapticsGenMode genMode ) Generates playable Touch Haptics data from an audio channel. |
| void | ovr_ReleaseAudioChannelData ( ovrAudioChannelData * audioChannel ) Releases memory allocated for ovrAudioChannelData. |
| void | ovr_ReleaseHapticsClip ( ovrHapticsClip * hapticsClip ) Releases memory allocated for ovrHapticsClip. |
| ovrProjection_None | Use for generating a default projection matrix that is: |
| ovrProjection_LeftHanded | Enable if using left-handed transformations in your application. |
| ovrProjection_FarLessThanNear | After the projection transform is applied, far values stored in the depth buffer will be less than closer depth values. |
| ovrProjection_FarClipAtInfinity | When this flag is used, the zfar value pushed into ovrMatrix4f_Projection() will be ignored NOTE: Enable only if ovrProjection_FarLessThanNear is also enabled where the far clipping plane will be pushed to infinity. |
| ovrProjection_ClipRangeOpenGL | Enable if the application is rendering with OpenGL and expects a projection matrix with a clipping range of (-w to w). |
/********************************************************************************/
#ifndef OVR_CAPI_Util_h
#define OVR_CAPI_Util_h
#include "OVR_CAPI.h"
#ifdef __cplusplus
extern"C" {
#endif
typedefenum ovrProjectionModifier_ {
ovrProjection_None = 0x00,
ovrProjection_LeftHanded = 0x01,
ovrProjection_FarLessThanNear = 0x02,
ovrProjection_FarClipAtInfinity = 0x04,
ovrProjection_ClipRangeOpenGL = 0x08,
} ovrProjectionModifier;
typedefstruct OVR_ALIGNAS(8) ovrDetectResult_ {
ovrBool IsOculusServiceRunning;
ovrBool IsOculusHMDConnected;
OVR_UNUSED_STRUCT_PAD(pad0, 6)
} ovrDetectResult;
OVR_STATIC_ASSERT(sizeof(ovrDetectResult) == 8, "ovrDetectResult size mismatch");
typedefenum ovrHapticsGenMode_ {
ovrHapticsGenMode_PointSample,
ovrHapticsGenMode_Count
} ovrHapticsGenMode;
typedefstruct ovrAudioChannelData_ {
constfloat* Samples;
int SamplesCount;
int Frequency;
} ovrAudioChannelData;
typedefstruct ovrHapticsClip_ {
constvoid* Samples;
int SamplesCount;
} ovrHapticsClip;
OVR_PUBLIC_FUNCTION(ovrDetectResult) ovr_Detect(int timeoutMilliseconds);
// On the Windows platform,
#ifdef _WIN32
#define OVR_HMD_CONNECTED_EVENT_NAME L"OculusHMDConnected"
#endif // _WIN32
OVR_PUBLIC_FUNCTION(ovrMatrix4f)
ovrMatrix4f_Projection(ovrFovPort fov, float znear, float zfar, unsignedint projectionModFlags);
OVR_PUBLIC_FUNCTION(ovrTimewarpProjectionDesc)
ovrTimewarpProjectionDesc_FromProjection(ovrMatrix4f projection, unsignedint projectionModFlags);
OVR_PUBLIC_FUNCTION(ovrMatrix4f)
ovrMatrix4f_OrthoSubProjection(
ovrMatrix4f projection,
ovrVector2f orthoScale,
float orthoDistance,
float HmdToEyeOffsetX);
#undef ovr_CalcEyePoses
OVR_PUBLIC_FUNCTION(void)
ovr_CalcEyePoses(ovrPosef headPose, const ovrVector3f hmdToEyeOffset[2], ovrPosef outEyePoses[2]);
OVR_PRIVATE_FUNCTION(void)
ovr_CalcEyePoses2(ovrPosef headPose, const ovrPosef HmdToEyePose[2], ovrPosef outEyePoses[2]);
#define ovr_CalcEyePoses ovr_CalcEyePoses2
#undef ovr_GetEyePoses
OVR_PUBLIC_FUNCTION(void)
ovr_GetEyePoses(
ovrSession session,
longlong frameIndex,
ovrBool latencyMarker,
const ovrVector3f hmdToEyeOffset[2],
ovrPosef outEyePoses[2],
double* outSensorSampleTime);
OVR_PRIVATE_FUNCTION(void)
ovr_GetEyePoses2(
ovrSession session,
longlong frameIndex,
ovrBool latencyMarker,
const ovrPosef HmdToEyePose[2],
ovrPosef outEyePoses[2],
double* outSensorSampleTime);
#define ovr_GetEyePoses ovr_GetEyePoses2
OVR_PUBLIC_FUNCTION(void) ovrPosef_FlipHandedness(const ovrPosef* inPose, ovrPosef* outPose);
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_ReadWavFromBuffer(
ovrAudioChannelData* outAudioChannel,
constvoid* inputData,
int dataSizeInBytes,
int stereoChannelToUse);
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GenHapticsFromAudioData(
ovrHapticsClip* outHapticsClip,
const ovrAudioChannelData* audioChannel,
ovrHapticsGenMode genMode);
OVR_PUBLIC_FUNCTION(void) ovr_ReleaseAudioChannelData(ovrAudioChannelData* audioChannel);
OVR_PUBLIC_FUNCTION(void) ovr_ReleaseHapticsClip(ovrHapticsClip* hapticsClip);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif // Header include guard