cannon.js
cannon.js copied to clipboard
Friction and recovery bug
bounce.txt change “bounce.txt” to “bounce.html”。s
When the cube falls, wait for a moment. You will find the cube above slowly moving away. This is a bug. How can I not let him fall? And how can it not rebound. I tried to use lockconstriaint. But slowly moving will not stack together. In friction: 1.0, restitution: 0.0. Isn't that a situation that shouldn't bounce and move? Thank you for helping me!
Let the objects go to sleep...
world.allowSleep = true;
and
const body = new CANNON.Body(<CANNON.IBodyOptions>{ ... body.sleepSpeedLimit = 0.1; body.sleepTimeLimit = 3;
@DavidHome It looks like you've added sleep to the world (which is correct), but I think you need to add them to the bodies you want to let sleep too:
body.allowSleep = true
body.sleepSpeedLimit = 0.1;
body.sleepTimeLimit = 3;