Navigation
API > API/Runtime > API/Runtime/Chaos
Description
Can be used to generate the initial support direction for use with GJKDistance. Returns a point on the Minkowski Sum surface opposite to the direction of the supplied Direction. This is usually a good guess for the initial direction but it calls SupportCore on both shapes which in O(N) in the number of vertices, and there are often faster alternatives if you know the type of shapes you are dealing with (e.g., return the vectors between the centers of the two convex shapes).
If you do roll your own function, make sure that the vector returned is in or on the Minkowski sum (and don't just use a unit vector along some direction for example) or GJKDistance may early-exit with an inaccurate result.
| Name | Chaos::GJKDistanceInitialVFromDirection |
| Type | function |
| Header File | /Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/GJK.h |
| Include Path | #include "Chaos/GJK.h" |
namespace Chaos
{
template<typename T, typename TGeometryA, typename TGeometryB>
TVec3< T > Chaos::GJKDistanceInitialVFromDirection
(
const TGeometryA & A,
const TGeometryB & B,
TVec3< T > Direction
)
}