Struct ContactData.Contact
Represents a single contact point between two rigid bodies.
public struct ContactData.Contact
- Inherited Members
Remarks
This structure is layout-sensitive and stored in unmanaged memory as part of a ContactData. It contains geometric information (normal, tangents, positions) and solver state (accumulated impulses, bias).
Do not cache or store references to this structure across simulation steps.
Fields
Bias
Velocity bias for restitution or predicted separation.
public float Bias
Field Value
Depth
Separation of the two anchor points along the manifold normal when the offsets were fixed; positive when the bodies overlap. The offset from the second body is derived from it.
public float Depth
Field Value
Flag
Current contact state flags.
public ContactData.Contact.Flags Flag
Field Value
PenaltyBias
Position-correction bias computed from penetration depth.
public float PenaltyBias
Field Value
RelativePosition1
World-space contact offset from the first body's center of mass used to apply impulses. Held fixed during the substeps of a full simulation step.
[ReferenceFrame(ReferenceFrame.World)]
public JVector RelativePosition1
Field Value
Properties
Impulse
Gets the accumulated normal solver impulse from the last solved substep.
public readonly float Impulse { get; }
Property Value
TangentImpulse1
Gets the accumulated solver impulse in the first tangent direction from the last solved substep.
public readonly float TangentImpulse1 { get; }
Property Value
TangentImpulse2
Gets the accumulated solver impulse in the second tangent direction from the last solved substep.
public readonly float TangentImpulse2 { get; }
Property Value
Methods
GetRelativePosition2(in ContactData)
World-space contact offset from the second body's center of mass used to apply impulses. It is derived from RelativePosition1, the manifold's CenterDelta and Depth along the manifold normal, and held fixed during the substeps of a full simulation step.
public readonly JVector GetRelativePosition2(in ContactData manifold)
Parameters
manifoldContactDataThe manifold this point belongs to.
Returns
Initialize(ContactData*, in JVector, in JVector, in JVector, bool)
public void Initialize(ContactData* cd, in JVector point1, in JVector point2, in JVector n, bool newContact)
Parameters
cdContactData*point1JVectorpoint2JVectornJVectornewContactbool
Iterate(ContactData*, bool)
public void Iterate(ContactData* cd, bool applyBias)
Parameters
cdContactData*applyBiasbool
PrepareForIteration(ContactData*, in TimeStep)
public void PrepareForIteration(ContactData* cd, in TimeStep timeStep)
Parameters
cdContactData*timeStepTimeStep
UpdatePosition(ContactData*)
public bool UpdatePosition(ContactData* cd)
Parameters
cdContactData*