コード例 #1
0
ファイル: ProceduralShapes.cs プロジェクト: veyvin/SystemWars
        public ProceduralShape BakeShape()
        {
            ProceduralShape shape = new ProceduralShape();

            shape.Vertices       = vertices.ToArray();
            shape.Indices        = indices.ToArray();
            shape.PrimitiveCount = primCount;

            shape.FlipNormals();

            return(shape);
        }
コード例 #2
0
ファイル: ProceduralShapes.cs プロジェクト: veyvin/SystemWars
        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);
        }