|
Qualcomm© Snapdragon™ VR SDK
3.0.2
|
#include <stdlib.h>#include <jni.h>Go to the source code of this file.
Classes | |
| struct | sxrVector2 |
| Simple structure to hold 2-component vector data. More... | |
| struct | sxrVector3 |
| Simple structure to hold 3-component vector data. More... | |
| struct | sxrVector4 |
| Simple structure to hold 4-component vector data. More... | |
| struct | sxrQuaternion |
| Simple structure to hold quaternion data. More... | |
| struct | sxrMatrix4 |
| Simple structure to hold 4x4 matrix data. More... | |
| struct | sxrHeadPose |
| Structure containing the position and orientation of the head. More... | |
| struct | sxrHeadPoseState |
| Structure containing the full set of pose data. More... | |
| struct | sxrEyePoseState |
| Structure containing the eye tracking data. More... | |
| struct | sxrBeginParams |
| Structure containing parameters needed to enable VR mode. More... | |
| struct | sxrVulkanTexInfo |
| Information about texture if type is kTypeVulkan. More... | |
| struct | sxrLayoutCoords |
| Render layer screen position and UV coordinates. More... | |
| struct | sxrRenderLayer |
| Description of render layers. More... | |
| struct | sxrFrameParams |
| Per-frame data needed for time warp, distortion/aberration correction. More... | |
| struct | sxrInitParams |
| Initialization parameters that are constant over the life-cycle of the application. More... | |
| struct | sxrViewFrustum |
| View Frustum. These values are based on physical device properties, except the far plane is arbitrary. More... | |
| struct | sxrFoveation |
| struct | sxrDeviceInfo |
| Basic device information to allow the client code to optimally setup their simulation and rendering pipelines. More... | |
| struct | sxrEventData_Thermal |
| union | sxrEventData |
| struct | sxrEvent |
| struct | sxrControllerState |
| struct | sxrControllerCaps |
Namespaces | |
| sxrControllerTouch | |
| Controller Touch button enumerations. | |
| sxrControllerAxis1D | |
| Controller Trigger enumerations. | |
| sxrControllerAxis2D | |
| Controller Joystick enumerations. | |
| sxrControllerButton | |
| Controller Button enumerations. | |
Macros | |
| #define | SXR_MAJOR_VERSION 3 |
| #define | SXR_MINOR_VERSION 0 |
| #define | SXR_REVISION_VERSION 2 |
| #define | SXR_MAX_RENDER_LAYERS 16 |
| #define | SXRP_EXPORT |
Enumerations | |
| enum | SxrResult { SXR_ERROR_NONE = 0, SXR_ERROR_UNKNOWN = 1, SXR_ERROR_UNSUPPORTED, SXR_ERROR_VRMODE_NOT_INITIALIZED, SXR_ERROR_VRMODE_NOT_STARTED, SXR_ERROR_VRMODE_NOT_STOPPED, SXR_ERROR_QVR_SERVICE_UNAVAILABLE, SXR_ERROR_JAVA_ERROR } |
| enum | sxrEventType { kEventNone = 0, kEventSdkServiceStarting = 1, kEventSdkServiceStarted = 2, kEventSdkServiceStopped = 3, kEventControllerConnecting = 4, kEventControllerConnected = 5, kEventControllerDisconnected = 6, kEventThermal = 7, kEventVrModeStarted = 8, kEventVrModeStopping = 9, kEventVrModeStopped = 10, kEventSensorError = 11, kEventMagnometerUncalibrated = 12, kEventBoundarySystemCollision = 13, kEvent6dofRelocation = 14, kEvent6dofWarningFeatureCount = 15, kEvent6dofWarningLowLight = 16, kEvent6dofWarningBrightLight = 17, kEvent6dofWarningCameraCalibration = 18 } |
| Events. | |
| enum | sxrWhichEye { kLeftEye = 0, kRightEye, kNumEyes } |
| Enum used to indicate which eye is being used. | |
| enum | sxrEyeMask { kEyeMaskLeft = 0x00000001, kEyeMaskRight = 0x00000002, kEyeMaskBoth = 0x00000003 } |
| Enum used to indicate which eye to apply a render layer. | |
| enum | sxrLayerFlags { kLayerFlagNone = 0x00000000, kLayerFlagHeadLocked = 0x00000001, kLayerFlagOpaque = 0x00000002 } |
| Enum used to indicate flags passed as part of a render layer. | |
| enum | sxrColorSpace { kColorSpaceLinear = 0, kColorSpaceSRGB = 1, kNumColorSpaces } |
| enum | sxrTrackingMode { kTrackingRotation = (1 << 0), kTrackingPosition = (1 << 1), kTrackingEye = (1 << 2) } |
| Enum used to indicate valid components of an pose state. | |
| enum | sxrEyePoseStatus { kGazePointValid = (1 << 0), kGazeVectorValid = (1 << 1), kEyeOpennessValid = (1 << 2), kEyePupilDilationValid = (1 << 3), kEyePositionGuideValid = (1 << 4) } |
| Structure containing flags indicating data valididty of an eye pose. | |
| enum | sxrPerfLevel { kPerfSystem = 0, kPerfMinimum = 1, kPerfMedium = 2, kPerfMaximum = 3, kNumPerfLevels } |
| Enum used for indicating the CPU/GPU performance levels. More... | |
| enum | sxrOptionFlags { kProtectedContent = (1 << 0), kMotionAwareFrames = (1 << 1) } |
| Flags used to set SXR options. | |
| enum | sxrFrameOption { kDisableDistortionCorrection = ( 1 << 0 ), kDisableReprojection = ( 1 << 1 ), kEnableMotionToPhoton = ( 1 << 2 ), kDisableChromaticCorrection = ( 1 << 3 ) } |
| Options which can be set when submitting a frame to modify the behavior of asynchronous time warp. More... | |
| enum | sxrTextureType { kTypeTexture = 0, kTypeTextureArray, kTypeImage, kTypeEquiRectTexture, kTypeEquiRectImage, kTypeCubemapTexture, kTypeVulkan } |
| Enum used to indicate the type of texture passed in as a render layer. More... | |
| enum | sxrWarpType { kSimple } |
| Enum used to indicate the type of warp/composition that should be used for a frame. More... | |
| enum | sxrWarpMeshType { kMeshTypeColumsLtoR = 0, kMeshTypeColumsRtoL, kMeshTypeRowsTtoB, kMeshTypeRowsBtoT } |
| Enumeration of possible warp mesh types. More... | |
| enum | sxrWarpMeshEnum { kMeshEnumLeft = 0, kMeshEnumRight, kMeshEnumUL, kMeshEnumUR, kMeshEnumLL, kMeshEnumLR, kWarpMeshCount } |
| Enumeration of possible warp meshes. More... | |
| enum | sxrThermalLevel { kSafe, kLevel1, kLevel2, kLevel3, kCritical, kNumThermalLevels } |
| enum | sxrThermalZone { kCpu, kGpu, kSkin, kNumThermalZones } |
| enum | sxrControllerMessageType { kControllerMessageRecenter = 0, kControllerMessageVibration = 1 } |
| Events to use in sxrControllerSendMessage. | |
| enum | sxrControllerQueryType { kControllerQueryBatteryRemaining = 0, kControllerQueryControllerCaps = 1 } |
| Query Values. | |
| enum | sxrControllerConnectionState { kNotInitialized = 0, kDisconnected = 1, kConnected = 2, kConnecting = 3, kError = 4 } |
| Controller Connection state. | |
| enum | { None = 0x00000000, One = 0x00000001, Two = 0x00000002, Three = 0x00000004, Four = 0x00000008, PrimaryThumbstick = 0x00000010, SecondaryThumstick = 0x00000020, Any = ~None } |
| enum | { PrimaryIndexTrigger = 0x00000000, SecondaryIndexTrigger = 0x00000001, PrimaryHandTrigger = 0x00000002, SecondaryHandTrigger = 0x00000003 } |
| enum | { PrimaryThumbstick = 0x00000000, SecondaryThumbstick = 0x00000001 } |
| enum | { None = 0x00000000, One = 0x00000001, Two = 0x00000002, Three = 0x00000004, Four = 0x00000008, DpadUp = 0x00000010, DpadDown = 0x00000020, DpadLeft = 0x00000040, DpadRight = 0x00000080, Start = 0x00000100, Back = 0x00000200, PrimaryShoulder = 0x00001000, PrimaryIndexTrigger = 0x00002000, PrimaryHandTrigger = 0x00004000, PrimaryThumbstick = 0x00008000, PrimaryThumbstickUp = 0x00010000, PrimaryThumbstickDown = 0x00020000, PrimaryThumbstickLeft = 0x00040000, PrimaryThumbstickRight = 0x00080000, SecondaryShoulder = 0x00100000, SecondaryIndexTrigger = 0x00200000, SecondaryHandTrigger = 0x00400000, SecondaryThumbstick = 0x00800000, SecondaryThumbstickUp = 0x01000000, SecondaryThumbstickDown = 0x02000000, SecondaryThumbstickLeft = 0x04000000, SecondaryThumbstickRight = 0x08000000, Up = 0x10000000, Down = 0x20000000, Left = 0x40000000, Right = 0x80000000, Any = ~None } |
Functions | |
| SXRP_EXPORT const char * | sxrGetVersion () |
| Returns the VR SDK version string. | |
| SXRP_EXPORT SxrResult | sxrGetXrServiceVersion (char *pRetBuffer, int bufferSize) |
| Returns the VR service version string. | |
| SXRP_EXPORT SxrResult | sxrGetXrClientVersion (char *pRetBuffer, int bufferSize) |
| Returns the VR client version string. | |
| SXRP_EXPORT SxrResult | sxrInitialize (const sxrInitParams *pInitParams) |
| Initializes VR components. More... | |
| SXRP_EXPORT SxrResult | sxrShutdown () |
| Releases VR components. | |
| SXRP_EXPORT sxrDeviceInfo | sxrGetDeviceInfo () |
| Queries for device specific information. More... | |
| SXRP_EXPORT SxrResult | sxrSetPerformanceLevels (sxrPerfLevel cpuPerfLevel, sxrPerfLevel gpuPerfLevel) |
| Requests specific brackets of CPU/GPU performance. More... | |
| SXRP_EXPORT SxrResult | sxrBeginXr (const sxrBeginParams *pBeginParams) |
| Enables XR services. More... | |
| SXRP_EXPORT SxrResult | sxrEndXr () |
| Disables XR services. | |
| SXRP_EXPORT float | sxrGetPredictedDisplayTime () |
| Calculates a predicted time when the current frame would be displayed. Assumes a pipeline depth of 1. More... | |
| SXRP_EXPORT float | sxrGetPredictedDisplayTimePipelined (unsigned int depth) |
| Calculates a predicted time when the current frame would be displayed. Allows for specifying the current depth of the pipeline. More... | |
| SXRP_EXPORT sxrHeadPoseState | sxrGetPredictedHeadPose (float predictedTimeMs) |
| Calculates a predicted head pose. More... | |
| SXRP_EXPORT sxrHeadPoseState | sxrGetHistoricHeadPose (int64_t timestampNs) |
| Retrieves a historic head pose. More... | |
| SXRP_EXPORT SxrResult | sxrGetEyePose (sxrEyePoseState *pReturnPose) |
| Retrieves a current eye pose. More... | |
| SXRP_EXPORT SxrResult | sxrRecenterPose () |
| Recenters the head position and orientation at the current values. | |
| SXRP_EXPORT SxrResult | sxrRecenterPosition () |
| Recenters the head position at the current position. | |
| SXRP_EXPORT SxrResult | sxrRecenterOrientation (bool yawOnly=true) |
| Recenters the head orientation (Yaw only) at the current value. | |
| SXRP_EXPORT uint32_t | sxrGetSupportedTrackingModes () |
| Returns the supported tracking types. More... | |
| SXRP_EXPORT SxrResult | sxrSetTrackingMode (uint32_t trackingModes) |
| Sets the current head tracking mode. More... | |
| SXRP_EXPORT uint32_t | sxrGetTrackingMode () |
| Returns the current head tracking mode. More... | |
| SXRP_EXPORT bool | sxrPollEvent (sxrEvent *pEvent) |
| Polls for an available event. If event(s) are present pEvent will be filled with the event details. More... | |
| SXRP_EXPORT SxrResult | sxrBeginEye (sxrWhichEye whichEye, sxrTextureType imageType=kTypeTexture) |
| Called after eye buffer is bound but before game rendering starts. More... | |
| SXRP_EXPORT SxrResult | sxrEndEye (sxrWhichEye whichEye, sxrTextureType imageType=kTypeTexture) |
| Called after eye buffer is rendered but before frame is submitted. More... | |
| SXRP_EXPORT SxrResult | sxrSubmitFrame (const sxrFrameParams *pFrameParams) |
| Submits a frame to asynchronous time warp. More... | |
| SXRP_EXPORT int | sxrControllerStartTracking (const char *controllerDesc) |
| Starts Tracking. More... | |
| SXRP_EXPORT void | sxrControllerStopTracking (int controllerHandle) |
| Stops tracking the controller. More... | |
| SXRP_EXPORT sxrControllerState | sxrControllerGetState (int controllerHandle, int controllerSpace=0) |
| Get the current state of the controller. More... | |
| SXRP_EXPORT void | sxrControllerSendMessage (int controllerHandle, int what, int arg1, int arg2) |
| Send a message to the controller. More... | |
| SXRP_EXPORT int | sxrControllerQuery (int controllerHandle, int what, void *memory, unsigned int memorySize) |
| make a query to the controller More... | |
| SXRP_EXPORT SxrResult | sxrSetWarpMesh (sxrWarpMeshEnum whichMesh, void *pVertexData, int vertexSize, int nVertices, unsigned int *pIndices, int nIndices) |
| Replaces the current Time Warp mesh the supplied mesh. More... | |
| SXRP_EXPORT SxrResult | sxrGetOcclusionMesh (sxrWhichEye whichEye, int *pTriangleCount, int *pVertexStride, float *pTriangles) |
| Gets triangle data for the occlusion area mesh. More... | |
| SXRP_EXPORT bool | sxrIsBoundarySystemEnabled () |
| Check whether the Boundary system is enabled. More... | |
| SXRP_EXPORT void | sxrEnableBoundarySystem (bool enableBoundary=true) |
| Enable/Disable the Boundary system. More... | |
| SXRP_EXPORT void | sxrForceDisplayBoundarySystem (bool forceDisplayBoundary=true) |
| Enable/Disable the forced display of Boundary system. More... | |
| SXRP_EXPORT SxrResult | sxrSetBoundaryParameters (float *pMinValues, float *pMaxValues, float visibilityRadius) |
| Set parameters for the Boundary system. More... | |
| SXRP_EXPORT SxrResult | sxrGetBoundaryParameters (float *pMinValues, float *pMaxValues, float *pVisibilityRadius) |
| Get parameters for the Boundary system. More... | |
| enum sxrFrameOption |
Options which can be set when submitting a frame to modify the behavior of asynchronous time warp.
| enum sxrPerfLevel |
Enum used for indicating the CPU/GPU performance levels.
| Enumerator | |
|---|---|
| kPerfSystem |
System defined performance level (default) |
| kPerfMinimum |
Minimum performance level. |
| kPerfMedium |
Medium performance level. |
| kPerfMaximum |
Maximum performance level. |
| enum sxrTextureType |
Enum used to indicate the type of texture passed in as a render layer.
| enum sxrWarpMeshEnum |
Enumeration of possible warp meshes.
| enum sxrWarpMeshType |
Enumeration of possible warp mesh types.
| enum sxrWarpType |
| SXRP_EXPORT SxrResult sxrBeginEye | ( | sxrWhichEye | whichEye, |
| sxrTextureType | imageType = kTypeTexture |
||
| ) |
Called after eye buffer is bound but before game rendering starts.
| whichEye | Which eye is being rendered |
| imageType | Type of eye render buffer |
| SXRP_EXPORT SxrResult sxrBeginXr | ( | const sxrBeginParams * | pBeginParams | ) |
Enables XR services.
| pBeginParams | sxrBeginParams structure |
| SXRP_EXPORT sxrControllerState sxrControllerGetState | ( | int | controllerHandle, |
| int | controllerSpace = 0 |
||
| ) |
Get the current state of the controller.
| controllerHandle | handle for the controller |
| SXRP_EXPORT int sxrControllerQuery | ( | int | controllerHandle, |
| int | what, | ||
| void * | memory, | ||
| unsigned int | memorySize | ||
| ) |
make a query to the controller
| controllerHandle | handle for the controller |
| what | info |
| memory | memory to fill in |
| memorySize | size of the memory to fill in |
| SXRP_EXPORT void sxrControllerSendMessage | ( | int | controllerHandle, |
| int | what, | ||
| int | arg1, | ||
| int | arg2 | ||
| ) |
Send a message to the controller.
| controllerHandle | handle for the controller |
| what | type of event |
| arg1 | argument for the event |
| arg2 | argument for the event |
| SXRP_EXPORT int sxrControllerStartTracking | ( | const char * | controllerDesc | ) |
Starts Tracking.
| controllerDesc | Controller Description |
| SXRP_EXPORT void sxrControllerStopTracking | ( | int | controllerHandle | ) |
Stops tracking the controller.
| controllerHandle | handle for the controller |
| SXRP_EXPORT void sxrEnableBoundarySystem | ( | bool | enableBoundary = true | ) |
Enable/Disable the Boundary system.
| enableBoundary | Whether to enable or disable the Boundary system |
| SXRP_EXPORT SxrResult sxrEndEye | ( | sxrWhichEye | whichEye, |
| sxrTextureType | imageType = kTypeTexture |
||
| ) |
Called after eye buffer is rendered but before frame is submitted.
| whichEye | Which eye is being rendered |
| imageType | Type of eye render buffer |
| SXRP_EXPORT void sxrForceDisplayBoundarySystem | ( | bool | forceDisplayBoundary = true | ) |
Enable/Disable the forced display of Boundary system.
| enableBoundary | Whether to enable or disable the forced display of Boundary system |
| SXRP_EXPORT SxrResult sxrGetBoundaryParameters | ( | float * | pMinValues, |
| float * | pMaxValues, | ||
| float * | pVisibilityRadius | ||
| ) |
Get parameters for the Boundary system.
| pMinValues | Real world minimum physical boundaries (Meters. 0 = X-Position; 1 = Y-Position; 2 = Z-Position) |
| pMaxValues | Real world maximum physical boundaries (Meters. 0 = X-Position; 1 = Y-Position; 2 = Z-Position) |
| pVisibilityRadius | Distance from physical boundaries when visual notification starts to appear |
| SXRP_EXPORT sxrDeviceInfo sxrGetDeviceInfo | ( | ) |
Queries for device specific information.
| SXRP_EXPORT SxrResult sxrGetEyePose | ( | sxrEyePoseState * | pReturnPose | ) |
Retrieves a current eye pose.
| SXRP_EXPORT sxrHeadPoseState sxrGetHistoricHeadPose | ( | int64_t | timestampNs | ) |
Retrieves a historic head pose.
| predictedTimeMs | Time in ns to retrieve a head pose for |
| SXRP_EXPORT SxrResult sxrGetOcclusionMesh | ( | sxrWhichEye | whichEye, |
| int * | pTriangleCount, | ||
| int * | pVertexStride, | ||
| float * | pTriangles | ||
| ) |
Gets triangle data for the occlusion area mesh.
| whichEye | which eye to get the occlusion mesh for |
| nTriangleCount | the number of triangles needed for the mesh, set to required size if pTriangles == NULL |
| pTriangles | buffer to store occlusion mesh data |
| SXRP_EXPORT float sxrGetPredictedDisplayTime | ( | ) |
Calculates a predicted time when the current frame would be displayed. Assumes a pipeline depth of 1.
| SXRP_EXPORT float sxrGetPredictedDisplayTimePipelined | ( | unsigned int | depth | ) |
Calculates a predicted time when the current frame would be displayed. Allows for specifying the current depth of the pipeline.
| SXRP_EXPORT sxrHeadPoseState sxrGetPredictedHeadPose | ( | float | predictedTimeMs | ) |
Calculates a predicted head pose.
| predictedTimeMs | Time ahead of the current time in ms to predict a head pose for |
| SXRP_EXPORT uint32_t sxrGetSupportedTrackingModes | ( | ) |
Returns the supported tracking types.
| SXRP_EXPORT uint32_t sxrGetTrackingMode | ( | ) |
Returns the current head tracking mode.
| SXRP_EXPORT SxrResult sxrInitialize | ( | const sxrInitParams * | pInitParams | ) |
Initializes VR components.
| pInitParams | sxrInitParams structure |
| SXRP_EXPORT bool sxrIsBoundarySystemEnabled | ( | ) |
Check whether the Boundary system is enabled.
| SXRP_EXPORT bool sxrPollEvent | ( | sxrEvent * | pEvent | ) |
Polls for an available event. If event(s) are present pEvent will be filled with the event details.
| SXRP_EXPORT SxrResult sxrSetBoundaryParameters | ( | float * | pMinValues, |
| float * | pMaxValues, | ||
| float | visibilityRadius | ||
| ) |
Set parameters for the Boundary system.
| pMinValues | Real world minimum physical boundaries (Meters. 0 = X-Position; 1 = Y-Position; 2 = Z-Position) |
| pMaxValues | Real world maximum physical boundaries (Meters. 0 = X-Position; 1 = Y-Position; 2 = Z-Position) |
| visibilityRadius | Distance from physical boundaries when visual notification starts to appear |
| SXRP_EXPORT SxrResult sxrSetPerformanceLevels | ( | sxrPerfLevel | cpuPerfLevel, |
| sxrPerfLevel | gpuPerfLevel | ||
| ) |
Requests specific brackets of CPU/GPU performance.
| cpuPerfLevel | Requested performance level for CPU |
| gpuPerfLevel | Requested performance level for GPU |
| SXRP_EXPORT SxrResult sxrSetTrackingMode | ( | uint32_t | trackingModes | ) |
Sets the current head tracking mode.
| trackingModes | Bitfield of sxrTrackingType values indicating the tracking modes to enable |
| SXRP_EXPORT SxrResult sxrSetWarpMesh | ( | sxrWarpMeshEnum | whichMesh, |
| void * | pVertexData, | ||
| int | vertexSize, | ||
| int | nVertices, | ||
| unsigned int * | pIndices, | ||
| int | nIndices | ||
| ) |
Replaces the current Time Warp mesh the supplied mesh.
| whichMesh | Which mesh is to be replaced |
| pVertexData | 15 float values per vertex: Position = 3; R|G|B UV values 4 each (Fourth value is Vignette multiplier [0,1]). NULL reverts the override. |
| vertexSize | Size of pVertexData |
| nVertices | Number of vertices contained in pVertexData |
| pIndices | Pointer to indice data. Expected to be used with GL_TRIANGLES |
| nIndices | Number of indices contained in pIndices. Expected to be used with GL_TRIANGLES |
| SXRP_EXPORT SxrResult sxrSubmitFrame | ( | const sxrFrameParams * | pFrameParams | ) |
Submits a frame to asynchronous time warp.
| pFrameParams | sxrFrameParams structure |
1.8.11