I know that Unity’s physics engine, by default, is scaled for 1 unit = 1 meter. The documentation on Rigidbody.mass doesn’t specify units, but I would assume this is kg. But the docs do say: “You should strive to keep mass close to 0.1 and never more than 10. Large masses make physics simulation unstable.”
This really makes me wonder. The standard unit cube, if made of something with the density of water, would 1000 kg. You basically can’t make any realistic human-scale object under 10 kg. Could it be the mass units actually be tons (1000 kg)?
Second question: how unstable are we talking about, with big numbers? We want to simulate something like a Falcon 9, which weighs about half a million kg (or about 500 tons), and lifts off with about 5000 kN of force. If we plug those numbers into the Unity physics engine, is it going to blow up? Or is it only a problem when colliding with other objects (which we don’t plan to do)?
Final question: is it OK to change the mass of an object (for example, because you’re burning fuel and throwing it out the back) during the simulation? I would assume so, since nothing says not to, but it’d be great to know whether this “just works” or whether we have to somehow tell the physics engine to recalculate something.
The units are arbitrary. You should try to keep the mass around 1 as the docs say; the physics engine does not do well with extreme scales due to floating point limitations. So for your jet, define 1 unit of mass as 0.5M kg and use that for all the math. Changing mass at any time is fine.
Hmm… maybe the claim that the physics engine assumes meters comes from the default gravitational acceleration (9.8 units/sec), but all other units are arbitrary.
Still a bit of a pain, since if I scale mass, I have to also scale force… but, such is life I guess. Sounds like it will do at least for a while.
If you will not build any complex constrained systems, it doesn’t really matter if you use extreme weights. I don’t think its a floating point issue, the mass property only has a meaning relative to another non-kinematic body if it becomes constrained or into collision with it.
So it doesn’t kill the engine, you just don’t want to constrain multiple extremely heavy objects to very light ones or have complex collisions between them.
If you just need to apply Newtons to your Falcon, it should be OK to use whatever mass you need. If you plan to take that Falcon to orbit in m/kg units, then you’ll have floating point problems though for sure.
Not by itself, but when combined with other factors when doing calculations. Although from what I’ve seen 10 seems low; I’ve done 100 without apparent issues.