Skip to main content

despawn_body

Function despawn_body 

Source
pub fn despawn_body(world: &World, body: RigidBodyHandle) -> bool
Expand description

Remove a body and its colliders from the physics world.

Returns whether the handle named a body. A caller that recycles a pool of bodies — a shape that has rested long enough to be replaced — calls this to give the simulation its memory back; the ground a scene builds once is left alone.

§Panics

Panics when the world carries no PhysicsWorld.