VectorUtil::BarycentricCoords

Compute barycentric coordinates/weights of vPoint inside 2D 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 FVector2< RealType > & Point,
        const FVector2< RealType > & V0,
        const FVector2< RealType > & V1,
        const FVector2< RealType > & V2
    )
}

Remarks

Compute barycentric coordinates/weights of vPoint inside 2D triangle (V0,V1,V2). If point is 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