VectorUtil::BarycentricCoords

Compute barycentric coordinates/weights of vPoint inside 3D triangle (V0,V1,V2).

Windows
MacOS
Linux

References

Module

GeometricObjects

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/GeometricObjects/Public/VectorUtil.h

Include

#include "VectorUtil.h"

Syntax

namespace VectorUtil
{
    template<typename RealType>
    FVector3< RealType > VectorUtil::BarycentricCoords
    (
        const FVector3< RealType > & Point,
        const FVector3< RealType > & V0,
        const FVector3< RealType > & V1,
        const FVector3< RealType > & V2
    )
}

Remarks

Compute barycentric coordinates/weights of vPoint inside 3D triangle (V0,V1,V2). If point is in triangle plane and inside triangle, coords will be positive and sum to 1. ie if result is a, then vPoint = a.x*V0 + a.y*V1 + a.z*V2. TODO: make robust to degenerate triangles?

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