예제 #1
0
        public static Triangle Triangulate(Triangle triangulator, Vector2f[] vertices)
        {
            int size = vertices.Length;

            for (int i = 0; i < size; i++)
            {
                triangulator.AddPolyPoint(vertices[i].x, vertices[i].y);
            }
            triangulator.Triangulate();
            return(triangulator);
        }
예제 #2
0
파일: Shape.cs 프로젝트: vb0067/LGame
        protected internal void CalculateTriangles()
        {
            if ((!trianglesDirty) && (triangle != null))
            {
                return;
            }
            if (points.Length >= 6)
            {
                triangle = new TriangleNeat();
                for (int i = 0; i < points.Length; i += 2)
                {
                    triangle.AddPolyPoint(points[i], points[i + 1]);
                }
                triangle.Triangulate();
            }

            trianglesDirty = false;
        }
예제 #3
0
        protected internal void CalculateTriangles()
        {
            if ((!trianglesDirty) && (triangle != null)) {
                return;
            }
            if (points.Length >= 6) {
                triangle = new TriangleNeat();
                for (int i = 0; i < points.Length; i += 2) {
                    triangle.AddPolyPoint(points[i], points[i + 1]);
                }
                triangle.Triangulate();
            }

            trianglesDirty = false;
        }
예제 #4
0
		public static Triangle Triangulate(Triangle triangulator,
				Vector2f[] vertices) {
			int size = vertices.Length;
			for (int i = 0; i < size; i++) {
				triangulator.AddPolyPoint(vertices[i].x, vertices[i].y);
			}
			triangulator.Triangulate();
			return triangulator;
		}