5
\$\begingroup\$

Box2D marks stable range of object size is 0.1M ~ 10M. This specifies object size range. How about space size? If I make an 1M object at (1000.0f,1000.0f) position? Is it can be stable? Or should I assume spatial range is also limited same with object size?

PS. Maybe the resolution limit is defined because of limit of floating-point operations. I believe there's also some limitation on spatial range, but I couldn't figure out specific range myself.

\$\endgroup\$
1
\$\begingroup\$

The answer is yes and no. Calculations in local space won't be bothered by large positions, but calculations in world space will be.

Collisions, for example, happen in local space. If two 1x1, density 1, |v| = 1 objects collide, it doesn't matter where they are - no magnitude involved in the collision detection or correction is going to be much above 2. Likewise, a very large, dense, or fast object is not going to be stable no matter where it is.

But things like body position updates happen in world space. If the same object is at position 10000000 has a speed of 0.1/sec, it might as well have a speed of 0 - or worse, it might keep one component of velocity but not the other.

At 1000,1000 you're probably just fine, you've still got a bit of precision to spare. But the world is not unlimited in size.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.