Class MinkowskiDifference
Provides methods for computing points on the Minkowski difference of two convex shapes.
public static class MinkowskiDifference
- Inheritance
-
MinkowskiDifference
- Inherited Members
Remarks
The Minkowski difference A - B is defined as the set of all points (a - b) where a is in A and b is in B. This is the fundamental construct used by GJK and EPA algorithms to detect collisions.
Methods
GetCenter<Ta, Tb>(in Ta, in Tb, in JQuaternion, in JVector, out Vertex)
Computes a point guaranteed to be inside the Minkowski difference.
public static void GetCenter<Ta, Tb>(in Ta supportA, in Tb supportB, in JQuaternion orientationB, in JVector positionB, out MinkowskiDifference.Vertex center) where Ta : ISupportMappable where Tb : ISupportMappable
Parameters
supportATaThe support function of shape A (at origin, not rotated).
supportBTbThe support function of shape B.
orientationBJQuaternionThe orientation of shape B.
positionBJVectorThe position of shape B.
centerMinkowskiDifference.VertexThe resulting vertex representing the center of the Minkowski difference.
Type Parameters
TaThe type of support shape A.
TbThe type of support shape B.
Support<Ta, Tb>(in Ta, in Tb, in JQuaternion, in JVector, in JVector, out Vertex)
Computes the support function S_{A-B}(d) = S_A(d) - S_B(-d) for the Minkowski difference.
public static void Support<Ta, Tb>(in Ta supportA, in Tb supportB, in JQuaternion orientationB, in JVector positionB, in JVector direction, out MinkowskiDifference.Vertex v) where Ta : ISupportMappable where Tb : ISupportMappable
Parameters
supportATaThe support function of shape A (at origin, not rotated).
supportBTbThe support function of shape B.
orientationBJQuaternionThe orientation of shape B.
positionBJVectorThe position of shape B.
directionJVectorThe search direction.
vMinkowskiDifference.VertexThe resulting vertex containing support points from both shapes.
Type Parameters
TaThe type of support shape A.
TbThe type of support shape B.