class nape.dynamics.Arbiter

Available on all platforms

Arbiter representing the state of an interaction between two Bodys. *

* These objects are automatically reused, and you should not keep your own * references to them.

Instance Fields

var body1:Body

The first body in Arbiter interaction. *

* It will always be the case that arb.shape1.body == arb.body1

var body2:Body

The second body in Arbiter interaction. *

* It will always be the case that arb.shape2.body == arb.body2

var collisionArbiter:Null<CollisionArbiter>

Fast equivalent to casting this object to a CollisionArbiter. *

* This value is null when this arbiter is not a collision type.

var fluidArbiter:Null<FluidArbiter>

Fast equivalent to casting this object to a FluidArbiter. *

* This value is null when this arbiter is not a fluid type.

var isSleeping:Bool

Flag representing arbiter sleep state. *

* When true, this arbiter is sleeping.

var shape1:Shape

The first shape in Arbiter interaction. *

* It will always be the case that arb.shape1.id < arb.shape2.id

var shape2:Shape

The second shape in Arbiter interaction. *

* It will always be the case that arb.shape1.id < arb.shape2.id

var state:PreFlag

The interaction state of this Arbiter. *

* This flag will, except for in a PreListener handler, always be either * ImmState.ACCEPT or ImmState.IGNORE *
* During a PreListener handler, you can query this property to see what * the current state of the arbiter has been set to, and returning null from * the handler will keep the state unchanged.

var type:ArbiterType

The type of this Arbiter.

function new():Void

@private

function isCollisionArbiter():Bool

Equivalent to: arb.type == ArbiterType.COLLISION *

* *

returns

True if this Arbiter is a Collision type arbiter.

function isFluidArbiter():Bool

Equivalent to: arb.type == ArbiterType.FLUID *

* *

returns

True if this Arbiter is a Fluid type arbiter.

function isSensorArbiter():Bool

Equivalent to: arb.type == ArbiterType.SENSOR *

* *

returns

True if this Arbiter is a Sensor type arbiter.

function toString():String

@private

function totalImpulse(?body:Body = null, ?freshOnly:Bool = false):Vec3

Evaluate the total impulse this arbiter applied to the given body for * the previous space step including angular impulse based on things like * contact position, or centre of buoyancy etc. *

* If body is null, then the constraint space impulse will be returned instead * *

body

The body to query impulse for. (default null) *

freshOnly

If true, then only 'new' contact points will be queried for * collision type arbiters. This field has no use on fluid type * arbiters. (default false) *

returns

The total impulse applied to the given body, or the constraint space impule if the body is null.