Example #1
0
            /// <summary>
            /// Add an edge
            /// </summary>
            /// <param name="p0">start point</param>
            /// <param name="p1">end point</param>
            public void AddEdge(Vector3 p0, Vector3 p1)
            {
                var planeTriangleOffset = this.vertices2D.Count;

                this.vertices3D.Add(p0);
                this.vertices3D.Add(p1);
#if UNITY_EDITOR || UNITY_STANDALONE
                var p0Rotated = this.Rotation * p0;
                this.vertices2D.Add(new Vertex(p0Rotated.x, p0Rotated.y));

                var p1Rotated = this.Rotation * p1;
                this.vertices2D.Add(new Vertex(p1Rotated.x, p1Rotated.y));
#else
                var p0Rotated = Vector3.Transform(p0, this.Rotation);
                this.vertices2D.Add(new Vertex(p0Rotated.X, p0Rotated.Y));

                var p1Rotated = Vector3.Transform(p1, this.Rotation);
                this.vertices2D.Add(new Vertex(p1Rotated.X, p1Rotated.Y));
#endif

                this.edges.Add(planeTriangleOffset + 0);
                this.edges.Add(planeTriangleOffset + 1);
            }