Pico Native XR SDK
PxrApi.h File Reference
#include "PxrTypes.h"

Go to the source code of this file.

Functions

int Pxr_SetGraphicOption (PxrGraphicOption graphic)
 Sets the type of graphics API. More...
 
int Pxr_SetPlatformOption (PxrPlatformOption platform)
 Specifies the build platform. More...
 
int Pxr_SetInitializeData (PxrInitParamData *params)
 Sets the data required for initializing SDK.
Note: This API needs to be called before all the other init-related APIs. More...
 
int Pxr_Initialize ()
 Initializes the SDK. More...
 
bool Pxr_IsInitialized ()
 Gets whether the SDK is initialized. More...
 
int Pxr_Shutdown ()
 Exits and releases resources. More...
 
int Pxr_GetDeviceExtensionsVk (const char **extensionNamesArray, uint32_t *extensionCount)
 Gets the Vulkan extensions supported by the device. More...
 
int Pxr_GetInstanceExtensionsVk (const char **extensionNamesArray, uint32_t *extensionCount)
 Gets the Vulkan extensions supported by the instance. More...
 
int Pxr_GetDeviceExtensionsXRPlatform (char **namesString, uint32_t *extensionCount, uint32_t namesCapacityIn)
 
int Pxr_GetInstanceExtensionsXRPlatform (char **namesString, uint32_t *extensionCount, uint32_t namesCapacityIn)
 
int Pxr_CreateVulkanSystem (const PxrVulkanBinding *vulkanBinding)
 Inputs Vulkan binding parameters to create a Vulkan session. More...
 
bool Pxr_GetFeatureSupported (PxrFeatureType feature)
 
int Pxr_GetConfigViewsInfos (uint32_t *maxImageRectWidth, uint32_t *maxImageRectHeight, uint32_t *recommendedImageRectWidth, uint32_t *recommendedImageRectHeight)
 Gets the maximum and recommended width and height (in pixels) of the Render Buffer. More...
 
int Pxr_CreateLayer (const PxrLayerParam *layerParam)
 Creates a rendering layer. More...
 
int Pxr_GetLayerImageCount (int layerId, PxrEyeType eye, uint32_t *imageCount)
 Gets the number of images corresponding to a specified layer. More...
 
int Pxr_GetLayerImage (int layerId, PxrEyeType eye, int imageIndex, uint64_t *image)
 Gets the handle of a specified image used in a specified layer. More...
 
int Pxr_GetLayerNextImageIndex (int layerId, int *imageIndex)
 Gets the index of the handle of the image to be rendered in the next frame of the layer. More...
 
int Pxr_GetLayerAndroidSurface (int layerId, PxrEyeType eye, jobject *androidSurface)
 Gets the Android surface created when the layer is created.
Note: This API is available only if the layerFlags parameters contains PXR_LAYER_FLAG_ANDROID_SURFACE when Pxr_CreateLayer is called. It can be used for video media decoding. More...
 
int Pxr_GetLayerFoveationImage (int layerId, PxrEyeType eye, uint64_t *foveationImage, uint32_t *width, uint32_t *height)
 
int Pxr_DestroyLayer (int layerId)
 Destroies the specified layer. More...
 
bool Pxr_IsRunning ()
 Checks whether the XR mode has been entered. More...
 
int Pxr_BeginXr ()
 Enters the XR mode. More...
 
int Pxr_EndXr ()
 Exits the XR mode. More...
 
int Pxr_GetPredictedDisplayTime (double *predictedDisplayTimeMs)
 Gets the predicted display time of the current rendered frame. More...
 
int Pxr_GetPredictedMainSensorState (double predictTimeMs, PxrSensorState *sensorState, int *sensorFrameIndex)
 Gets the predicted position and pose of the head. More...
 
int Pxr_GetPredictedMainSensorState2 (double predictTimeMs, PxrSensorState2 *sensorState, int *sensorFrameIndex)
 
int Pxr_GetPredictedMainSensorStateWithEyePose (double predictTimeMs, PxrSensorState *sensorState, int *sensorFrameIndex, int eyeCount, PxrPosef *eyePoses)
 Gets the predicted position and pose data of the head, and gets the corresponding eye pose as well. More...
 
int Pxr_ResetSensor (PxrResetSensorOption option)
 Resets the pose. More...
 
int Pxr_BeginFrame ()
 Starts rendering each frame. More...
 
int Pxr_SubmitLayer (const PxrLayerHeader *layer)
 Commits the current rendering layer. More...
 
int Pxr_EndFrame ()
 Ends the current frame and submits all layers submitted by the rendering layer to the compositor layer. More...
 
bool Pxr_PollEvent (int eventCountMAX, int *eventDataCountOutput, PxrEventDataBuffer **eventDataPtr)
 Gets the latest event. More...
 
void Pxr_LogPrint (int priority, const char *tag, const char *fmt,...)
 
int Pxr_GetFov (PxrEyeType eye, float *fovLeft, float *fovRight, float *fovUp, float *fovDown)
 Gets the FOV of the current device. More...
 
int Pxr_GetFrustum (PxrEyeType eye, float *left, float *right, float *top, float *bottom, float *near, float *far)
 
int Pxr_SetFrustum (PxrEyeType eye, float left, float right, float top, float bottom, float near, float far)
 
int Pxr_SetPerformanceLevels (PxrPerfSettings which, int level)
 
int Pxr_GetPerformanceLevels (PxrPerfSettings which, int *level)
 
int Pxr_SetColorSpace (PxrColorSpace colorSpace)
 Sets the color space. More...
 
PxrFoveationLevel Pxr_GetFoveationLevel ()
 
int Pxr_SetFoveationLevel (PxrFoveationLevel level)
 Sets the foveated rendering level. More...
 
int Pxr_SetFoveationParams (PxrFoveationParams params)
 
int Pxr_SetTrackingMode (PxrTrackingModeFlags trackingMode)
 Sets the tracking mode. More...
 
