name, properties
Constructor and Description |
---|
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 pre-allocated vertices.
|
int |
getIndicesCount()
The count of indices in this
TriMesh |
int[] |
getIntIndices()
Convert the indices to 32bit integer array
|
short[] |
getShortIndices()
Convert the indices to 16bit integer array
|
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)
Deprecated.
|
void |
indicesToArray(short[][] result)
Deprecated.
|
java.util.Iterator<Vertex> |
iterator()
Get the enumerator to enumerate
Vertex |
void |
loadVerticesFromBytes(byte[] verticesInBytes)
Load vertices from bytes, the length of bytes must be an integer multiple of vertex size.
|
double |
readDouble(int idx,
VertexField field)
Read the double field
|
float |
readFloat(int idx,
VertexField field)
Read the float field
|
FVector2 |
readFVector2(int idx,
VertexField field)
Read the vector2 field
|
FVector3 |
readFVector3(int idx,
VertexField field)
Read the vector3 field
|
FVector4 |
readFVector4(int idx,
VertexField field)
Read the vector4 field
|
Vector2 |
readVector2(int idx,
VertexField field)
Read the vector2 field
|
Vector3 |
readVector3(int idx,
VertexField field)
Read the vector3 field
|
Vector4 |
readVector4(int idx,
VertexField field)
Read the vector4 field
|
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
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 declaration 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()
@Deprecated public void indicesToArray(short[][] result)
result
- public short[] getShortIndices()
public int[] getIntIndices()
@Deprecated 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.public void loadVerticesFromBytes(byte[] verticesInBytes)
verticesInBytes
- java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public Vector4 readVector4(int idx, VertexField field)
idx
- The index of vertex to readfield
- The field with a Vector4/FVector4 data typepublic FVector4 readFVector4(int idx, VertexField field)
idx
- The index of vertex to readfield
- The field with a Vector4/FVector4 data typepublic Vector3 readVector3(int idx, VertexField field)
idx
- The index of vertex to readfield
- The field with a Vector3/FVector3 data typepublic FVector3 readFVector3(int idx, VertexField field)
idx
- The index of vertex to readfield
- The field with a Vector3/FVector3 data typepublic Vector2 readVector2(int idx, VertexField field)
idx
- The index of vertex to readfield
- The field with a Vector2/FVector2 data typepublic FVector2 readFVector2(int idx, VertexField field)
idx
- The index of vertex to readfield
- The field with a Vector2/FVector2 data typepublic double readDouble(int idx, VertexField field)
idx
- The index of vertex to readfield
- The field with a float/double compatible data typepublic float readFloat(int idx, VertexField field)
idx
- The index of vertex to readfield
- The field with a float/double compatible data type