Table of Contents

Struct CollisionManifold

Namespace
Jitter2.Collision
Assembly
Jitter2.dll

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

int

ManifoldA

Gets a span of contact points on shape A. Valid indices are [0, Count).

public Span<JVector> ManifoldA { get; }

Property Value

Span<JVector>

ManifoldB

Gets a span of contact points on shape B. Valid indices are [0, Count).

public Span<JVector> ManifoldB { get; }

Property Value

Span<JVector>

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

shapeA Ta

The first shape.

shapeB Tb

The second shape.

quaternionA JQuaternion

Orientation of shape A.

quaternionB JQuaternion

Orientation of shape B.

positionA JVector

Position of shape A.

positionB JVector

Position of shape B.

pA JVector

Initial contact point on shape A.

pB JVector

Initial contact point on shape B.

normal JVector

The collision normal (from B to A).

Type Parameters

Ta

The type of support shape A.

Tb

The 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

shapeA Ta

The first rigid body shape.

shapeB Tb

The second rigid body shape.

pA JVector

Initial contact point on shape A.

pB JVector

Initial contact point on shape B.

normal JVector

The collision normal (from B to A).

Type Parameters

Ta

The type of shape A.

Tb

The type of shape B.