int Pxr_GetTrackingMode (PxrTrackingModeFlags *trackingMode)
 Gets the value of tracking mode. More...
 
int Pxr_GetEyeTrackingData (PxrEyeTrackingData *eyeTrackingData)
 Gets the eye tracking data. More...
 
int Pxr_SetTrackingOrigin (PxrTrackingOrigin trackingOrigin)
 Sets tracking origin mode. More...
 
int Pxr_GetTrackingOrigin (PxrTrackingOrigin *trackingOrigin)
 Gets tracking origin settings. More...
 
float Pxr_GetIPD ()
 Gets the IPD (interpupillary distance). More...
 
bool Pxr_GetAppHasFocus ()
 
int Pxr_GetConfigInt (PxrConfigType configIndex, int *configData)
 Gets the value of the specified configuration item. More...
 
int Pxr_GetConfigFloat (PxrConfigType configIndex, float *configData)
 Gets the value of the specified configuration item. More...
 
int Pxr_SetConfigInt (PxrConfigType configSetIndex, int configSetData)
 Sets the value of the specified configuration item. More...
 
int Pxr_SetConfigString (PxrConfigType configIndex, const char *configSetData)
 
int Pxr_SetConfigUint64 (PxrConfigType configIndex, uint64_t configSetData)
 
void Pxr_RegisteKeyEventCallback (void *func)
 
bool Pxr_GetIntSysProc (char *command, int *rlt)
 
int Pxr_SetGuardianSystemDisable (bool disable)
 
int Pxr_ResumeGuardianSystemForSTS ()
 
int Pxr_PauseGuardianSystemForSTS ()
 
int Pxr_ShutdownSdkGuardianSystem ()
 
int Pxr_GetCameraDataExt (uint8_t **data)
 
int Pxr_StartSdkBoundary ()
 
int Pxr_StartCameraPreview (int value)
 
int Pxr_GetRoomModeState ()
 
int Pxr_GetDialogState ()
 Gets the reason why the boundary dialog box appears. More...
 
int Pxr_DisableBoundary ()
 
int Pxr_SetMonoMode (bool mono)
 
bool Pxr_GetBoundaryConfigured ()
 Gets whether the boundary has been configured. More...
 
bool Pxr_GetBoundaryEnabled ()
 Gets whether the boundary system has been enabled. More...
 
int Pxr_SetBoundaryVisible (bool value)
 Sets the boundary as visible or invisible. More...
 
int Pxr_SetSeeThroughBackground (bool value)
 
bool Pxr_GetBoundaryVisible ()
 Gets whether the boundary is visible. More...
 
int Pxr_SetSeeThroughVisible (bool value)
 
int Pxr_SetControllerPoseToBoundary (const PxrPosef *pose, PxrControllerHandness hand, bool valid)
 
int Pxr_TestNodeIsInBoundary (PxrBoundaryTestNode node, bool isPlayArea, PxrBoundaryTriggerInfo *info)
 Checks whether a tracked node will trigger the boundary. More...
 
int Pxr_TestPointIsInBoundary (const PxrVector3f *point, bool isPlayArea, PxrBoundaryTriggerInfo *info)
 Checks whether a tracked point in the coordinate system will trigger the boundary. More...
 
int Pxr_GetBoundaryGeometry (bool isPlayArea, uint32_t pointsCountInput, uint32_t *pointsCountOutput, PxrVector3f *outPoints)
 Gets the collection of boundary points. More...
 
int Pxr_GetBoundaryGeometry2 (bool isPlayArea, float **outPointsFloat, uint32_t *pointsCountOutput)
 Gets the collection of boundary points. More...
 
int Pxr_GetBoundaryDimensions (bool isPlayArea, PxrVector3f *dimension)
 
int Pxr_SetSeeThroughImageExtent (uint32_t width, uint32_t height)
 
int Pxr_GetSeeThroughData (PxrSeeThoughData *data)
 Gets the SeeThrough camera image. More...
 
bool Pxr_EnableMultiview (bool enable)
 Enables/disables Multiview. More...
 
int Pxr_GetMrcPose (PxrPosef *pose)
 
int Pxr_SetMrcPose (const PxrPosef *pose)
 
bool Pxr_GetMrcStatus ()
 
int Pxr_SetSensorLostCustomMode (bool value)
 
int Pxr_SetSensorLostCMST (bool value)
 
int Pxr_GetDisplayRefreshRatesAvailable (uint32_t *count, float **rateArray)
 Gets the available display refresh rates. More...
 
int Pxr_SetDisplayRefreshRate (float refreshRate)
 Sets the display refresh rate. More...
 
int Pxr_GetDisplayRefreshRate (float *refreshRate)
 Gets the current display refresh rate. More...
 
bool Pxr_SetExtraLatencyMode (int mode)
 

Function Documentation

◆ Pxr_BeginFrame()

int Pxr_BeginFrame ( )

Starts rendering each frame.

Returns
Int: 0 indicates success, and other values indicate failure.


◆ Pxr_BeginXr()

int Pxr_BeginXr ( )

Enters the XR mode.

Returns
Int: 0 indicates success, and other values indicate failure.


◆ Pxr_CreateLayer()

int Pxr_CreateLayer ( const PxrLayerParam layerParam)

Creates a rendering layer.

