public class BasicTriangulator extends java.lang.Object implements Triangulator
| Constructor and Description |
|---|
BasicTriangulator()
Create a new triangulator
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPolyPoint(float x,
float y)
Add a point describing the polygon to be triangulated
|
float[] |
getPolyPoint(int index)
Get the coordinates of the point at the specified index
|
int |
getPolyPointCount()
Get the number of points in the polygon
|
int |
getTriangleCount()
Get a count of the number of triangles produced
|
float[] |
getTrianglePoint(int tri,
int i)
Get a point on a specified generated triangle
|
void |
startHole()
Start a hole in the polygon
|
boolean |
triangulate()
Cause the triangulator to split the polygon
|
public void addPolyPoint(float x,
float y)
addPolyPoint in interface Triangulatorx - The x coordinate of the pointy - the y coordinate of the pointpublic int getPolyPointCount()
public float[] getPolyPoint(int index)
index - The index of the point to retrievepublic boolean triangulate()
triangulate in interface Triangulatorpublic int getTriangleCount()
getTriangleCount in interface Triangulatorpublic float[] getTrianglePoint(int tri,
int i)
getTrianglePoint in interface Triangulatortri - The index of the triangle to interegatei - The index of the point within the triangle to retrieve
(0 - 2)public void startHole()
TriangulatorstartHole in interface Triangulator