3 ms·
Interesting. When I first got started with Unity I found really buggy behavior if you do any kind of physics calculations near world origin (0, 0, 0). It has a
by Zarathruster 4mo ago
Interesting. When I first got started with Unity I found really buggy behavior if you do any kind of physics calculations near world origin (0, 0, 0). It has a weird gravity well effect if you get too near it. I never found a satisfactory explanation for it but maybe this is it.
- aras_p 4mo agoIf you mean built-in Unity physics, then unlikely. All built-in physics stuff (either 3D physics which is PhysX, or 2D physics which is Box2D) are done entirely in C++ code and are unaffected by Mono float<->double shenanigans.
- Zarathruster 3mo agoIt was a prototype for a VR game in which you toss objects and I never drilled down far enough to see the implementation, since I just used the sample prefabs that come with the XR Interaction Toolkit. If you ever tossed anything in the vicinity of the origin, the object's trajectory would swerve towards it. Weirdly I couldn't reproduce the behavior when running the scene with a first-person controller in non-VR, so maybe a bug within that toolkit or something.
- gcr 4mo agoHow close to 0,0,0 are you talking? Subnormal floating point shenanigans maybe?
- Zarathruster 3mo agoWithin a meter or so, maybe a little more at times? But yeah I had an intuition that it was subnormal shenanigans, but didn't spend too long trying to diagnose, since it was easy enough to move everything a few meters offset.