schteppe / p2.js

JavaScript 2D physics library
Other
2.64k stars 330 forks source link

[QUESTION] Unstable stack of boxes #317

Closed jose-pleonasm closed 6 years ago

jose-pleonasm commented 6 years ago

Hi, I have a stack of boxes, which is falling apart without any initial impulse. As you can see here: https://codepen.io/jose-pleonasm/pen/WdVzYv

Why is this happening? Did I miss something or is it a some kind of issue?

schteppe commented 6 years ago

You should activate the "sleep" feature, which will deactivate objects when they are moving very slowly. This will prevent "creeping" as in your demo. See https://schteppe.github.io/p2.js/demos/sleep.html

jose-pleonasm commented 6 years ago

Thank you, it helps.