1
\$\begingroup\$

Is that normal that while I'm jumping (by a player represented with a circle) on a dynamic bodies (boxes) they are interecting? It seems that there is some kind of diffraction. Is that any way to reduce this? Restitution is set to 0 for all.

The moment caught on a screenshot

The moment caught on a screenshot

And the moment after a collison

the moment after a collison

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

A little overlap is to be expectedone with Box2D, try increasing the positionIterations parameter in the call to World.step (also consider experimenting with the velocityIterations parameter).

Increasing these values gives a more stable simulation with less collision overlap, but it comes at a performance cost.

You can also try stepping the World in smaller increments, Gaffer on Games's Fix Your Timestep has a good description on how to decouple the physics time from the render time.

Play around with the values and find the compromise that works best for you.

\$\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.