Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

World.HasBounds returns true even if xrGetReferenceSpaceBoundsRect failed #848

Open
keveleigh opened this issue Feb 2, 2024 · 0 comments

Comments

@keveleigh
Copy link

Description

Running on a device that currently supports stage space but doesn't support xrGetReferenceSpaceBoundsRect is causing my app to act on undefined data from World.BoundsSize.

Looking at the code, it properly checks for success and availability, but then returns true regardless of that success path.

XrExtent2Df bounds;
XrResult res = xrGetReferenceSpaceBoundsRect(xr_session, XR_REFERENCE_SPACE_TYPE_STAGE, &bounds);
if (XR_SUCCEEDED(res) && res != XR_SPACE_BOUNDS_UNAVAILABLE) {
out_size->x = bounds.width;
out_size->y = bounds.height;
log_diagf("Bounds updated: %.2g<~BLK>x<~clr>%.2g at (%.1g,%.1g,%.1g) (%.2g,%.2g,%.2g,%.2g)",
out_size->x, out_size->y,
out_pose->position .x, out_pose->position .y, out_pose->position .z,
out_pose->orientation.x, out_pose->orientation.y, out_pose->orientation.z, out_pose->orientation.w);
}
return true;

I guess thinking this through, this is maybe an interesting case, because the BoundsPose is valid but BoundsSize is not. Do we want HasBounds to be true iif both pose and size are valid? If it's okay to have just one or the other, we might need some way to message that to the app.

Platform / Environment

Android, using an SK template, on 0.3.9-preview.432.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant