Table of Contents

Struct VertexSupportMap

Namespace
Jitter2.Collision.Shapes
Assembly
Jitter2.dll

Describes the convex hull of a set of vertices through its support points.

public struct VertexSupportMap : ISupportFeature, ISupportMappable, IEquatable<VertexSupportMap>
Implements
Inherited Members

Constructors

VertexSupportMap(IEnumerable<JVector>)

Initializes a new support map from a set of vertices.

public VertexSupportMap(IEnumerable<JVector> vertices)

Parameters

vertices IEnumerable<JVector>

The vertices defining the convex hull.

Exceptions

ArgumentException

Thrown when vertices is empty.

VertexSupportMap(ReadOnlySpan<JVector>)

Initializes a new support map from a set of vertices.

public VertexSupportMap(ReadOnlySpan<JVector> vertices)

Parameters

vertices ReadOnlySpan<JVector>

The vertices defining the convex hull.

Exceptions

ArgumentException

Thrown when vertices is empty.

Methods

Equals(VertexSupportMap)

Indicates whether the current object is equal to another object of the same type.

public readonly bool Equals(VertexSupportMap other)

Parameters

other VertexSupportMap

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override readonly bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetCenter(out JVector)

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

public readonly void GetCenter(out JVector point)

Parameters

point JVector

An interior point in local space.

GetHashCode()

Returns the hash code for this instance.

public override readonly int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

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

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

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

Operators

operator ==(VertexSupportMap, VertexSupportMap)

public static bool operator ==(VertexSupportMap left, VertexSupportMap right)

Parameters

left VertexSupportMap
right VertexSupportMap

Returns

bool

operator !=(VertexSupportMap, VertexSupportMap)

public static bool operator !=(VertexSupportMap left, VertexSupportMap right)

Parameters

left VertexSupportMap
right VertexSupportMap

Returns

bool