Parameters
layerParamA structure that contains the following parameters of the rendering layer to be created:
  • layerId: int, LayerID (0,1,2,3, etc)
  • layerShape: PxrLayerShape, layer shape (Projection/Quad/Cylinder)
  • layerType: PxrLayerType, layer type (Overlay: Texture will be rendered over the Render Buffer; Underlay: Texture will be rendered under the Render Buffer. It needs to be displayed by the alpha channel setting of the Render Buffer. If layerShape is set to Projection, this parameter is ignored)
  • layerLayout: PxrLayerLayout, layer layout:
    • Stereo:stereo binocular layer, the left and right eyes use two rendered images
    • DoubleWide: stereo binocular layer, the left and right eyes share a single image and use half of the left and right areas respectively
    • Array: stereo binocular layers, the left and right eyes share a 2D array image and use layer 0 and layer 1 of the image respectively, generally used for Multiview function
    • Mono: Monocular layer, full sharing of left and right eye images
  • format: uint64_t, image format, for example, OpenGLES can be GL_RGBA8, Vulkan can be VK_FORMAT_R8G8B8A8_UNORM
  • width: uint32_t, image width (in pixels)
  • height: uint32_t, image height (in pixels)
  • sampleCount: uint32_t, the number of image sampling channels, related to MSAA, such as 1, 2, 4, 8, etc
  • faceCount: uint32_t, the number of image faces, generally 1 or 6
  • arraySize: uint32_t, the number of image layers, generally 1, set to 2 for Multiview function
  • mipmapCount: uint32_t, the number of image mipmaps
  • layerFlags: uint32_t, layer flag
  • externalImageCount: uint32_t, the number of input images when using external images to create layers
  • externalImages[2]: uint64_t*, the pointer to the input two-eye image when using external images to create layers
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_CreateVulkanSystem()

int Pxr_CreateVulkanSystem ( const PxrVulkanBinding vulkanBinding)

Inputs Vulkan binding parameters to create a Vulkan session.

Parameters
vulkanBindingA structure containing the following:
  • instance
  • physicalDevice
  • device
  • queueFamilyIndex
  • queueIndex
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_DestroyLayer()

int Pxr_DestroyLayer ( int  layerId)

Destroies the specified layer.

Parameters
layerIdLayger ID.
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_DisableBoundary()

int Pxr_DisableBoundary ( )

◆ Pxr_EnableMultiview()

bool Pxr_EnableMultiview ( bool  enable)

Enables/disables Multiview.

Parameters
enableWhether to enable/disable Multiview:
  • true: enable
  • false: disable
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_EndFrame()

int Pxr_EndFrame ( )

Ends the current frame and submits all layers submitted by the rendering layer to the compositor layer.

Returns
Int: 0 indicates success, and other values indicate failure.


◆ Pxr_EndXr()

int Pxr_EndXr ( )

Exits the XR mode.

Returns
Int: 0 indicates success, and other values indicate failure.


◆ Pxr_GetAppHasFocus()

bool Pxr_GetAppHasFocus ( )

◆ Pxr_GetBoundaryConfigured()

bool Pxr_GetBoundaryConfigured ( )

Gets whether the boundary has been configured.

Returns
Bool:
  • true: configured
  • false: not configured

◆ Pxr_GetBoundaryDimensions()

int Pxr_GetBoundaryDimensions ( bool  isPlayArea,
PxrVector3f dimension 
)

◆ Pxr_GetBoundaryEnabled()

bool Pxr_GetBoundaryEnabled ( )

Gets whether the boundary system has been enabled.

Returns
Bool:
  • true: enabled
  • false: not enabled

◆ Pxr_GetBoundaryGeometry()

int Pxr_GetBoundaryGeometry ( bool  isPlayArea,
uint32_t  pointsCountInput,
uint32_t *  pointsCountOutput,
PxrVector3f outPoints 
)

Gets the collection of boundary points.

Parameters
isPlayAreaWhether it is an internal rectangular area:
  • true: internal rectangular area
  • false: external custom boundary
pointsCountInputThe number of points expected to be acquired. When the value is set to 0, it indicates that the indicator function is called to acquire the number of points that can be acquired.
pointsCountOutputThe actual number of points acquired.
outPointsThe points acquired.
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_GetBoundaryGeometry2()

int Pxr_GetBoundaryGeometry2 ( bool  isPlayArea,
float **  outPointsFloat,
uint32_t *  pointsCountOutput 
)

Gets the collection of boundary points.

Parameters
isPlayAreaWhether it is an internal rectangular area:
  • true: internal rectangular area
  • false: external custom boundary
outPointsFloatThe points acquired.
pointsCountOutputThe number of points acquired.
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_GetBoundaryVisible()

bool Pxr_GetBoundaryVisible ( )

Gets whether the boundary is visible.

Returns
Bool:
  • true: visible
  • false: invisible

◆ Pxr_GetCameraDataExt()

int Pxr_GetCameraDataExt ( uint8_t **  data)

◆ Pxr_GetConfigFloat()

int Pxr_GetConfigFloat ( PxrConfigType  configIndex,
float *  configData 
)

Gets the value of the specified configuration item.

Parameters
configIndexThe configuration item. Enumerations:
  • PXR_RENDER_TEXTURE_WIDTH (0): eyebuffer width, int, read-only
  • PXR_RENDER_TEXTURE_HEIGHT: eyebuffer height, int, read-only
  • PXR_SHOW_FPS: whether to show the FPS, int, read-only
  • PXR_RUNTIME_LOG_LEVEL: runtime loglevel, int, read-only
  • PXR_PXRPLUGIN_LOG_LEVEL: plugin loglevel, int, read-only
  • PXR_UNITY_LOG_LEVEL: Unity loglevel, int, read-only
  • PXR_UNREAL_LOG_LEVEL: Unreal loglevel, int, read-only
  • PXR_NATIVE_LOG_LEVEL: Native loglevel, int, read-only
  • PXR_TARGET_FRAME_RATE: target FPS, int, read-only
  • PXR_NECK_MODEL_X: X-coordinate of the neck model , float, read-only
  • PXR_NECK_MODEL_Y: Y-coordinate of the neck model, float, read-only
  • PXR_NECK_MODEL_Z: Z-coordinate of the neck model, float, read-only
  • PXR_DISPLAY_REFRESH_RATE: system display refresh rate, float, read-only
  • PXR_ENABLE_6DOF: the switch of 6dof, int, read-write
  • PXR_CONTROLLER_TYPE: current controller type, int, read-only
  • PXR_PHYSICAL_IPD: physical interpupillary distance, float, read-only
  • PXR_TO_DELTA_SENSOR_Y: delta Y data, float, read-only
  • PXR_GET_DISPLAY_RATE: screen refresh rate already set, float, read-write
  • PXR_FOVEATION_SUBSAMPLED_ENABLED: enabling status of FFR subsample, int, read-only
  • PXR_TRACKING_ORIGIN_HEIGHT: tracking origin height, float, read-only
  • PXR_ENGINE_VERSION: current engine version, string, write-only
  • PXR_UNREAL_OPENGL_NOERROR: mark of openglnoerror, int, write-only
  • PXR_ENABLE_CPT: content protection mark of projecting, int, write-only
  • PXR_MRC_TEXTURE_ID: MRC texture ID, uint64, write-only
  • PXR_RENDER_FPS: current frame rendering rate, float, read-only
  • PXR_MSAA_LEVEL_RECOMMENDED: recommended MSAA level, int, read-only
