nape.hacks.ForcedSleep

type
class
requires
nape-hacks module.
Methods for manual sleeping and insertion of sleeping objects to a Space.

Haxe users can make use of the 'using' keyword to permit usage like:
body.sleepBody();
space.addSleepingBody(body);
As opposed to the more verbose:
ForcedSleep.sleepBody(body);
ForcedSleep.addSleepingBody(space, body);

Static Methods

static function addSleepingBody(space:nape.space.Space, body:nape.phys.Body):Void

+ Add a sleeping Body to a Space.

static function addSleepingCompound(space:nape.space.Space, compound:nape.phys.Compound):Void

+ Add a sleeping Compound to a Space.

static function addSleepingConstraint(space:nape.space.Space, constraint:nape.constraint.Constraint):Void

+ Add a sleeping Constraint to a Space.

static function sleepBody(body:nape.phys.Body):Void

+ Force Body to go to sleep.

static function sleepCompound(compound:nape.phys.Compound):Void

+ Force Compound to go to sleep.

static function sleepConnected(body:nape.phys.Body):Void

+ Force Body, and all Bodies connected to go to sleep.

static function sleepConstraint(constraint:nape.constraint.Constraint):Void

+ Force Constraint to go to sleep.