public class EarClippingTriangulator extends Object
If the polygon vertices are very large or very close together then GeometryUtils.isClockwise(float[], int, int)
may not
be able to properly assess the winding (because it uses floats). In that case the vertices should be adjusted, eg by finding
the smallest X and Y values and subtracting that from each vertex.
Constructor and Description |
---|
EarClippingTriangulator() |
Modifier and Type | Method and Description |
---|---|
ShortArray |
computeTriangles(float[] vertices) |
ShortArray |
computeTriangles(float[] vertices,
int offset,
int count)
Triangulates the given (convex or concave) simple polygon to a list of triangle vertices.
|
ShortArray |
computeTriangles(FloatArray vertices) |
public ShortArray computeTriangles(FloatArray vertices)
computeTriangles(float[], int, int)
public ShortArray computeTriangles(float[] vertices)
computeTriangles(float[], int, int)
public ShortArray computeTriangles(float[] vertices, int offset, int count)
vertices
- pairs describing vertices of the polygon, in either clockwise or counterclockwise order.Copyright © 2020. All rights reserved.