WVR_GetSyncPose

WVR_EXPORT void WVR_GetSyncPose(WVR_PoseOriginModel originModel, WVR_DevicePosePair_t * pairArray, uint32_t pairArrayCount)

Returns poses to usage for rendering scene.

This function gets the poses from runtime for the usage of rendering scene at the specific moment based on the pose origin model. The one-time configuring the tracking universe assumes one kind of origin pose models unless the model setting is not changed. The description of tracking universe can refer to the argument originModel of WVR_GetPoseState.

The poses and device type are aggregated together as struct WVR_DevicePosePair_t. The struct pointers of all tracked devices compose a specific size array to keep track of the locomotions of the devices. The specific array size can be substituted with three levels of device count. WVR_DEVICE_COUNT_LEVEL_0 is assumed to only track HMD. WVR_DEVICE_COUNT_LEVEL_1 is assumed that the HMD and two controllers are tracked. WVR_DEVICE_COUNT_LEVEL_2 should track the number of devices up to 16, including HMD, 2 controllers, and other miscellaneous tracking devices.

You will need to explicitly indicate the correct pose with the parameter ‘pose’ when calling WVR_SubmitFrame.

To reduce judder, the moment of getting poses should approximate the moment update the new scene on display. WVR_GetSyncPose also makes short time prediction of poses according to different render methods such as ATW and direct mode.

Version
API Level 1
Parameters
  • originModel: enum WVR_PoseOriginModel. Specify the tracking universe of the origin pose model.
  • pairArray: struct pointer WVR_DevicePosePair_t (refer to WVR_DevicePosePair). The aggregation array to keep the pose information and tracked device type.
  • pairArrayCount: uint32_t, specify the size of the WVR_DevicePosePair_t array. The three levels of device count are optional.

How to use

Here is an example for the function:

#include <wvr/wvr_device.h>

// Must initialize VR runtime once before tracking API.
WVR_InitError eError = WVR_InitError_None;
eError = WVR_Init(WVR_AppType_VRContent);
if (eError != WVR_InitError_None) {
    LOGE("Unable to initialize VR runtime: %s", WVR_GetInitErrorString(eError));
}

WVR_DevicePosePair_t mVRDevicePairs[WVR_DEVICE_COUNT_LEVEL_1];
WVR_GetSyncPose(WVR_PoseOriginModel_OriginOnHead, mVRDevicePairs, WVR_DEVICE_COUNT_LEVEL_1);

Invoking WVR_GetSyncPose or WVR_GetPoseState multiple times with different predicted time is allowed in programming before calling WVR_SubmitFrame, and in this case, passing the final rendered pose as the third parameter of WVR_SubmitFrame is necessary.

Please note that never call WVR_GetSyncPose or WVR_GetPoseState more than once before calling WVR_SubmitFrame without the pose being passed as a parameter

struce WVR_DevicePosePair_t defined follow below:

struct WVR_DevicePosePair

Aggregate the device type identity and device tracking pose.

Public Members

WVR_DeviceType type

VR device type.

WVR_PoseState_t pose

Pose information of the tracked VR device (refer to WVR_PoseState).