public final class Mesh
extends java.lang.Object
implements java.io.Serializable
Object3D
,
Object3D.getMesh()
,
Object3D.cloneObject()
,
Animation
,
Serialized FormModifier and Type | Field and Description |
---|---|
static boolean |
COMPRESS
The mesh will be compressed
|
static boolean |
DONT_COMPRESS
The mesh won't be compressed
|
static int |
SERIALIZE_ALL
normal serialization (default)
|
static int |
SERIALIZE_LOW_PRECISION
float data will be saved as 16 bit precision. on the average ~0.3 percent
of precision will be lost
|
static int |
SERIALIZE_VERTICES_ONLY
Normals will not be serialized and will have to be recalculated during
deserialization.
|
Modifier and Type | Method and Description |
---|---|
void |
addVertexAttributes(VertexAttributes attrs)
Adds some vertex attributes to this mesh.
|
void |
applyVertexController()
Executes the apply() method of the assigned VertexController and updates
the mesh's vertex data with the new values generated by the controller.
|
Mesh |
cloneMesh(boolean compressed)
Returns a copy of this mesh.
|
void |
compress()
Compresses the mesh by removing unused information from it.
|
float[] |
getBoundingBox()
Returns the bounding box in object space of this mesh in a float array.
|
int |
getTriangleCount()
The number of triangles for this mesh.
|
int |
getUniqueVertexCount()
Returns the number of unique vertices.
|
VertexAttributes[] |
getVertexAttributes()
Returns an array with all the currently assigned vertex attributes.
|
int |
getVertexCount()
Returns the number of vertices this mesh consists of
|
boolean |
isLocked()
Returns if this mesh has been locked or not!
|
void |
removeVertexController()
Removes the VertexController from this mesh.
|
void |
setLocked(boolean locked)
Locks a mesh.
|
void |
setSerializeMethod(int method)
Sets the serialization method.
|
boolean |
setVertexController(IVertexController controller,
boolean modify)
Sets the VertexController for this Mesh.
|
void |
strip()
Removes triangle information from this mesh.
|
public static final boolean COMPRESS
public static final boolean DONT_COMPRESS
public static final int SERIALIZE_ALL
public static final int SERIALIZE_VERTICES_ONLY
public static final int SERIALIZE_LOW_PRECISION
public boolean setVertexController(IVertexController controller, boolean modify)
controller
- the controllermodify
- the mode, i.e. if the modifications are cumulative or notIVertexController.ALTER_SOURCE_MESH
,
IVertexController.PRESERVE_SOURCE_MESH
,
IVertexController
,
GenericVertexController
public void applyVertexController()
public void removeVertexController()
public void strip()
public void setLocked(boolean locked)
locked
- should it be locked?public boolean isLocked()
public void compress()
getVertexCount()
,
getUniqueVertexCount()
public Mesh cloneMesh(boolean compressed)
compressed
- indicates if compress() should by called after cloning the
mesh or notCOMPRESS
,
DONT_COMPRESS
,
compress()
public int getVertexCount()
public int getUniqueVertexCount()
public int getTriangleCount()
public float[] getBoundingBox()
public void addVertexAttributes(VertexAttributes attrs)
attrs
- the new attributespublic VertexAttributes[] getVertexAttributes()
public void setSerializeMethod(int method)
method
- Either SERIALIZE_ALL, DONT_SERIALIZE_NORMALS or
SERIALIZE_LOW_PRECISION. Methods can be combined by using the
or-operator.