Struct CollisionManifold
Represents a contact manifold between two convex shapes, storing up to six contact points.
public struct CollisionManifold
- Inherited Members
Remarks
The manifold is constructed by projecting support points along perturbed normals in a hexagonal pattern around the collision normal, then clipping to find the contact region.
Properties
Count
Gets the number of contact points in the manifold.
public readonly int Count { get; }
Property Value
ManifoldA
Gets a span of contact points on shape A. Valid indices are [0, Count).
public Span<JVector> ManifoldA { get; }
Property Value
ManifoldB
Gets a span of contact points on shape B. Valid indices are [0, Count).
public Span<JVector> ManifoldB { get; }
Property Value
Methods
BuildManifold<Ta, Tb>(Ta, Tb, in JQuaternion, in JQuaternion, in JVector, in JVector, in JVector, in JVector, in JVector)
Builds the contact manifold between two shapes given their transforms and initial contact.
public void BuildManifold<Ta, Tb>(Ta shapeA, Tb shapeB, in JQuaternion quaternionA, in JQuaternion quaternionB, in JVector positionA, in JVector positionB, in JVector pA, in JVector pB, in JVector normal) where Ta : ISupportMappable where Tb : ISupportMappable
Parameters
shapeATaThe first shape.
shapeBTbThe second shape.
quaternionAJQuaternionOrientation of shape A.
quaternionBJQuaternionOrientation of shape B.
positionAJVectorPosition of shape A.
positionBJVectorPosition of shape B.
pAJVectorInitial contact point on shape A.
pBJVectorInitial contact point on shape B.
normalJVectorThe collision normal (from B to A).
Type Parameters
TaThe type of support shape A.
TbThe type of support shape B.
BuildManifold<Ta, Tb>(Ta, Tb, in JVector, in JVector, in JVector)
Builds the contact manifold between two rigid body shapes using their current transforms.
public void BuildManifold<Ta, Tb>(Ta shapeA, Tb shapeB, in JVector pA, in JVector pB, in JVector normal) where Ta : RigidBodyShape where Tb : RigidBodyShape
Parameters
shapeATaThe first rigid body shape.
shapeBTbThe second rigid body shape.
pAJVectorInitial contact point on shape A.
pBJVectorInitial contact point on shape B.
normalJVectorThe collision normal (from B to A).
Type Parameters
TaThe type of shape A.
TbThe type of shape B.