configDataReturns the value of the specified configuration item.
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_GetConfigInt()

int Pxr_GetConfigInt ( PxrConfigType  configIndex,
int *  configData 
)

Gets the value of the specified configuration item.

Parameters
configIndexThe configuration item. Enumerations:
  • PXR_RENDER_TEXTURE_WIDTH (0): eyebuffer width, int, read-only
  • PXR_RENDER_TEXTURE_HEIGHT: eyebuffer height, int, read-only
  • PXR_SHOW_FPS: whether to show the FPS, int, read-only
  • PXR_RUNTIME_LOG_LEVEL: runtime loglevel, int, read-only
  • PXR_PXRPLUGIN_LOG_LEVEL: plugin loglevel, int, read-only
  • PXR_UNITY_LOG_LEVEL: Unity loglevel, int, read-only
  • PXR_UNREAL_LOG_LEVEL: Unreal loglevel, int, read-only
  • PXR_NATIVE_LOG_LEVEL: Native loglevel, int, read-only
  • PXR_TARGET_FRAME_RATE: target FPS, int, read-only
  • PXR_NECK_MODEL_X: X-coordinate of the neck model , float, read-only
  • PXR_NECK_MODEL_Y: Y-coordinate of the neck model, float, read-only
  • PXR_NECK_MODEL_Z: Z-coordinate of the neck model, float, read-only
  • PXR_DISPLAY_REFRESH_RATE: system display refresh rate, float, read-only
  • PXR_ENABLE_6DOF: the switch of 6dof, int, read-write
  • PXR_CONTROLLER_TYPE: current controller type, int, read-only
  • PXR_PHYSICAL_IPD: physical interpupillary distance, float, read-only
  • PXR_TO_DELTA_SENSOR_Y: delta Y data, float, read-only
  • PXR_GET_DISPLAY_RATE: screen refresh rate already set, float, read-write
  • PXR_FOVEATION_SUBSAMPLED_ENABLED: enabling status of FFR subsample, int, read-only
  • PXR_TRACKING_ORIGIN_HEIGHT: tracking origin height, float, read-only
  • PXR_ENGINE_VERSION: current engine version, string, write-only
  • PXR_UNREAL_OPENGL_NOERROR: mark of openglnoerror, int, write-only
  • PXR_ENABLE_CPT: content protection mark of projecting, int, write-only
  • PXR_MRC_TEXTURE_ID: MRC texture ID, uint64, write-only
  • PXR_RENDER_FPS: current frame rendering rate, float, read-only
  • PXR_MSAA_LEVEL_RECOMMENDED: recommended MSAA level, int, read-only
configDataReturns the value of the specified configuration item.
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_GetConfigViewsInfos()

int Pxr_GetConfigViewsInfos ( uint32_t *  maxImageRectWidth,
uint32_t *  maxImageRectHeight,
uint32_t *  recommendedImageRectWidth,
uint32_t *  recommendedImageRectHeight 
)

Gets the maximum and recommended width and height (in pixels) of the Render Buffer.

Parameters
maxImageRectWidthThe max. width.
maxImageRectHeightThe max. height.
recommendedImageRectWidthThe recommended width.
recommendedImageRectHeightThe recommended height.
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_GetDeviceExtensionsVk()

int Pxr_GetDeviceExtensionsVk ( const char **  extensionNamesArray,
uint32_t *  extensionCount 
)

Gets the Vulkan extensions supported by the device.

Parameters
extensionNamesArrayAn array of Vulkan extensions supported by the acquired device.
extensionCountThe number of Vulkan extensions supported by the acquired device.
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_GetDeviceExtensionsXRPlatform()

int Pxr_GetDeviceExtensionsXRPlatform ( char **  namesString,
uint32_t *  extensionCount,
uint32_t  namesCapacityIn 
)

◆ Pxr_GetDialogState()

int Pxr_GetDialogState ( )

Gets the reason why the boundary dialog box appears.

Returns
Reason:
  • -1: NothingDialog (positional tracking disabled, no dialog box)
  • 0: GobackDialog (visible when leaving the boundary, hidden when back to the boundary)
  • 1: ToofarDialog (3 meters away from the boundary)
  • 2: LostDialog (6 Dof lost with no reason)
  • 3: LostNoReason (6 Dof lost with no reason)
  • 4: LostCamera (incorrect camera caliberation parameters)
  • 5: LostHighLight (too bright); 6-LostLowLight (too dark)
  • 7: LostLowFeatureCount (not enough environment feature points)
  • 8: LostReLocation (recovering positional tracking)

◆ Pxr_GetDisplayRefreshRate()

int Pxr_GetDisplayRefreshRate ( float *  refreshRate)

Gets the current display refresh rate.

Parameters
refreshRateThe display refresh rate to output.
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_GetDisplayRefreshRatesAvailable()

int Pxr_GetDisplayRefreshRatesAvailable ( uint32_t *  count,
float **  rateArray 
)

Gets the available display refresh rates.

Parameters
countThe number of available display refresh rates.
rateArrayAn array of available display refresh rates.
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_GetEyeTrackingData()

int Pxr_GetEyeTrackingData ( PxrEyeTrackingData eyeTrackingData)

