Contact
Contact point for collision interactions
These objects are automatically reused and you should not keep references to them.
Instance Members
@private
Reference to the CollisionArbiter this contact belongs to
Penetration of bodies along normal for this contact.
This value may be negative and corresponds to the penetration (if at all)
of the contact point before positional integration and error resolvement
took place (correct at time of pre-listeners).
The world-space position of contact.
This value corresponds to the position
of the contact point before positional integration and error resolvement
took place (correct at time of pre-listeners).
Whether this contact is newly generated, or persistant from previous step.
The specific coeffecient of friction for this contact.
This value is equal either to the static or dynamic friction coeffecient of the arbiter
based on the relative velocity at contact point.
This value cannot be set, though you may implicitly set it exactly by modifying
the arbiter to have the same static and dynamic friction in the PreListener.
Evaluate normal reactive impulses for this contact for a given body.
If body argument is null, then 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
for this contact this will include angular impulses due to position of contact point and normal.
Name | Type | Default | Description |
---|---|---|---|
body |
nape.phys.Body | null |
The Body to query normal impulse for. (default null) |
Returns | Description |
---|---|
nape.geom.Vec3 | The impulse applied to the given body, considering normal reactive forces. |
Evaluate tangent impulses for this contact for a given body.
If body argument is null, then 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 position and normal.
These tangent impulses correspond to the forces of static and dynamic friction for this contact.
Name | Type | Default | Description |
---|---|---|---|
body |
nape.phys.Body | null |
The Body to query tangent impulse for. (default null) |
Returns | Description |
---|---|
nape.geom.Vec3 | The impulse applied to the given body, considering standard frictional forces. |
Evaluate rolling friction impulses for this contact for a given body.
If body argument is null, then the rolling impulse of this contact will be returned
instead of the angular impulse applied to the specific body as a result of the rolling impulse.
Name | Type | Default | Description |
---|---|---|---|
body |
nape.phys.Body | null |
The Body to query rolling impulse for. (default null) |
Returns | Description |
---|---|
Float | The angular impulse applied to the given body. |
Evaluate total contact impulse for a given body.
If body argument is null, then this will return the sum of normal and tangent contact impulse, and the contact
rolling impulse.
When body argument is non-null, this impulse will be the actual change in (mass weighted)
velocity that this contact 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) |
Returns | Description |
---|---|
nape.geom.Vec3 | The impulse applied to the given body |
@private
Returns |
---|
String |
@private
Private Members
Metadata
Name | Parameters |
---|---|
:final |
- |