public ProceduralShape BakeShape() { ProceduralShape shape = new ProceduralShape(); shape.Vertices = vertices.ToArray(); shape.Indices = indices.ToArray(); shape.PrimitiveCount = primCount; shape.FlipNormals(); return(shape); }
public static ProceduralShape Mirror(ProceduralShape shapeToMirror, Plane mirrorAxis) { ProceduralShape newShape = shapeToMirror.Clone(); for (int i = 0; i < shapeToMirror.Vertices.Length; i++) { //newShape.Vertices[i].Normal = -shapeToMirror.Vertices[i].Normal; newShape.Vertices[i].Position = MonoMathHelper.MirrorInPlane(shapeToMirror.Vertices[i].Position, mirrorAxis); } newShape.ReverseIndices(); newShape.FlipNormals(); return(newShape); }