Gets the eye tracking data.

Parameters
eyeTrackingDataA structure that contains the following:
  • leftEyePoseStatus: int32_t,, the status of the left-eye pose data
  • rightEyePoseStatus: int32_t, the status of the right-eye pose data
  • combinedEyePoseStatus: int32_t, the status of the combined eye pose data
  • leftEyeGazePoint[3]: float, the origin coordinate of the left-eye gaze point
  • rightEyeGazePoint[3]: float, the origin coordinate of the right-eye gaze point
  • combinedEyeGazePoint[3]: float, the origin coordinate of the combined eye gaze point
  • leftEyeGazeVector[3]: float, the direction of the left-eye gaze point
  • rightEyeGazeVector[3]: float, the direction of the right-eye gaze point
  • combinedEyeGazeVector[3]: float, the direction of the combined eye gaze point
  • leftEyeOpenness: float, the openness/closeness of the left eye. The value ranges from 0.0 to 1.0. 1.0 indicates fully open, and 0.0 indicates fully closed
  • rightEyeOpenness: float , the openness/closeness of the right eye. The value ranges from 0.0 to 1.0. 1.0 indicates fully open, and 0.0 indicates fully closed
  • leftEyePupilDilation: float, the size (in millimeters) of the left-eye pupil
  • rightEyePupilDilation: float, the size (in millimeters) of the right-eye pupil
  • leftEyePositionGuide[3]: float, the guidance data for the left-eye position (in meters), based on the combined coordinate system
  • rightEyePositionGuide[3]: float, the guidance data for the right-eye position (in meters), based on the combined coordinate system
  • foveatedGazeDirection[3]: float, the gaze direction (in meters), based on the combined coordinate system
  • foveatedGazeTrackingState: int32_t, the status of the gaze direction
Returns
Int: 0 indicates success, and other values indicate failure.


◆ Pxr_GetFeatureSupported()

bool Pxr_GetFeatureSupported ( PxrFeatureType  feature)

◆ Pxr_GetFov()

int Pxr_GetFov ( PxrEyeType  eye,
float *  fovLeft,
float *  fovRight,
float *  fovUp,
float *  fovDown 
)

Gets the FOV of the current device.

Parameters
eyeThe eye to get FOV for:
  • PXR_EYE_LEFT: left eye
  • PXR_EYE_RIGHT: right eye
fovLeftHorizontal left FOV.
fovRightHorizontal right FOV.
fovUpVertical up FOV.
fovDownVertical down FOV.
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_GetFoveationLevel()

PxrFoveationLevel Pxr_GetFoveationLevel ( )

◆ Pxr_GetFrustum()

int Pxr_GetFrustum ( PxrEyeType  eye,
float *  left,
float *  right,
float *  top,
float *  bottom,
float *  near,
float *  far 
)

◆ Pxr_GetInstanceExtensionsVk()

int Pxr_GetInstanceExtensionsVk ( const char **  extensionNamesArray,
uint32_t *  extensionCount 
)

Gets the Vulkan extensions supported by the instance.

Parameters
extensionNamesArrayAn array of Vulkan extensions supported by the acquired instance.
extensionCountThe number of Vulkan extensions supported by the acquired instance.
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_GetInstanceExtensionsXRPlatform()

int Pxr_GetInstanceExtensionsXRPlatform ( char **  namesString,
uint32_t *  extensionCount,
uint32_t  namesCapacityIn 
)

◆ Pxr_GetIntSysProc()

bool Pxr_GetIntSysProc ( char *  command,
int *  rlt 
)

◆ Pxr_GetIPD()

float Pxr_GetIPD ( )

Gets the IPD (interpupillary distance).

Returns
Float: 0 indicates success, and other values indicate failure.

◆ Pxr_GetLayerAndroidSurface()

int Pxr_GetLayerAndroidSurface ( int  layerId,
PxrEyeType  eye,
jobject *  androidSurface 
)

Gets the Android surface created when the layer is created.
Note: This API is available only if the layerFlags parameters contains PXR_LAYER_FLAG_ANDROID_SURFACE when Pxr_CreateLayer is called. It can be used for video media decoding.

Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_GetLayerFoveationImage()

int Pxr_GetLayerFoveationImage ( int  layerId,
PxrEyeType  eye,
uint64_t *  foveationImage,
uint32_t *  width,
uint32_t *  height 
)

◆ Pxr_GetLayerImage()

int Pxr_GetLayerImage ( int  layerId,
PxrEyeType  eye,
int  imageIndex,
uint64_t *  image 
)

Gets the handle of a specified image used in a specified layer.

Parameters
layerIdThe layer ID.
eyeThe eye that the image comes from:
  • PXR_EYE_LEFT: left eye
  • PXR_EYE_RIGHT: right eye
imageIndexThe image idex.
imageReturns the handle value of the specified image:
  • OpenGLES will return Texture ID
  • Vulkan will return VkImage
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_GetLayerImageCount()

int Pxr_GetLayerImageCount ( int  layerId,
PxrEyeType  eye,
uint32_t *  imageCount 
)

Gets the number of images corresponding to a specified layer.

Parameters
layerIdThe layer ID.
eyeThe eye that the images come from:
  • PXR_EYE_LEFT: left eye
  • PXR_EYE_RIGHT: right eye
imageCountReturns the number of images.
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_GetLayerNextImageIndex()

int Pxr_GetLayerNextImageIndex ( int  layerId,
int *  imageIndex 
)

Gets the index of the handle of the image to be rendered in the next frame of the layer.

Parameters
layerIdThe layer ID.
imageIndexReturns the index of the image handle..
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_GetMrcPose()

int Pxr_GetMrcPose ( PxrPosef pose)

◆ Pxr_GetMrcStatus()

bool Pxr_GetMrcStatus ( )

◆ Pxr_GetPerformanceLevels()

int Pxr_GetPerformanceLevels ( PxrPerfSettings  which,
int *  level 
)

