Struct VertexSupportMap
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
verticesIEnumerable<JVector>The vertices defining the convex hull.
Exceptions
- ArgumentException
Thrown when
verticesis empty.
VertexSupportMap(ReadOnlySpan<JVector>)
Initializes a new support map from a set of vertices.
public VertexSupportMap(ReadOnlySpan<JVector> vertices)
Parameters
verticesReadOnlySpan<JVector>The vertices defining the convex hull.
Exceptions
- ArgumentException
Thrown when
verticesis 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
otherVertexSupportMapAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override readonly bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
pointJVectorAn 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
directionJVectorThe direction in local space. Does not need to be normalized.
tolerancefloatThe sine of the angle within which directions share the feature.
verticesSpan<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
directionJVectorThe search direction in local space. Does not need to be normalized.
resultJVectorThe point on the shape's surface furthest along
direction.
Operators
operator ==(VertexSupportMap, VertexSupportMap)
public static bool operator ==(VertexSupportMap left, VertexSupportMap right)
Parameters
leftVertexSupportMaprightVertexSupportMap
Returns
operator !=(VertexSupportMap, VertexSupportMap)
public static bool operator !=(VertexSupportMap left, VertexSupportMap right)
Parameters
leftVertexSupportMaprightVertexSupportMap