Skip to content

Commit

Permalink
fix mesh cutout transformations
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyOThan committed Apr 20, 2023
1 parent 75988c9 commit da5d770
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions FreeIva_Unity/Assets/Scripts/MeshCutter2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public MeshCutter2(MeshFilter target)
var localToWorld = m_meshTransform.localToWorldMatrix;
for (int i = 0; i < m_vertices.Count; i++)
{
m_vertices[i] = localToWorld * m_vertices[i];
m_vertices[i] = localToWorld.MultiplyPoint(m_vertices[i]);
}
}

Expand All @@ -50,7 +50,7 @@ public void FinalizeMesh()
var worldToLocal = m_meshTransform.worldToLocalMatrix;
for (int i = 0; i < m_vertices.Count; ++i)
{
m_vertices[i] = worldToLocal * m_vertices[i];
m_vertices[i] = worldToLocal.MultiplyPoint(m_vertices[i]);
}

m_mesh.SetVertices(m_vertices);
Expand Down

0 comments on commit da5d770

Please sign in to comment.