From da5d770474d2b4d4080142c06e57fb1bc95a017b Mon Sep 17 00:00:00 2001 From: JonnyOThan Date: Wed, 19 Apr 2023 20:12:22 -0400 Subject: [PATCH] fix mesh cutout transformations --- FreeIva_Unity/Assets/Scripts/MeshCutter2.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FreeIva_Unity/Assets/Scripts/MeshCutter2.cs b/FreeIva_Unity/Assets/Scripts/MeshCutter2.cs index 03cf1207..ceae7c14 100644 --- a/FreeIva_Unity/Assets/Scripts/MeshCutter2.cs +++ b/FreeIva_Unity/Assets/Scripts/MeshCutter2.cs @@ -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]); } } @@ -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);