OpenXR cookbook
Below are some common OpenXR how-to questions that we are often asked as developers dive in on building engines that target the OpenXR API.
How can my app recenter its reference space?
To recenter a reference space such as LOCAL
space or STAGE
space:
- Call
xrLocateSpace
to find the current location of theVIEW
reference space within the reference space you are recentering. - Call
xrCreateReferenceSpace
again for the reference space you are recentering, adding the currentVIEW
pose to theposeInReferenceSpace
field on yourXrReferenceSpaceCreateInfo
struct. - Call
xrDestroyReferenceSpace
on the old reference space handle and start using your new recentered reference space in its place.
Be sure to stash away the XrReferenceSpaceCreateInfo
struct you use in step 2, so that the next time you need to recenter, you can add the then-current VIEW
pose to the struct's accumulated poseInReferenceSpace
field.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for