public class Mesh extends Geometry implements java.lang.Iterable<int[]>, IMeshConvertible
name, properties
Constructor and Description |
---|
Mesh()
Initializes a new instance of the
Mesh class. |
Mesh(java.lang.String name)
Initializes a new instance of the
Mesh class. |
Modifier and Type | Method and Description |
---|---|
void |
createPolygon(int[] indices)
Creates a new polygon with all vertices defined in
indices . |
void |
createPolygon(int[] indices,
int offset,
int length)
Creates a new polygon with all vertices defined in
indices . |
void |
createPolygon(int v1,
int v2,
int v3)
Create a polygon with 3 vertices(triangle)
|
void |
createPolygon(int v1,
int v2,
int v3,
int v4)
Create a polygon with 4 vertices(quad)
|
java.util.List<java.lang.Integer> |
getEdges()
Gets edges of the Mesh.
|
int |
getPolygonCount()
Gets the count of polygons
|
java.util.List<int[]> |
getPolygons()
Gets the polygons definition of the mesh
|
int |
getPolygonSize(int index)
Gets the vertex count of the specified polygon.
|
java.util.Iterator<int[]> |
iterator()
Gets the enumerator for each inner polygons.
|
Mesh |
toMesh()
Gets the Mesh instance from current entity.
|
addElement, createElement, createElement, createElementUV, createElementUV, getCastShadows, getControlPoints, getDeformers, getDeformers2, getElement, getReceiveShadows, getVertexElementOfUV, getVertexElements, getVisible, setCastShadows, setReceiveShadows, setVisible
getBoundingBox, getEntityRendererKey, getExcluded, getParentNode, getParentNodes, setExcluded, setParentNode
getScene
findProperty, getName, getProperties, getProperty, removeProperty, removeProperty, setName, setProperty
public Mesh()
Mesh
class.public Mesh(java.lang.String name)
Mesh
class.name
- Name.public java.util.List<java.lang.Integer> getEdges()
public int getPolygonSize(int index)
index
- Index.public int getPolygonCount()
public java.util.List<int[]> getPolygons()
public void createPolygon(int[] indices, int offset, int length)
indices
.
To create polygon vertex by vertex, please use PolygonBuilder
.indices
- Array of the polygon indices, each index points to a control point that forms the polygon.offset
- The offset of the first polygon indexlength
- The length of the indicespublic void createPolygon(int[] indices)
indices
.
To create polygon vertex by vertex, please use PolygonBuilder
.indices
- Array of the polygon indices, each index points to a control point that forms the polygon.public void createPolygon(int v1, int v2, int v3, int v4)
v1
- Index of the first vertexv2
- Index of the second vertexv3
- Index of the third vertexv4
- Index of the fourth vertexpublic void createPolygon(int v1, int v2, int v3)
v1
- Index of the first vertexv2
- Index of the second vertexv3
- Index of the third vertexpublic Mesh toMesh()
toMesh
in interface IMeshConvertible
public java.util.Iterator<int[]> iterator()
iterator
in interface java.lang.Iterable<int[]>