org.jagatoo.loaders.models.cal3d.core
Class CalPhysique

java.lang.Object
  extended by org.jagatoo.loaders.models.cal3d.core.CalPhysique

public class CalPhysique
extends java.lang.Object

The physique class. This synchronizes on the model for which it is providing the physique.


Field Summary
protected  CalModel model
           
protected  boolean normalize
           
 
Constructor Summary
CalPhysique(CalModel model)
          Constructs the physique instance.
 
Method Summary
 int calculateNormals(CalSubmesh submesh, Vector3fBuffer normalBuffer)
          Calculates the transformed normal data.
 int calculateTangents(CalSubmesh submesh, int mapId, Vector3fBuffer tangentBuffer)
          Calculates the transformed tangent data.
 int calculateVertices(CalSubmesh submesh, Vector3fBuffer vertexBuffer)
          Calculates the transformed vertex data.
 void setNormalization(boolean normalize)
          Sets the normalization flag to true or false.
 void update()
          Updates all the internally handled attached meshes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

protected CalModel model

normalize

protected boolean normalize
Constructor Detail

CalPhysique

public CalPhysique(CalModel model)
Constructs the physique instance. This function is the default constructor of the physique instance.

Parameters:
model - A pointer to the model that should be managed with this physique instance.
Method Detail

setNormalization

public void setNormalization(boolean normalize)
Sets the normalization flag to true or false. This function sets the normalization flag on or off. If off, the normals calculated by Cal3D will not be normalized. Instead, this transform is left up to the user.


calculateVertices

public int calculateVertices(CalSubmesh submesh,
                             Vector3fBuffer vertexBuffer)
Calculates the transformed vertex data. This function calculates and returns the transformed vertex data of a specific submesh.

Parameters:
submesh - A pointer to the submesh from which the vertex data should be calculated and returned.
vertexBuffer - A pointer to the user-provided buffer where the vertex data is written to.
Returns:
The number of vertices written to the buffer.

calculateNormals

public int calculateNormals(CalSubmesh submesh,
                            Vector3fBuffer normalBuffer)
Calculates the transformed normal data. This function calculates and returns the transformed normal data of a specific submesh.

Parameters:
submesh - A pointer to the submesh from which the normal data should be calculated and returned.
normalBuffer - A pointer to the user-provided buffer where the normal data is written to.
Returns:
The number of normals written to the buffer.

calculateTangents

public int calculateTangents(CalSubmesh submesh,
                             int mapId,
                             Vector3fBuffer tangentBuffer)
Calculates the transformed tangent data. This function calculates and returns the transformed tangent data of a specific submesh.

Parameters:
submesh - A pointer to the submesh from which the tangent data should be calculated and returned.
mapId - The texture layer id for the tangents
tangentBuffer - A pointer to the user-provided buffer where the tangent data is written to.
Returns:
The number of tangents written to the buffer.

update

public void update()
Updates all the internally handled attached meshes. This function updates all the attached meshes of the model that are handled internally.