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); }
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; }
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; }