07-13-2024 07:45 AM
I'm testing a game using the default browser with my Meta Quest 3. I want use https://developer.mozilla.org/en-US/docs/Web/API/XRBoundedReferenceSpace/boundsGeometry to determine the size and shape of the user's play area so I can adjust the game to fit that space. However, if I try
session
.requestReferenceSpace('bounded-floor')
.then((refSpace) => { console.log(refSpace.boundsGeometry); });
then it prints an empty array to the console (viewed remotely with Chrome devtools). If I call console.log(refSpace.boundsGeometry) a second time after session.requestAnimationFrame has been called a few times then an array with 4 points is printed to the console. These 4 points form a square that is much smaller than my place space and are partially outside of the play space too.
I tested out this example https://ivnnv.github.io/webxr-samples/room-scale.html and it seems to have the same issue.
Does anyone know what I might be doing wrong? Or is this an issue with the Meta Quest 3 browser?
07-17-2024 01:09 PM
Now suddenly I do get a boundsGeometry that fits my place space (though annoyingly it's still only 4 points rather than something more accurate). I'm not sure why it suddenly has started working. My guess is that I had two different locations I'd use my headset in and switching between them would cause the webxr API to behave incorrectly.