name, properties
Modifier | Constructor and Description |
---|---|
protected |
TriMesh(java.lang.String name)
Initialize a
TriMesh |
|
TriMesh(java.lang.String name,
VertexDeclaration declaration)
Initialize an instance of
TriMesh |
Modifier and Type | Method and Description |
---|---|
Vertex |
beginVertex()
Begin adding vertex
|
static TriMesh |
copyFrom(TriMesh input,
VertexDeclaration vd)
Copy the
TriMesh from input with new vertex layout |
void |
endVertex()
End adding vertex
|
static TriMesh |
fromMesh(Mesh mesh)
Create a TriMesh from given mesh object, the vertex declaration are based on the input mesh's structure.
|
static TriMesh |
fromMesh(Mesh mesh,
boolean useFloat)
Create a TriMesh from given mesh object, the vertex declaration are based on the input mesh's structure.
|
static TriMesh |
fromMesh(VertexDeclaration declaration,
Mesh mesh)
Create a TriMesh from given mesh object with given vertex layout.
|
static TriMesh |
fromRawData(VertexDeclaration vd,
byte[] vertices,
int[] indices,
boolean generateVertexMapping)
Create TriMesh from raw data
|
int |
getCapacity()
The capacity of preallocated vertices.
|
int |
getIndicesCount()
The count of indices in this
TriMesh |
int |
getUnmergedVerticesCount()
The count of unmerged vertices that passed in by
beginVertex() and endVertex() . |
VertexDeclaration |
getVertexDeclaration()
The vertex layout of the
TriMesh . |
int |
getVerticesCount()
The count of vertices in this
TriMesh |
int |
getVerticesSizeInBytes()
The total size of all vertices in bytes
|
void |
indicesToArray(int[][] result)
Convert the indices to 32bit integer array
|
void |
indicesToArray(short[][] result)
Convert the indices to 16bit integer array
|
java.util.Iterator<Vertex> |
iterator()
Get the enumerator to enumerate
Vertex |
java.lang.String |
toString()
Gets the string representation of
TriMesh |
byte[] |
verticesToArray()
Convert the vertices data to byte array
|
void |
write16bIndicesTo(com.aspose.threed.Stream stream)
Write the indices data as 16bit integer to the stream
|
void |
write32bIndicesTo(com.aspose.threed.Stream stream)
Write the indices data as 32bit integer to the stream
|
void |
writeVerticesTo(com.aspose.threed.Stream stream)
Write vertices data to the specified stream
|
getBoundingBox, getEntityRendererKey, getExcluded, getParentNode, getParentNodes, setExcluded, setParentNode
getScene
findProperty, getName, getProperties, getProperty, removeProperty, removeProperty, setName, setProperty
protected TriMesh(java.lang.String name)
TriMesh
public TriMesh(java.lang.String name, VertexDeclaration declaration)
TriMesh
name
- The name of this TriMeshdeclaration
- The vertex's declarationpublic VertexDeclaration getVertexDeclaration()
TriMesh
.public int getVerticesCount()
TriMesh
public int getIndicesCount()
TriMesh
public int getUnmergedVerticesCount()
beginVertex()
and endVertex()
.public int getCapacity()
public int getVerticesSizeInBytes()
public static TriMesh fromMesh(VertexDeclaration declaration, Mesh mesh)
declaration
- mesh
- public static TriMesh copyFrom(TriMesh input, VertexDeclaration vd)
TriMesh
from input with new vertex layoutinput
- The input TriMesh for copyingvd
- The new vertex delcaration of the output TriMeshpublic static TriMesh fromMesh(Mesh mesh, boolean useFloat)
public static TriMesh fromMesh(Mesh mesh)
public Vertex beginVertex()
Vertex
public void endVertex()
public void writeVerticesTo(com.aspose.threed.Stream stream) throws java.io.IOException
stream
- The stream that the vertices data will be written tojava.io.IOException
public void write16bIndicesTo(com.aspose.threed.Stream stream) throws java.io.IOException
stream
- java.io.IOException
public void write32bIndicesTo(com.aspose.threed.Stream stream) throws java.io.IOException
stream
- java.io.IOException
public byte[] verticesToArray()
public void indicesToArray(short[][] result)
result
- public void indicesToArray(int[][] result)
result
- public java.lang.String toString()
TriMesh
toString
in class java.lang.Object
public static TriMesh fromRawData(VertexDeclaration vd, byte[] vertices, int[] indices, boolean generateVertexMapping)
vd
- Vertex declaration, must contains at least one field.vertices
- The input vertex data, the minimum length of the vertices must be greater or equal to vertex declaration's sizeindices
- The triangle indicesgenerateVertexMapping
- Generate Vertex
for each vertex, which is not necessary for just serialization/deserialization.TriMesh
instance that encapsulated the input byte array.