o3de / o3de-extras

Other
61 stars 61 forks source link

New OpenXR Spaces and Actions Interfaces #673

Closed galibzon closed 7 months ago

galibzon commented 7 months ago

What does this PR do?

This PR completes the work regarding the new APIs that helps applications to work with Spaces and Actions in OpenXR, per the following RFC: https://github.com/o3de/sig-graphics-audio/issues/156

The OpenXRVk::Session now owns two important objects:

  1. OpenXRVk::ReferenceSpacesManager This one is in charge of implementing AZ::Interface.

  2. OpenXRVk::ActionsManager This one is in charge of implementing AZ::Interface. It object loads the "default.xractions" asset, and applications will be able to query the state of actions defined in this asset. XRCameraMovementComponent is now an example of this.

Both interfaces, AZ::Interface and AZ::Interface are also exposed in the BehaviorContext thanks to the file OpenXRVhBehaviorReflection.cpp/h A couple of Lua scripts have been provided as examples:

  1. Gems\OpenXRVk\Assets\OpenXRVk\Scripts\xr_camera_move.lua This Lua script can be used as an alternative to XRCameraMovementComponent.

  2. Gems\OpenXRVk\Assets\OpenXRVk\Scripts\xr_spaces_api_test.lua An example on how to use the new IOpenXRReferenceSpaces interface with Lua.

How was this PR tested?

Validated with OpenXRTest and custom internal application on Oculus Quest Pro and Oculus Quest 3.