Table of Contents

Interface ISupportFeature

Namespace
Jitter2.Collision
Assembly
Jitter2.dll

Extension of ISupportMappable for shapes that report their whole outermost feature in a given direction: a point, a segment or a convex polygon.

public interface ISupportFeature : ISupportMappable
Inherited Members

Remarks

CollisionManifold uses the feature to place contact points. Every Shape implements it by sampling its support mapping with SupportFeatureSampler; shapes with known geometry override it, which is faster and exact. Other types implementing ISupportMappable can forward to Sample<T>(T, in JVector, float, Span<JVector>).

The feature must be the support set of the shape for all directions within tolerance (the sine of an angle) of the given direction: a face whose normal is that close to the direction is reported as the face, an edge as the edge, and a curved side as its resting point or line. Every reported vertex must lie on the shape's surface.

Fields

MaxVertices

The largest number of vertices a feature may have.

public const int MaxVertices = 8

Field Value

int

Methods

SupportFeature(in JVector, float, Span<JVector>)

Writes the outermost feature of the shape in the given direction.

int SupportFeature(in JVector direction, float tolerance, Span<JVector> vertices)

Parameters

direction JVector

The direction in local space. Does not need to be normalized.

tolerance float

The sine of the angle within which directions share the feature.

vertices Span<JVector>

Receives the vertices in local space: one for a point, two for a segment, three or more for a convex polygon in winding order. At least MaxVertices entries long.

Returns

int

The number of vertices written, at least one.