FMath::ComputeBaryCentric2D

Computes the barycentric coordinates for a given point in a triangle

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

Remarks

Computes the barycentric coordinates for a given point in a triangle

Returns

Vector containing the three weights a,b,c such that Point = a*A + b*B + c*C or Point = A + b*(B-A) + c*(C-A) = (1-b-c)*A + b*B + c*C

Parameters

Parameter

Description

Point

point to convert to barycentric coordinates (in plane of ABC)

A, B, C

three non-collinear points defining a triangle in CCW

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