CollisionArbiter

Arbiternape.dynamics.CollisionArbiter (final class)

Arbiter sub type for collision interactions.

Instance Members

nape
contacts: ContactList

Set of contact points for the related pairs of shapes.


nape
normal: nape.geom.Vec2

Normal of contact for collision interaction.

This normal will always point from arbiter's shape1, towards shape2 and corresponds to the direction of the normal before positional integration and erorr resolvement took place (Correct at time of pre-listener).


nape
radius: Float

This radius property describes the sum of the circle's radii for the pair of shapes, with a Polygon having 0 radius. This value is used in positional iterations to resolve penetrations between the Shapes.


nape
referenceEdge1: Null<nape.shape.Edge>

The reference edge for the collision on the first Polygon If the first shape in Arbiter is a Circle this value is null.


nape
referenceEdge2: Null<nape.shape.Edge>

The reference edge for the collision on the second Polygon If the second shape in Arbiter is a Circle this value is null.


nape
elasticity: Float

Coeffecient of combined elasticity for collision interaction.

The value is computed as the average of the Shape Material's elasticities clamped to be in the range [0,1]

This value may be modified only during a PreListener, and once modified will no longer be under Nape's control. Values must be in the range 0 to 1.


nape
dynamicFriction: Float

Coeffecient of combined dynamic friction for collision interaction.

The value is computed as the square root of the product of the Shape Material's dynamicFriction coeffecients.

This value may be modified only during a PreListener, and once modified will no longer be under Nape's control. Values must not be negative.


nape
staticFriction: Float

Coeffecient of combined static friction for collision interaction.

The value is computed as the square root of the product of the Shape Material's staticFriction coeffecients.

This value may be modified only during a PreListener, and once modified will no longer be under Nape's control. Values must not be negative.


nape
rollingFriction: Float

Coeffecient of combined rolling friction for collision interaction.

The value is computed as the square root of the product of the Shape Material's rollingFriction coeffecients.

This value may be modified only during a PreListener, and once modified will no longer be under Nape's control. Values must not be negative.


nape
firstVertex(): Bool

In the case that we have a Circle-Polygon collision, then this function will return true, if the circle collided with the first vertex of edge.

If both firstVertex() and secondVertex() are false, it indicates the Circle collided with the edge.

Returns
Bool

nape
secondVertex(): Bool

Check if colliding Circle hit second vertex of reference edge.

In the case that we have a Circle-Polygon collision, then this function will return true, if the circle collided with the second vertex of edge.

If both firstVertex() and secondVertex() are false, it indicates the Circle collided with the edge.

Returns
Bool

nape
normalImpulse(?body: nape.phys.Body = null, ?freshOnly: Bool = false): nape.geom.Vec3

Evaluate normal reactive impulses for collision interaction for a given body.

If body argument is null, then the sum of the contact normal impulses will be returned instead with no angular impulse derivable, the direction of this impulse will be the direction of the normal.
If body argument is not null, then this will return the actual impulse applied to that specific body rather than simply the sum of contact normal impulses, this will include angular impulses due to positions of contact points and normal.

Name Type Default Description
body nape.phys.Body null The Body to query normal impulse for. (default null)
freshOnly Bool false If true, then only 'new' contact points will be considered in computation. (default false)
Returns Description
nape.geom.Vec3 The impulse applied to the given body, considering normal reactive forces.

nape
tangentImpulse(?body: nape.phys.Body = null, ?freshOnly: Bool = false): nape.geom.Vec3

Evaluate tangent impulses for collision interaction.

If body argument is null, then the sum of the contact friction impulses is returned with no angular impulse derivable, the direction of this impulse will be against the relative velocity of the first body against the second.
If the body argument is non-null, then the actual impulse applied to that body due to tangent frictino impulses will be returned, including angular effects due to contact positions and normal.

These tangent impulses correspond to the forces of static and dynamic friction.

Name Type Default Description
body nape.phys.Body null The Body to query tangent impulse for. (default null)
freshOnly Bool false If true, then only 'new' contact points will be considered in computation. (default false)
Returns Description
nape.geom.Vec3 The impulse applied to the given body, considering standard frictional forces.

nape
totalImpulse(?body: nape.phys.Body = null, ?freshOnly: Bool = false): nape.geom.Vec3

Evaluate total contact impulses for collision interaction.

If body argument is null, then this will return the sum of linear contact impulses, and the sum of contact rolling impulses.
When body argument is non-null, this impulse will be the actual change in (mass weighted) velocity that this collision caused to the Body in the previous time step.

Name Type Default Description
body nape.phys.Body null The Body to query total impulse for. (default null)
freshOnly Bool false If true, then only 'new' contact points will be considered in computation. (default false)
Returns Description
nape.geom.Vec3 The impulse applied to the given body

nape
rollingImpulse(?body: nape.phys.Body = null, ?freshOnly: Bool = false): Float

Evaluate rolling friction impulses for collision interaction.

If body argument is null, then the sum of the rolling impulses of each contact will be returned instead of the angular impulse applied to the specific body as a result of the rolling impulses.

Name Type Default Description
body nape.phys.Body null The Body to query rolling impulse for. (default null)
freshOnly Bool false If true, then only 'new' contact points will be considered in computation. (default false)
Returns Description
Float The angular impulse applied to the given body.

nape
new(): Void

@private

Private Members

Metadata

Name Parameters
:final -