My issue
So I’ve been working on a huge exoplanet simulator for nine months now : 3D planets, accurate trajectories, a tiny bit of lighting and that’s it. All of this is meant to be included in a massive exoplanet database website, in case anyone using it would like to see more than numbers and classification. My current task consists of a VR-mode for the application, because it kind of fits in my studies and it seemed easy to implement. I was wrong.
My main issue currently is the fact that I don’t know at all how to “resize” the player in the WebXR session. But why would I want to do that ?
Size and scales
Currently, my project has scientifically accurate distances and scales : planets and stars are placed exactly like they are in reality (at least for the Solar System). This implies tremendous ratios between planet size and distances, factors between objects and their distance to the star are hitting 10 000+ and we are likely to hit millions when working on larger systems. Long story short, Babylon hates small meshes (less than .01 units) and absolutely messes up with everything. So my planets have to get a minimum size (for reference, Earth is exactly 1 unit, so around 12 500 km), and the distances have to follow up on those (1 Astronomical Unit = 150 000 000 km = 11 727 units). For the Solar System alone, we are talking about a diameter of approximately 700 000 units.
Now, I would like to scale up the player in the WebXR mode at… well, around the scale of the system. The aim is more or less to make the player manipulate the whole system like if it was an hologram or something - those details don’t matter here. What I want here is simply have the player grow all the way up, to catch up to the enormous size of those systems. The opposite way - shrinking the system - is quite impossible, because as I said, Babylon can’t handle really small objects. In last resort, maybe I will treat all planets as points instead of meshes, and go for the shrink solution but I’d rather avoid that as much as possible, REALLY.
So that’s it : I want to make the player be hundreds of thousands, maybe millions of units high. I tried various things before asking help here, none of those being really useful.
What I’ve tried
I am working with on 5.0.0-beta.5, if that can help. So I’ve begun with the Diving Deeper section of the documentation about WebXR. Everything in it is fine, except for the ReferenceSpace bit. Really, everything around the ReferenceSpace looked like it could help me, maybe with the DefaultCompensationHeight of the XRSession or anything along these lines. The problem is, it seems the support for the ReferenceSpace is gone. The API links to this object are no longer valid, I could hardly find any trace of it in the GitHub, and the console showed that the ReferenceSpace attribute of the XRSession was unusable. Any manipulation I tried on anything related to the ReferenceSpace led to an error. So I guess this thing is deprecated, even though I am not sure of that.
Now I can’t really think of a way to scale up things without manipulating the ReferenceSpace. Sure, I can move the XRCamera up (and I absolutely did), but it doesn’t change the height of the player, only its position.
Maybe there is a way to do what I am describing, that is yet to see with the official release of the 5.0. If any of you can help me understand how to scale up the player, or at least what happened to the ReferenceSpace support, I’ll gladly accept it. You can find the exact part of my project that uses WebXR right here : Exoplanet.eu - Exo3D (XR module). The rest of the project is also public so you can check it out, but it’s far from being finished so the app is looking somewhat empty.