◆ Pxr_GetPredictedDisplayTime()

int Pxr_GetPredictedDisplayTime ( double *  predictedDisplayTimeMs)

Gets the predicted display time of the current rendered frame.

Parameters
predictedDisplayTimeMsReturns the predicted display time (in milliseconds) of the current rendered frame.
Returns
Int: 0 indicates success, and other values indicate failure.


◆ Pxr_GetPredictedMainSensorState()

int Pxr_GetPredictedMainSensorState ( double  predictTimeMs,
PxrSensorState sensorState,
int *  sensorFrameIndex 
)

Gets the predicted position and pose of the head.

Parameters
predictTimeMsThe predicted display time (in milliseconds) of the current rendered frame, obtained by calling Pxr_GetPredictedDisplayTime.
sensorStateReturns the acquired position and pose of the sensor and other data.
sensorFrameIndexReturns the serial number corresponding to the pose and position of the sensor.
Returns
Int: 0 indicates success, and other values indicate failure.


◆ Pxr_GetPredictedMainSensorState2()

int Pxr_GetPredictedMainSensorState2 ( double  predictTimeMs,
PxrSensorState2 sensorState,
int *  sensorFrameIndex 
)

◆ Pxr_GetPredictedMainSensorStateWithEyePose()

int Pxr_GetPredictedMainSensorStateWithEyePose ( double  predictTimeMs,
PxrSensorState sensorState,
int *  sensorFrameIndex,
int  eyeCount,
PxrPosef eyePoses 
)

Gets the predicted position and pose data of the head, and gets the corresponding eye pose as well.

Parameters
predictTimeMsThe predicted display time (in milliseconds) of the current rendered frame, obtained by calling Pxr_GetPredictedDisplayTime.
sensorStateReturns the position and pose of the sensor as well as other data acquired.
sensorFrameIndexReturns the serial number corresponding to the position and pose of the sensor.
Returns
Int: 0 indicates success, and other values indicate failure.


◆ Pxr_GetRoomModeState()

int Pxr_GetRoomModeState ( )

◆ Pxr_GetSeeThroughData()

int Pxr_GetSeeThroughData ( PxrSeeThoughData data)

Gets the SeeThrough camera image.

Parameters
dataA structure that contains the following:
  • leftEyeTextureId: uint64_t, the left eye holds the handle of the SeeThrough camera image. Setting it to 0 indicates not to acquire the left-eye image
  • rightEyeTextureId: uint64_t, the right eye holds the handle of the SeeThrough camera image. Setting it to 0 indicates not to acquire the right-eye image
  • width: uint32_t, the desired image width (in pixels). The output is the actual width acquired
  • height: uint32_t, the desired image height (in pixels). The output is the actual height acquired
  • exposure: uint32_t, the exposure time acquired
  • startTimeOfExposure: int64_t, the start time of exposure
  • valid: bool, whether the acquired data are valid
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_GetTrackingMode()

int Pxr_GetTrackingMode ( PxrTrackingModeFlags trackingMode)

Gets the value of tracking mode.

Parameters
trackingModeThe value of tracking mode acquired. Value 7 indicates that eye tracking is supported.
Returns
Int: 0 indicates success, and other values indicate failure.


◆ Pxr_GetTrackingOrigin()

int Pxr_GetTrackingOrigin ( PxrTrackingOrigin trackingOrigin)

Gets tracking origin settings.

Parameters
trackingOriginReturns the tracking origin settings.
Returns
Int: 0 indicates success, and other values indicate failure.


◆ Pxr_Initialize()

int Pxr_Initialize ( )

Initializes the SDK.

Returns
Int: 0 indicates success, and other values indicate failure.


◆ Pxr_IsInitialized()

bool Pxr_IsInitialized ( )

Gets whether the SDK is initialized.

Returns
Bool:
  • true: initialized
  • false: not initialized


◆ Pxr_IsRunning()

bool Pxr_IsRunning ( )

Checks whether the XR mode has been entered.

Returns
Bool:
  • true: entered
  • false: not entered


◆ Pxr_LogPrint()

void Pxr_LogPrint ( int  priority,
const char *  tag,
const char *  fmt,
  ... 
)

◆ Pxr_PauseGuardianSystemForSTS()

int Pxr_PauseGuardianSystemForSTS ( )

◆ Pxr_PollEvent()

bool Pxr_PollEvent ( int  eventCountMAX,
int *  eventDataCountOutput,
PxrEventDataBuffer **  eventDataPtr 
)

Gets the latest event.

Parameters
eventCountMAXThe maximum number of messages.
eventDataCountOutputThe number of messages received.
eventDataPtrThe array of the event structure.
Returns
Bool:
  • true: new event
  • false: no event

◆ Pxr_RegisteKeyEventCallback()

void Pxr_RegisteKeyEventCallback ( void *  func)

◆ Pxr_ResetSensor()

int Pxr_ResetSensor ( PxrResetSensorOption  option)

Resets the pose.

Parameters
optionThe options for reset:
  • PXR_RESET_POSITION: resets position only
  • PXR_RESET_ORIENTATION: resets pose only
  • PXR_RESET_ORIENTATION_Y_ONLY: resets the pose that rotates around the Y-axis only
  • PXR_RESET_ALL: resets both position and pose
Returns
Int: 0 indicates success, and other values indicate failure.


◆ Pxr_ResumeGuardianSystemForSTS()

int Pxr_ResumeGuardianSystemForSTS ( )

◆ Pxr_SetBoundaryVisible()

int Pxr_SetBoundaryVisible ( bool  value)

Sets the boundary as visible or invisible.

Parameters
valueThe visibility of the boundary:
  • true: visible
  • false: invisible
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_SetColorSpace()

int Pxr_SetColorSpace ( PxrColorSpace  colorSpace)

Sets the color space.

Parameters
colorSpaceThe color space type:
  • ColorSpaceLinear: linear
  • ColorSpaceSRGB: RGB
Returns
Int: 0 indicates success, and other values indicate failure.


