Question about scale #373
-
The docs state In order for the simulation to be accurate, dynamic objects should be in the order [0.1, 10] meters long and have speeds in the order of [0, 500] m/s. Static object should be in the order [0.1, 2000] meter long. Does this restriction hold for double precision? How do you handle something relatively small like a rocket and an Earth sized planet? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, this restriction holds for double precision as well since the double precision positions are only used to calculate a relative distance between objects and from there on all calculations are done in floats (because it's much faster). Even if the calculations were all done in doubles, these limits would still exist as there are a lot of epsilons involved in a physics engine that are tuned to objects of a particular size. These limits are not absolute though, you can probably get away with one or more orders of magnitude bigger/smaller, but I didn't test it. W.r.t. the earth vs rocket sized objects. Even though the simulation now uses doubles, the broad phase still uses floats, so at around 10000 km from the origin, the broad phase becomes less efficient. At interstellar scale it will no longer function properly, so even though the simulation will still be accurate, it will cost a lot of extra CPU cycles to simulate it. I may write support for a double based broad phase in the future to alleviate these issues. There are some hints about how you could setup your simulation in this thread: #94. In any case you should split up your planet in smaller chunks and have 1 Body per chunk (which you probably need to do anyway in order to fit it in memory). |
Beta Was this translation helpful? Give feedback.
Yes, this restriction holds for double precision as well since the double precision positions are only used to calculate a relative distance between objects and from there on all calculations are done in floats (because it's much faster). Even if the calculations were all done in doubles, these limits would still exist as there are a lot of epsilons involved in a physics engine that are tuned to objects of a particular size. These limits are not absolute though, you can probably get away with one or more orders of magnitude bigger/smaller, but I didn't test it.
W.r.t. the earth vs rocket sized objects. Even though the simulation now uses doubles, the broad phase still uses floats, so at a…