Table of Contents

Class MinkowskiDifference

Namespace
Jitter2.Collision
Assembly
Jitter2.dll

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

supportA Ta

The support function of shape A (at origin, not rotated).

supportB Tb

The support function of shape B.

orientationB JQuaternion

The orientation of shape B.

positionB JVector

The position of shape B.

center MinkowskiDifference.Vertex

The resulting vertex representing the center of the Minkowski difference.

Type Parameters

Ta

The type of support shape A.

Tb

The 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

supportA Ta

The support function of shape A (at origin, not rotated).

supportB Tb

The support function of shape B.

orientationB JQuaternion

The orientation of shape B.

positionB JVector

The position of shape B.

direction JVector

The search direction.

v MinkowskiDifference.Vertex

The resulting vertex containing support points from both shapes.

Type Parameters

Ta

The type of support shape A.

Tb

The type of support shape B.