Table of Contents

Struct SupportPrimitives.Cone

Namespace
Jitter2.Collision
Assembly
Jitter2.dll

Represents a cone as a lightweight support-mapped query primitive. The symmetry axis is the Y-axis. The cone is centered at its centroid: the base sits at Y = -height/4 and the apex at Y = 3*height/4.

public readonly struct SupportPrimitives.Cone : ISupportFeature, ISupportMappable
Implements
Inherited Members

Constructors

Cone(float, float)

Represents a cone as a lightweight support-mapped query primitive. The symmetry axis is the Y-axis. The cone is centered at its centroid: the base sits at Y = -height/4 and the apex at Y = 3*height/4.

public Cone(float radius, float height)

Parameters

radius float
height float

Methods

GetCenter(out JVector)

Returns a point inside the shape. It does not need to be the center of mass.

public void GetCenter(out JVector point)

Parameters

point JVector

An interior point in local space.

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

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

public 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.

SupportMap(in JVector, out JVector)

Computes the point on the shape that is furthest in the specified direction.

public void SupportMap(in JVector direction, out JVector result)

Parameters

direction JVector

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

result JVector

The point on the shape's surface furthest along direction.