Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/FMath
Description
Find closest points between 2 segments.
This is the safe version, and will check both segments' lengths. Use this if either (or both) of the segments lengths may be 0.
| Name | SegmentDistToSegmentSafe |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Math/UnrealMathUtility.h |
| Include Path | #include "Math/UnrealMathUtility.h" |
| Source | /Engine/Source/Runtime/Core/Private/Math/UnrealMath.cpp |
template<typename T>
static void SegmentDistToSegmentSafe
(
UE::Math::TVector < T > A1,
UE::Math::TVector < T > B1,
UE::Math::TVector < T > A2,
UE::Math::TVector < T > B2,
UE::Math::TVector < T > & OutP1,
UE::Math::TVector < T > & OutP2
)
Parameters
| Name | Remarks |
|---|---|
| (A1, B1) | defines the first segment. |
| (A2, B2) | defines the second segment. |
| OutP1 | Closest point on segment 1 to segment 2. |
| OutP2 | Closest point on segment 2 to segment 1. |