Rufus31415 / Simple-WebXR-Unity

⭐ Bringing WebXR to Unity 3D ! B-)
https://rufus31415.github.io/webxr/MRTK-HandInteraction/
MIT License
573 stars 82 forks source link

Regression. VR scale no longer matches Unity editor scale on Oculus Quest #30

Open ThePaperDragon opened 3 years ago

ThePaperDragon commented 3 years ago

I recently tried the latest version of your plugin, and found that the scale of the scene is now based on the height of the headset at player start. The camera in my editor scene is at a seated height. If I start the build when I am standing, scene scale is huge and I feel like a hobbit. If I start the scene when crouched, scene scale is tiny and I feel like a giant. It is very important to my use (showing clients models of real world exhibit spaces) to have the scale in VR match the scale in Unity. A previous version of your plug-in that I have used (dated Dec 3) did not have this issue.

Rufus31415 commented 3 years ago

I'll try it with the last firmware of the Quest, I haven't done it yet. I only changed the starting position so that the world zero is at the level of the user's head. But the only way to change the scale of the scene is to resize the objects with the hands.

ThePaperDragon commented 3 years ago

I took a tape measure and measured an object's height and it was clearly changing based on the headset's height when I click the "enter VR" button. I know you are striving for consistency across platforms and trying to make things as simple as possible, but I much prefer the Quest browser's origin at floor level. I have a script in my code that moves the whole scene down along Y if the camera starts at floor level on another platform.

Rufus31415 commented 3 years ago

Ow really weird, I don't have this scale behavior on my Quest 1... For the start position, the variable SimpleWebXR.UserHeight contains the distance between the floor and your head. Would you be interested if I add a property to consider this height along Y at startup ?

ThePaperDragon commented 3 years ago

I finally had some time to do more testing. My apologies. Scale was was not changing, just camera height. My method of measuring was flawed. It is impressive how camera height can alter your perception of the scale of things when you can't see your body. You assume the floor you are seeing in VR is the actual floor and your brain scales things accordingly. SimpleWebXR.UserHeight sounds promising, but when I output it to a text object in the update call it always seems to be zero in the Oculus browser. I would very much like a property to consider height along Y at startup. Having the unity camera at the real world headset height is critical to my application.

Rufus31415 commented 3 years ago

ok, no problem.

What do you think of these additional properties?

You can choose which space to work in:

image image

ThePaperDragon commented 3 years ago

That looks like a perfect solution. I look forward to trying it out. Thanks!

ThePaperDragon commented 3 years ago

Hi Rufus, I just tested out your latest version. The interface looks great, but it is still not working correctly in the Oculus browser on my Quest 1. If I set my Reference Space to "Local Floor" it is always using the Fallback User Height rather than the actual user height of the Oculus. I found a good way to test, is to set your guardian to stationary and move outside of it just enough that you can see the guardian's floor ring. In your December 3rd version of Simple Web XR the guardian floor is perfectly coplanar with my unity floor. Not so the latest version.

Rufus31415 commented 3 years ago

Ok I should test with the same browser as you. I will try soon on a quest 1