wake

fun wake(body: RigidBody)(source)

Wakes body and every body that fell asleep with it: its island, everything it touched or was joined to. A body wakes by itself when an awake one hits it, when it is grabbed, given a velocity, moved or joined, and when what holds it up is removed; call this when you change the world some other way, such as removing a particle it rests on. Waking an awake body does nothing.

Samples

val world = PhysicsWorld()
world.rigidBody(Shape.box(400f, 20f), x = 0f, y = 20f, kind = BodyKind.STATIC)
val crate = world.rigidBody(Shape.box(20f, 20f), x = 0f, y = 0f)
repeat(120) { world.step(1.seconds / 60) }
assertPrints(world.rigidBodies.isAsleep(crate), "true")
world.rigidBodies.wake(crate)
assertPrints(world.rigidBodies.isAsleep(crate), "false")