FMath::PointDistToSegment

Returns distance from a point to the closest point on a segment.

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 float PointDistToSegment
(
    const FVector & Point,
    const FVector & StartPoint,
    const FVector & EndPoint
)

Remarks

Returns distance from a point to the closest point on a segment.

Returns

closest distance from Point to segment defined by (StartPoint, EndPoint).

Parameters

Parameter

Description

Point

point to check distance for

StartPoint

StartPoint of segment

EndPoint

EndPoint of segment

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