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

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

public class CalMesh
extends java.lang.Object

The mesh class.


Field Summary
protected  CalCoreMesh coreMesh
           
protected  CalModel model
           
protected  java.util.List<CalSubmesh> submeshes
           
 
Constructor Summary
CalMesh(CalCoreMesh coreMesh)
          Creates a mesh based on a core mesh.
 
Method Summary
 CalCoreMesh getCoreMesh()
          Provides access to the core mesh.
 CalSubmesh getSubmesh(int id)
          Provides access to a submesh.
 int getSubmeshCount()
          Returns the number of submeshes.
 java.util.List<CalSubmesh> getSubmeshes()
          Returns the submesh vector.
 void setLodLevel(float lodLevel)
          Sets the LOD level.
 void setMaterialSet(java.util.List<CalCoreMaterial> materials)
          Sets the material set.
 void setMaterialSet(java.lang.String setId)
          Sets the material set.
 void setModel(CalModel model)
          Sets the model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

protected CalModel model

coreMesh

protected CalCoreMesh coreMesh

submeshes

protected java.util.List<CalSubmesh> submeshes
Constructor Detail

CalMesh

public CalMesh(CalCoreMesh coreMesh)
Creates a mesh based on a core mesh. This function is the default constructor of the mesh instance.

Method Detail

getCoreMesh

public CalCoreMesh getCoreMesh()
Provides access to the core mesh. This function returns the core mesh on which this mesh instance is based on.

Returns:
One of the following values: \li a pointer to the core mesh \li \b 0 if an error happend

getSubmesh

public CalSubmesh getSubmesh(int id)
Provides access to a submesh. This function returns the submesh with the given ID.

Parameters:
id - The ID of the submesh that should be returned.
Returns:
One of the following values: \li a pointer to the submesh \li \b null if an error happend

getSubmeshCount

public int getSubmeshCount()
Returns the number of submeshes. This function returns the number of submeshes in the mesh instance.

Returns:
The number of submeshes.

getSubmeshes

public java.util.List<CalSubmesh> getSubmeshes()
Returns the submesh vector. This function returns the vector that contains all submeshes of the mesh instance.

Returns:
A reference to the submesh vector.

setLodLevel

public void setLodLevel(float lodLevel)
Sets the LOD level. This function sets the LOD level of the mesh instance.

Parameters:
lodLevel - The LOD level in the range [0.0, 1.0].

setMaterialSet

public void setMaterialSet(java.lang.String setId)
Sets the material set. This function sets the material set of the mesh instance.

Parameters:
setId - The ID of the material set.

setMaterialSet

public void setMaterialSet(java.util.List<CalCoreMaterial> materials)
Sets the material set. This function sets the material set of the mesh instance.

Parameters:
materials - the materials in ID order

setModel

public void setModel(CalModel model)
Sets the model. This function sets the model to which the mesh instance is attached to.

Parameters:
model - The model to which the mesh instance should be attached to.