package mesh // Apply transforms every vertex by mat. Mirroring transforms (negative // determinant) flip triangle winding, so it is corrected here to keep // normals pointing the same way relative to the surface. func (m *Mesh) Apply(mat Mat4) { for i := range m.Verts { m.Verts[i] = mat.Apply(m.Verts[i]) } if mat.Det3() < 0 { m.FlipWinding() } } // ApplyAll transforms a set of meshes. func ApplyAll(meshes []*Mesh, mat Mat4) { for _, m := range meshes { m.Apply(mat) } }