◆ Pxr_SetConfigInt()

int Pxr_SetConfigInt ( PxrConfigType  configSetIndex,
int  configSetData 
)

Sets the value of the specified configuration item.

Parameters
configIndexThe configuration item. Enumerations:
  • PXR_RENDER_TEXTURE_WIDTH (0): eyebuffer width, int, read-only
  • PXR_RENDER_TEXTURE_HEIGHT: eyebuffer height, int, read-only
  • PXR_SHOW_FPS: whether to show the FPS, int, read-only
  • PXR_RUNTIME_LOG_LEVEL: runtime loglevel, int, read-only
  • PXR_PXRPLUGIN_LOG_LEVEL: plugin loglevel, int, read-only
  • PXR_UNITY_LOG_LEVEL: Unity loglevel, int, read-only
  • PXR_UNREAL_LOG_LEVEL: Unreal loglevel, int, read-only
  • PXR_NATIVE_LOG_LEVEL: Native loglevel, int, read-only
  • PXR_TARGET_FRAME_RATE: target FPS, int, read-only
  • PXR_NECK_MODEL_X: X-coordinate of the neck model , float, read-only
  • PXR_NECK_MODEL_Y: Y-coordinate of the neck model, float, read-only
  • PXR_NECK_MODEL_Z: Z-coordinate of the neck model, float, read-only
  • PXR_DISPLAY_REFRESH_RATE: system display refresh rate, float, read-only
  • PXR_ENABLE_6DOF: the switch of 6dof, int, read-write
  • PXR_CONTROLLER_TYPE: current controller type, int, read-only
  • PXR_PHYSICAL_IPD: physical interpupillary distance, float, read-only
  • PXR_TO_DELTA_SENSOR_Y: delta Y data, float, read-only
  • PXR_GET_DISPLAY_RATE: screen refresh rate already set, float, read-write
  • PXR_FOVEATION_SUBSAMPLED_ENABLED: enabling status of FFR subsample, int, read-only
  • PXR_TRACKING_ORIGIN_HEIGHT: tracking origin height, float, read-only
  • PXR_ENGINE_VERSION: current engine version, string, write-only
  • PXR_UNREAL_OPENGL_NOERROR: mark of openglnoerror, int, write-only
  • PXR_ENABLE_CPT: content protection mark of projecting, int, write-only
  • PXR_MRC_TEXTURE_ID: MRC texture ID, uint64, write-only
  • PXR_RENDER_FPS: current frame rendering rate, float, read-only
  • PXR_MSAA_LEVEL_RECOMMENDED: recommended MSAA level, int, read-only
configDataThe value of the specified configuration item.
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_SetConfigString()

int Pxr_SetConfigString ( PxrConfigType  configIndex,
const char *  configSetData 
)

◆ Pxr_SetConfigUint64()

int Pxr_SetConfigUint64 ( PxrConfigType  configIndex,
uint64_t  configSetData 
)

◆ Pxr_SetControllerPoseToBoundary()

int Pxr_SetControllerPoseToBoundary ( const PxrPosef pose,
PxrControllerHandness  hand,
bool  valid 
)

◆ Pxr_SetDisplayRefreshRate()

int Pxr_SetDisplayRefreshRate ( float  refreshRate)

Sets the display refresh rate.

Parameters
refreshRateThe display refresh rate (in Hz) to set:
  • 0.0
  • 72.0
  • 90.0
  • 120.0
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_SetExtraLatencyMode()

bool Pxr_SetExtraLatencyMode ( int  mode)

◆ Pxr_SetFoveationLevel()

int Pxr_SetFoveationLevel ( PxrFoveationLevel  level)

Sets the foveated rendering level.

Parameters
levelFoveated rendering level:
  • Foveation_Level_NONE: none (disable foveated rendering)
  • Foveation_Level_LOW: low
  • Foveation_Level_MID: mid
  • Foveation_Level_HIGH: high
  • Foveation_Level_TOP_HIGH: top high
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_SetFoveationParams()

int Pxr_SetFoveationParams ( PxrFoveationParams  params)

◆ Pxr_SetFrustum()

int Pxr_SetFrustum ( PxrEyeType  eye,
float  left,
float  right,
float  top,
float  bottom,
float  near,
float  far 
)

◆ Pxr_SetGraphicOption()

int Pxr_SetGraphicOption ( PxrGraphicOption  graphic)

Sets the type of graphics API.

Parameters
graphicGraphics API type:
  • PXR_VULKAN: Vulkan
  • PXR_OPENGL_ES: OpenGLES (default)

◆ Pxr_SetGuardianSystemDisable()

int Pxr_SetGuardianSystemDisable ( bool  disable)

◆ Pxr_SetInitializeData()

int Pxr_SetInitializeData ( PxrInitParamData params)

Sets the data required for initializing SDK.
Note: This API needs to be called before all the other init-related APIs.

Parameters
PxrInitParamDataA structure that contains the collection of required data for initialization:
  • activity: void*, activity handle,app->activity->class
  • vm: void*, java vm handle,app->activity->vm
  • controllerdof: int,
    • 1: controller 6 DoF
    • 0: controller 3 DoF
  • headdof: int,
    • 1: headset 6 DoF
    • 0: headset 3 DoF


◆ Pxr_SetMonoMode()

int Pxr_SetMonoMode ( bool  mono)

◆ Pxr_SetMrcPose()

int Pxr_SetMrcPose ( const PxrPosef pose)

◆ Pxr_SetPerformanceLevels()

int Pxr_SetPerformanceLevels ( PxrPerfSettings  which,
int  level 
)

◆ Pxr_SetPlatformOption()

int Pxr_SetPlatformOption ( PxrPlatformOption  platform)

Specifies the build platform.

Parameters
platformBuild platform:
  • PXR_UNITY: Unity
  • PXR_UNREAL: Unreal
  • PXR_NATIVE: Native


◆ Pxr_SetSeeThroughBackground()

int Pxr_SetSeeThroughBackground ( bool  value)

