rapier.js
rapier.js copied to clipboard
Add ability to disable auto sleeping for a rigid body
Sometimes, I need to disable auto sleeping for a particular body. Now I have a wrapper with the param isSleepingEnabled and in my update() method, each frame I call body.wakeUp(). I don't know how constant wakeUp() affects performance. Maybe it would be cleaner to add something like body.disableSleeping() for that kind of cases?
You can create one with disabled sleep: https://rapier.rs/javascript3d/classes/RigidBodyDesc.html#canSleep
@LeXXik right, but I need to change it in realtime, not only when I am creating the body.