rapier.js icon indicating copy to clipboard operation
rapier.js copied to clipboard

Add ability to disable auto sleeping for a rigid body

Open upisfree opened this issue 8 months ago • 2 comments

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?

upisfree avatar Aug 12 '25 22:08 upisfree

You can create one with disabled sleep: https://rapier.rs/javascript3d/classes/RigidBodyDesc.html#canSleep

LeXXik avatar Aug 13 '25 03:08 LeXXik

@LeXXik right, but I need to change it in realtime, not only when I am creating the body.

upisfree avatar Aug 13 '25 12:08 upisfree