Navigation
API > API/Plugins > API/Plugins/GeometryScriptingCore > API/Plugins/GeometryScriptingCore/GeometryScript > API/Plugins/GeometryScriptingCore/GeometryScript/UGeometryScriptL-_17
References
| Module | GeometryScriptingCore |
| Header | /Engine/Plugins/Experimental/GeometryScripting/Source/GeometryScriptingCore/Public/GeometryScript/MeshQueryFunctions.h |
| Include | #include "GeometryScript/MeshQueryFunctions.h" |
| Source | /Engine/Plugins/Experimental/GeometryScripting/Source/GeometryScriptingCore/Private/MeshQueryFunctions.cpp |
static UDynamicMesh &42; ComputeTriangleBarycentricCoords
&40;
UDynamicMesh &42; TargetMesh,
int32 TriangleID,
bool & bIsValidTriangle,
FVector Point,
FVector & Vertex1,
FVector & Vertex2,
FVector & Vertex3,
FVector & BarycentricCoords
&41;
Remarks
Compute the barycentric coordinates (A,B,C) of the Point relative to the specified TriangleID of the TargetMesh. The properties of barycentric coordinates are such that A,B,C are all positive, A+B+C=1.0, and A*Vertex1 + B*Vertex2 + C*Vertex3 = Point. So, the barycentric coordinates can be used to smoothly interpolate/blend any other per-triangle-vertex quantities. The Point must lie in the plane of the Triangle, otherwise the coordinates are somewhat meaningless (but clamped to 0-1 range to avoid catastrophic errors) The Positions of the Triangle Vertices are also returned for convenience (similar to GetTrianglePositions)
Parameters
| Name | Description |
|---|---|
| bIsValidTriangle | will be returned true if TriangleID exists in TargetMesh, and otherwise will be returned false |