Fix various issues with Multi Blend 2D node

This commit is contained in:
Wojciech Figat
2021-12-09 17:09:31 +01:00
parent 2192852510
commit 2b1e5e4958
2 changed files with 14 additions and 4 deletions

View File

@@ -204,6 +204,18 @@ bool AnimGraphBase::onNodeLoaded(Node* n)
// Triangulate
Array<Delaunay2D::Triangle, FixedAllocation<ANIM_GRAPH_MULTI_BLEND_2D_MAX_TRIS>> triangles;
Delaunay2D::Triangulate(vertices, triangles);
if (triangles.Count() == 0)
{
switch (vertices.Count())
{
case 1:
triangles.Add(Delaunay2D::Triangle(0, 0, 0));
break;
case 2:
triangles.Add(Delaunay2D::Triangle(0, 1, 0));
break;
}
}
// Store triangles vertices indices (map the back to the anim node slots)
for (int32 i = 0; i < triangles.Count(); i++)