Arbiter

nape.dynamics.Arbiter (Class) → CollisionArbiter, FluidArbiter

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 Members

@private


nape
isSleeping: Bool

Flag representing arbiter sleep state.

When true, this arbiter is sleeping.


nape
type: ArbiterType

The type of this Arbiter.


nape
collisionArbiter: Null<CollisionArbiter>

Fast equivalent to casting this object to a CollisionArbiter.

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


nape
fluidArbiter: Null<FluidArbiter>

Fast equivalent to casting this object to a FluidArbiter.

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


nape
shape1: nape.shape.Shape

The first shape in Arbiter interaction.

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


nape
shape2: nape.shape.Shape

The second shape in Arbiter interaction.

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


nape
body1: nape.phys.Body

The first body in Arbiter interaction.

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


nape
body2: nape.phys.Body

The second body in Arbiter interaction.

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


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.


nape
isCollisionArbiter(): Bool

Equivalent to: arb.type == ArbiterType.COLLISION

Returns Description
Bool True if this Arbiter is a Collision type arbiter.

nape
isFluidArbiter(): Bool

Equivalent to: arb.type == ArbiterType.FLUID

Returns Description
Bool True if this Arbiter is a Fluid type arbiter.

nape
isSensorArbiter(): Bool

Equivalent to: arb.type == ArbiterType.SENSOR

Returns Description
Bool True if this Arbiter is a Sensor type arbiter.

nape
totalImpulse(?body: nape.phys.Body = null, ?freshOnly: Bool = false): nape.geom.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

Name Type Default Description
body nape.phys.Body null The body to query impulse for. (default null)
freshOnly Bool false 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 Description
nape.geom.Vec3 The total impulse applied to the given body, or the constraint space impule if the body is null.

nape
toString(): String

@private

Returns
String

nape
new(): Void

@private

Private Members