You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request o3de#608 from galibzon/OpenXRFixes
This PR improves XrSpaces location calculation.
Previously, XrSpaces were being located each frame
during OpenXRVkInput::PollActions() which was called
before OpenXRVk::Device::BeginInternal(). The problem
with that approach is that xrLocateSpace needs
a "predicted display time" for the CURRENT frame.
But the "predicted display time" is calculated during
OpenXRVk::Device::BeginInternal(), this means that all XrPoses
for the CURRENT frame were calculated with the "predicted
display time" of the PREVIOUS frame. This was causing the rendered
frames to look jittery.
In this PR, the XrSpaces are now located during
OpenXRVk::Device::BeginInternal() this guarantees that
when xrLocateSpace is called it is using the correct
"predicted display time" for the CURRENT frame. This improves
the jitter because the camera View Srg transforms now feed the correct
transform value for each frame improving the stability of the rendered
views.
Another improvement is that the Base Space used in xrLocateSpace
is the LOCAL space instead of the hard coded VIEW space. Also APIS were
added to change the Base Space for both Visualized spaces and Controller (Joysticks)
spaces.
Also the engine is now notified via AZ::RPI::XRSpaceNotificationBus::OnXRSpaceLocationsChanged
at the right time so the engine can update the ViewSrg for each eye
at the correct time.
Another improvement is that the AZ::RPI::PoseData reported to the engine
is now given according to the O3DE convention: X+ Right, Y+ forward, Z+ Up.
Also added equivalent APIs that report the data as AZ::Transform.
Fixed bug when the Xr Poses would be corrupted
if the Proximity Sensor was enabled.
Now the XrSpaces are reset each time a XR_SESSION_STATE_READY
event is received (typically because the Proximity Sensor is disabled)
0 commit comments