public final class PolygonBuilder
extends java.lang.Object
Mesh
Example:
Mesh mesh = new Mesh(); PolygonBuilder builder = new PolygonBuilder(mesh); builder.begin(); builder.addVertex(0); builder.addVertex(1); builder.addVertex(2); builder.end();Equals to :
Mesh mesh = new Mesh();
int[] indices = new int[] {0, 1, 2};
mesh.createPolygon(indices);
If all indices are ready to use, Mesh is preferred, otherwise PolygonBuilder would be a better choice.| Constructor and Description |
|---|
PolygonBuilder(Mesh mesh)
Initializes a new instance of the
PolygonBuilder class. |
| Modifier and Type | Method and Description |
|---|---|
void |
addVertex(int index)
Adds a vertex index to the polygon
|
void |
begin()
Begins to add a new polygon
|
void |
end()
Finishes the polygon creation
|
public PolygonBuilder(Mesh mesh)
PolygonBuilder class.mesh - On which mesh to build polygon.