Arbiter
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
Flag representing arbiter sleep state.
When true, this arbiter is sleeping.
The type of this Arbiter.
Fast equivalent to casting this object to a CollisionArbiter.
This value is null when this arbiter is not a collision type.
Fast equivalent to casting this object to a FluidArbiter.
This value is null when this arbiter is not a fluid type.
The first shape in Arbiter interaction.
It will always be the case that arb.shape1.id < arb.shape2.id
The second shape in Arbiter interaction.
It will always be the case that arb.shape1.id < arb.shape2.id
The first body in Arbiter interaction.
It will always be the case that arb.shape1.body == arb.body1
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.
Equivalent to: arb.type == ArbiterType.COLLISION
Returns | Description |
---|---|
Bool | True if this Arbiter is a Collision type arbiter. |
Equivalent to: arb.type == ArbiterType.FLUID
Returns | Description |
---|---|
Bool | True if this Arbiter is a Fluid type arbiter. |
Equivalent to: arb.type == ArbiterType.SENSOR
Returns | Description |
---|---|
Bool | True if this Arbiter is a Sensor type arbiter. |
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. |
@private
Returns |
---|
String |
@private