◆ Pxr_SetSeeThroughImageExtent()

int Pxr_SetSeeThroughImageExtent ( uint32_t  width,
uint32_t  height 
)

◆ Pxr_SetSeeThroughVisible()

int Pxr_SetSeeThroughVisible ( bool  value)

◆ Pxr_SetSensorLostCMST()

int Pxr_SetSensorLostCMST ( bool  value)

◆ Pxr_SetSensorLostCustomMode()

int Pxr_SetSensorLostCustomMode ( bool  value)

◆ Pxr_SetTrackingMode()

int Pxr_SetTrackingMode ( PxrTrackingModeFlags  trackingMode)

Sets the tracking mode.

Parameters
trackingModeTracking mode:
  • PXR_TRACKING_MODE_ROTATION_BIT: pose tracking (enabled by default)
  • PXR_TRACKING_MODE_POSITION_BIT: position tracking
  • PXR_TRACKING_MODE_EYE_BIT: eye tracking (the device should support eye tracking)
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_SetTrackingOrigin()

int Pxr_SetTrackingOrigin ( PxrTrackingOrigin  trackingOrigin)

Sets tracking origin mode.

Parameters
trackingOriginThe tracking origon mode:
  • PXR_EYE_LEVEL: Eye mode (known as the Device mode, the application will not calculate the to-be-tracked origin from the height detected by the headset)
  • PXR_FLOOR_LEVEL: Floor mode (the application will calculate the to-be-tracked origin from the above-ground height detected by the headset)
  • PXR_STAGE_LEVEL: Stage mode (known as the Tracking Reference mode, the positive direction will not be reset during calibration)
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_Shutdown()

int Pxr_Shutdown ( )

Exits and releases resources.

Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_ShutdownSdkGuardianSystem()

int Pxr_ShutdownSdkGuardianSystem ( )

◆ Pxr_StartCameraPreview()

int Pxr_StartCameraPreview ( int  value)

◆ Pxr_StartSdkBoundary()

int Pxr_StartSdkBoundary ( )

◆ Pxr_SubmitLayer()

int Pxr_SubmitLayer ( const PxrLayerHeader layer)

Commits the current rendering layer.

Parameters
layerThe actual object can be PxrLayerProjection, PxrLayerQuad, or PxrLayerCylinder.
The PxrLayerHeader structure contains the following:
  • layerId: int, Layer ID
  • layerFlags: uint32_t, layer flag
  • colorScale[4]: float, layer color scale and bias, when synthesized, layer Color=color*colorScale+colorBias
  • colorBias[4]: float, layer bias
  • compositionDepth: int, the depth value of layer composition, such as -1, 0, 1, etc. The layer with the larger depth value is rendered under the layer with the smaller depth value
  • sensorFrameIndex: int, the index of sensor data used for layer rendering, obtained by calling Pxr_GetPredictedMainSensorState
  • imageIndex: int, the image index used in layer rendering, this field is currently reserved and not implemented
  • headPose: PxrPosef, if layerFlags is set to PXR_LAYER_FLAG_USE_EXTERNAL_HEAD_POSE, this field takes effect. The compositor layer uses headPose for synthesizing the layer, and sensorFrameIndex does not take effect at this time

The PxrLayerProjection (for Render Buffer layer submission) structure contains the following:
  • header: PxrLayerHeader
  • depth: float, the centeral point corresponds to the depth value in the rendered scene. The default setting is 0, meaning no concern

The PxrLayerQuad (for 2D planar layer submission) structure contains the following:
  • header: PxrLayerHeader
  • pose: PxrPosef, the position and pose of the 2D layer in the scene
  • size[2]: float, the width and height (in meters) of the 2D layer in the scene

The PxrLayerCylinder (for column layer submission) structure contains the following:
  • header: PxrLayerHeader
  • pose: PxrPosef, the position and pose of the cylinder in the scene
  • radius: float, the radius (in meters) of the horizontal cross-section of the cylinder
  • centralAngle: float, the radian of the horizontal cross-section of the cylinder
  • height:float, the height (in meters) of the cylinder
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_TestNodeIsInBoundary()

int Pxr_TestNodeIsInBoundary ( PxrBoundaryTestNode  node,
bool  isPlayArea,
PxrBoundaryTriggerInfo info 
)

Checks whether a tracked node will trigger the boundary.

Parameters
nodeThe node to track:
  • PXR_BOUNDARY_TEST_NODE_LEFT_HAND: left hand
  • PXR_BOUNDARY_TEST_NODE_RIGHT_HAND: right hand
  • PXR_BOUNDARY_TEST_NODE_HEAD: head
isPlayAreaWhether it is an internal rectangular area:
  • true: internal rectangular area
  • false: external custom boundary
infoA structure containing the following:
  • isTriggering: bool, whether the boundary is triggered
  • closestDistance: float, the the closest distance between the tracked node and the boundary
  • closestPoint: PxrVector3f, the closest point between the tracked node and the boundary
  • closestPointNormal: PxrVector3f, the normal line of the closets point
  • valid: bool, whether the result is valid
Returns
Int: 0 indicates success, and other values indicate failure.

◆ Pxr_TestPointIsInBoundary()

int Pxr_TestPointIsInBoundary ( const PxrVector3f point,
bool  isPlayArea,
PxrBoundaryTriggerInfo info 
)

Checks whether a tracked point in the coordinate system will trigger the boundary.

Parameters
pointThe coordinate of the point.
isPlayAreaWhether it is an internal rectangular area:
  • true: internal rectangular area
  • false: external custom boundary
infoA structure containing the following:
  • isTriggering: bool, whether the boundary is triggered
  • closestDistance: float, the the closest distance between the tracked node and the boundary
  • closestPoint: PxrVector3f, the closest point between the tracked node and the boundary
  • closestPointNormal: PxrVector3f, the normal line of the closets point
  • valid: bool, whether the result is valid
Returns
Int: 0 indicates success, and other values indicate failure.