|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This interface defines a VertexController. A VertexController is a way to
manipulate vertices of already constructed Object3Ds. It can be added to a
Mesh to alter the mesh's vertices according to the controller's
implementation.
A VertexController is the only way in jPCT to gain access to vertex data of
objects. This concept, which may look a bit too complicated for the task at
first glance, is required to keep jPCT's internal vertex representations
encapsulated while giving the possibility to modify vertices in a fast,
simple and convinient way.
Usually, there's no need to implement this interface directly but to extend
the abstract, generic implementation jPCT provides.
GenericVertexController,
Mesh.setVertexController(com.threed.jpct.IVertexController,
boolean),
FrameBuffer.getLock()| Field Summary | |
static boolean |
ALTER_SOURCE_MESH
The VertexController will modify the source data when applied, i.e. |
static boolean |
PRESERVE_SOURCE_MESH
The VertexController will start with a "fresh" source mesh everytime it's being applied. |
| Method Summary | |
void |
apply()
Applies the controller's modifications to the mesh. |
void |
cleanup()
Like setup(), this method can be overwritten to do some additional work...this time when the controller will be removed. |
void |
destroy()
This method will be called when the controller will be removed from a Mesh. |
SimpleVector[] |
getDestinationMesh()
Returns the destination mesh's vertex data. |
SimpleVector[] |
getDestinationNormals()
Returns the destination mesh's normals. |
int |
getMeshSize()
Returns the size of the mesh. |
int[] |
getPolygonIDs(int vertex,
int max)
Returns the polygon IDs of the polygons that are using the vertex "number". |
SimpleVector[] |
getSourceMesh()
Returns the source mesh's vertex data, i.e. the vertex-data that needs modification. |
SimpleVector[] |
getSourceNormals()
Returns the source mesh's normals, i.e. the normals that need modification. |
float[][] |
getTangentVectors()
If available, this will return the tangent vectors for the mesh. |
boolean |
init(Mesh mesh,
boolean modify)
Initialize the VertexController with a mesh to modify and a operating mode. |
void |
refreshMeshData()
Refreshes the controller's data with the data taken directly from the Mesh. |
boolean |
setup()
This method can be overwritten to do some additional setup work. |
void |
updateMesh()
Alters the actual Mesh to reflect the modifications that have been applied to the DestinationMesh- and DestinationNormals-arrays. |
| Field Detail |
public static final boolean ALTER_SOURCE_MESH
public static final boolean PRESERVE_SOURCE_MESH
| Method Detail |
public boolean init(Mesh mesh,
boolean modify)
mesh - the Mesh the controller should be assigned tomodify - the mode
ALTER_SOURCE_MESH,
PRESERVE_SOURCE_MESHpublic boolean setup()
public void apply()
getSourceMesh(),
getSourceNormals(),
getDestinationMesh(),
getDestinationNormals()public SimpleVector[] getSourceMesh()
public SimpleVector[] getSourceNormals()
public SimpleVector[] getDestinationMesh()
public SimpleVector[] getDestinationNormals()
public int getMeshSize()
public void updateMesh()
public void refreshMeshData()
public void destroy()
Mesh.removeVertexController()public void cleanup()
Mesh.removeVertexController()
public int[] getPolygonIDs(int vertex,
int max)
vertex - the number of the vertexmax - the maximum of IDs to return
public float[][] getTangentVectors()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||