FMath::ClosestPointOnTriangleToPoint

Returns closest point on a triangle to a point.

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 FVector ClosestPointOnTriangleToPoint
(
    const FVector & Point,
    const FVector & A,
    const FVector & B,
    const FVector & C
)

Remarks

Returns closest point on a triangle to a point. The idea is to identify the halfplanes that the point is in relative to each triangle segment "plane"

Returns

Point on triangle ABC closest to given point

Parameters

Parameter

Description

Point

point to check distance for

A, B, C

counter clockwise ordering of points defining a triangle

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