FMath::SegmentDistToSegmentSafe

Find closest points between 2 segments.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Math/UnrealMathUtility.h

Include

#include "Math/UnrealMathUtility.h"

Source

/Engine/Source/Runtime/Core/Private/Math/UnrealMath.cpp

Syntax

static void SegmentDistToSegmentSafe
(
    FVector A1,
    FVector B1,
    FVector A2,
    FVector B2,
    FVector & OutP1,
    FVector & OutP2
)

Remarks

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.

Parameters

Parameter

Description

(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.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss