PhysicsShape.ContactManifold.ManifoldPoint
Contains all the detail related to the geometry and dynamics of the contact. You may use the _totalNormalImpulse to determine if there was an interaction during the time step.
Read time 2 minutesLast updated 12 days ago
Definition
- Type: Struct
- Namespace: Unity.U2D.Physics
- Assembly: UnityEngine.PhysicsCore2DModule
- Implements: IEquatable<ManifoldPoint>
public struct PhysicsShape.ContactManifold.ManifoldPoint : IEquatable<PhysicsShape.ContactManifold.ManifoldPoint>
Properties
Property | Description |
|---|---|
| anchorA | Location of the contact point relative to shapeA's origin in world space. During a pre-contact callback this may be modified, and the solver uses the new value this step. |
| anchorB | Location of the contact point relative to shapeB's origin in world space. During a pre-contact callback this may be modified, and the solver uses the new value this step. |
| id | Uniquely identifies a contact point between two shapes. This should not be confused with PhysicsShape.ContactId. |
| normalImpulse | The impulse along the manifold normal vector. During a pre-contact callback this may be modified to seed the solver's warm start for this step. |
| normalVelocity | Relative normal velocity pre-solve. Used for hit events. If the normal impulse is zero then there was no hit. Negative means shapes are approaching. |
| persisted | Did this contact point exist the previous step? |
| pointA | The contact point on the first shape's surface, in world space. Sampled when the contact is updated, so it lags behind when contact recycling is used. |
| pointB | The contact point on the second shape's surface, in world space. Sampled when the contact is updated, so it lags behind when contact recycling is used. |
| separation | The separation of the contact point, negative if penetrating. During a pre-contact callback this may be modified, and the solver uses the new value this step. |
| speculative | Is the contact point speculative i.e. not currently interacting? |
| tangentImpulse | The friction impulse. During a pre-contact callback this may be modified to seed the solver's warm start for this step. |
| totalNormalImpulse | The total normal impulse applied across sub-stepping and restitution. This includes the warm starting impulse, the sub-step delta impulse, and the restitution impulse. This can be used to identify speculative contact points that had an interaction during the simulation step. |