XR: Improve "Invalid stage ref space" warning

Originally mentioned that absolute tracking was disabled, which is
wrong because absolute tracking (skipping application of eye offsets)
is always available, although it may not give the expected result of
persistent tracking origins across sessions if the stage space is
unavailable (hence the need for a warning).

Now, the warning makes no mention of absolute tracking, instead
informing the user that the local space fallback will be used and
that they should define tracking bounds via the XR runtime if they
wish to use the stage space.
This commit is contained in:
Peter Kim 2021-08-25 20:55:14 +09:00
parent d6ace5a7bb
commit 940ba74024
1 changed files with 7 additions and 7 deletions

View File

@ -148,13 +148,12 @@ static void create_reference_spaces(OpenXRSessionData &oxr, const GHOST_XrPose &
if (XR_FAILED(result)) {
/* One of the rare cases where we don't want to immediately throw an exception on failure,
* since run-times are not required to support the stage reference space. Although we need the
* stage reference space for absolute tracking, if the runtime doesn't support it then just
* fallback to the local space. */
* since runtimes are not required to support the stage reference space. If the runtime
* doesn't support it then just fall back to the local space. */
if (result == XR_ERROR_REFERENCE_SPACE_UNSUPPORTED) {
printf(
"Warning: XR runtime does not support stage reference space, disabling absolute "
"tracking.\n");
"Warning: XR runtime does not support stage reference space, falling back to local "
"reference space.\n");
create_info.referenceSpaceType = XR_REFERENCE_SPACE_TYPE_LOCAL;
CHECK_XR(xrCreateReferenceSpace(oxr.session, &create_info, &oxr.reference_space),
@ -172,8 +171,9 @@ static void create_reference_spaces(OpenXRSessionData &oxr, const GHOST_XrPose &
"Failed to get stage reference space bounds.");
if (extents.width == 0.0f || extents.height == 0.0f) {
printf(
"Warning: Invalid stage reference space bounds, disabling absolute tracking. To enable "
"absolute tracking, please define a tracking space via the XR runtime.\n");
"Warning: Invalid stage reference space bounds, falling back to local reference space. "
"To use the stage reference space, please define a tracking space via the XR "
"runtime.\n");
/* Fallback to local space. */
if (oxr.reference_space != XR_NULL_HANDLE) {