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.

Constructor

new()

@private

Variables

read onlybody1:Body

The first body in Arbiter interaction.

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

read onlybody2:Body

The second body in Arbiter interaction.

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

read onlycollisionArbiter:Null<CollisionArbiter>

Fast equivalent to casting this object to a CollisionArbiter.

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

read onlyfluidArbiter:Null<FluidArbiter>

Fast equivalent to casting this object to a FluidArbiter.

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

read onlyisSleeping:Bool

Flag representing arbiter sleep state.

When true, this arbiter is sleeping.

read onlyshape1:Shape

The first shape in Arbiter interaction.

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

read onlyshape2:Shape

The second shape in Arbiter interaction.

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

read onlystate: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.

read onlytype:ArbiterType

The type of this Arbiter.

@:value(null)zpp_inner:ZPP_Arbiter = null

@private

Methods

inlineisCollisionArbiter():Bool

Equivalent to: arb.type == ArbiterType.COLLISION

Returns:

True if this Arbiter is a Collision type arbiter.

inlineisFluidArbiter():Bool

Equivalent to: arb.type == ArbiterType.FLUID

Returns:

True if this Arbiter is a Fluid type arbiter.

inlineisSensorArbiter():Bool

Equivalent to: arb.type == ArbiterType.SENSOR

Returns:

True if this Arbiter is a Sensor type arbiter.

@:keeptoString():String

@private

@:value({ freshOnly : false, body : null })totalImpulse(?body:Body, 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

Parameters:

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.

Throws:

#

If body is non-null, but not related to this Arbiter.