Module |
|
Header |
/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/GJK.h |
Include |
#include "Chaos/GJK.h" |
namespace Chaos
{
template<typename T, typename TGeometryA, typename TGeometryB>
EGJKDistanceResult Chaos::GJKDistance
(
const TGeometryA & A,
const TGeometryB & B,
const TRigidTransform< T, 3 > & BToATM,
T & OutDistance,
TVector< T, 3 > & OutNearestA,
TVector< T, 3 > & OutNearestB,
TVector< T, 3 > & OutNormalA,
const T Epsilon,
const int32 MaxIts
)
}
Find the distance and nearest points on two convex geometries A and B. All calculations are performed in the local-space of object A, and the transform from B-space to A-space must be provided. For algorithm see "A Fast and Robust GJK Implementation for Collision Detection of Convex Objects", Gino Van Deb Bergen, 1999. @note This algorithm aborts if objects are overlapping and it does not initialize the out parameters.
EGJKDistanceResult - see comments on the enum
Parameter |
Description |
---|---|
A |
The first object. |
B |
The second object. |
BToATM |
A transform taking vectors in B-space to A-space |
B |
The second object. |
OutDistance |
if returns true, the minimum distance between A and B, otherwise not modified. |
OutNearestA |
if returns true, the near point on A in local-space, otherwise not modified. |
OutNearestB |
if returns true, the near point on B in local-space, otherwise not modified. |
Epsilon |
The algorithm terminates when the iterative distance reduction gets below this threshold. |
MaxIts |
A limit on the number of iterations. Results may be approximate if this is too low. |