|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.threed.jpct.Mesh
In a Mesh, jPCT stores the actual vertex and triangle information for an object. Mesh can't be instantiated directly. Meshes are shareable between objects. This means that more than one object may use the same instance of Mesh. This saves memory and is more cache-friendly. Meshes are also used for implementing keyframe animation.
Object3D
,
Object3D.getMesh()
,
Object3D.cloneObject()
,
Animation
,
Serialized FormField Summary | |
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. |
Method Summary | |
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 an object. |
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. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
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
Method Detail |
public boolean setVertexController(IVertexController controller, boolean modify)
controller
- the controllermodify
- the mode, i.e. if the modifications are cumulative or not
IVertexController.ALTER_SOURCE_MESH
,
IVertexController.PRESERVE_SOURCE_MESH
,
IVertexController
,
GenericVertexController
public void applyVertexController()
public void removeVertexController()
public void strip()
public void compress()
Loader.loadMD2(java.lang.String, float)
,
getVertexCount()
,
getUniqueVertexCount()
public Mesh cloneMesh(boolean compressed)
compressed
- indicates if compress() should by called after cloning the
mesh or not
COMPRESS
,
DONT_COMPRESS
,
compress()
public int getVertexCount()
public int getUniqueVertexCount()
public int getTriangleCount()
public float[] getBoundingBox()
public void setLocked(boolean locked)
locked
- should it be locked?public boolean isLocked()
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |