- Cal3D 0.9 API Reference -

Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

CalModel Class Reference

The model class. More...

#include <model.h>

List of all members.

Public Member Functions

 CalModel ()
 Constructs the model instance.

virtual ~CalModel ()
 Destructs the model instance.

bool attachMesh (int coreMeshId)
 Attachs a mesh.

bool create (CalCoreModel *pCoreModel)
 Creates the model instance.

void destroy ()
 Destroys the model instance.

bool detachMesh (int coreMeshId)
 Detaches a mesh.

CalCoreModel * getCoreModel ()
 Provides access to the core model.

CalMesh * getMesh (int coreMeshId)
 Provides access to an attached mesh.

CalMixer * getMixer ()
 Provides access to the mixer.

CalMorphTargetMixer * getMorphTargetMixer ()
 Provides access to the morph target mixer.

CalPhysique * getPhysique ()
 Provides access to the physique.

CalRenderer * getRenderer ()
 Provides access to the renderer.

CalSkeleton * getSkeleton ()
 Provides access to the skeleton.

CalSpringSystem * getSpringSystem ()
 Provides access to the spring system.

Cal::UserData getUserData ()
 Provides access to the user data.

std::vector< CalMesh * > & getVectorMesh ()
 Returns the mesh vector.

void setLodLevel (float lodLevel)
 Sets the LOD level.

void setMaterialSet (int setId)
 Sets the material set.

void setUserData (Cal::UserData userData)
 Stores user data.

void update (float deltaTime)
 Updates the model instance.

void disableInternalData ()
 Disable internal data (and thus springs system).


Protected Attributes

CalCoreModel * m_pCoreModel
CalSkeleton * m_pSkeleton
CalMixer * m_pMixer
CalMorphTargetMixer * m_pMorphTargetMixer
CalPhysique * m_pPhysique
CalSpringSystem * m_pSpringSystem
CalRenderer * m_pRenderer
Cal::UserData m_userData
std::vector< CalMesh * > m_vectorMesh


Detailed Description

The model class.


Constructor & Destructor Documentation

CalModel::CalModel (   ) 
 

Constructs the model instance.

This function is the default constructor of the model instance.

CalModel::~CalModel (   )  [virtual]
 

Destructs the model instance.

This function is the destructor of the model instance.


Member Function Documentation

bool CalModel::attachMesh (  int  coreMeshId  ) 
 

Attachs a mesh.

This function attachs a mesh to the model instance.

Parameters:
coreMeshId The ID of the mesh that should be attached.
Returns:
One of the following values:
  • true if successful
  • false if an error happend

bool CalModel::create (  CalCoreModel *  pCoreModel  ) 
 

Creates the model instance.

This function creates the model instance based on a core model.

Parameters:
pCoreModel A pointer to the core model on which this model instance should be based on.
Returns:
One of the following values:
  • true if successful
  • false if an error happend

void CalModel::destroy (   ) 
 

Destroys the model instance.

This function destroys all data stored in the model instance and frees all allocated memory.

bool CalModel::detachMesh (  int  coreMeshId  ) 
 

Detaches a mesh.

This function detaches a mesh from the model instance.

Parameters:
coreMeshId The ID of the mesh that should be detached.
Returns:
One of the following values:
  • true if successful
  • false if an error happend

CalCoreModel * CalModel::getCoreModel (   ) 
 

Provides access to the core model.

This function returns the core model on which this model instance is based on.

Returns:
One of the following values:
  • a pointer to the core model
  • 0 if an error happend

CalMesh * CalModel::getMesh (  int  coreMeshId  ) 
 

Provides access to an attached mesh.

This function returns the attached mesh with the given core mesh ID.

Parameters:
coreMeshId The core mesh ID of the mesh that should be returned.
Returns:
One of the following values:
  • a pointer to the mesh
  • 0 if an error happend

CalMixer * CalModel::getMixer (   ) 
 

Provides access to the mixer.

This function returns the mixer.

Returns:
One of the following values:
  • a pointer to the mixer
  • 0 if an error happend

CalMorphTargetMixer * CalModel::getMorphTargetMixer (   ) 
 

Provides access to the morph target mixer.

This function returns the morph target mixer.

Returns:
One of the following values:
  • a pointer to the morph target mixer
  • 0 if an error happend

CalPhysique * CalModel::getPhysique (   ) 
 

Provides access to the physique.

This function returns the physique.

Returns:
One of the following values:
  • a pointer to the physique
  • 0 if an error happend

CalRenderer * CalModel::getRenderer (   ) 
 

Provides access to the renderer.

This function returns the renderer.

Returns:
One of the following values:
  • a pointer to the renderer
  • 0 if an error happend

CalSkeleton * CalModel::getSkeleton (   ) 
 

Provides access to the skeleton.

This function returns the skeleton.

Returns:
One of the following values:
  • a pointer to the skeleton
  • 0 if an error happend

CalSpringSystem * CalModel::getSpringSystem (   ) 
 

Provides access to the spring system.

This function returns the spring system.

Returns:
One of the following values:
  • a pointer to the spring system
  • 0 if an error happend

Cal::UserData CalModel::getUserData (   ) 
 

Provides access to the user data.

This function returns the user data stored in the model instance.

Returns:
The user data stored in the model instance.

std::vector< CalMesh * > & CalModel::getVectorMesh (   ) 
 

Returns the mesh vector.

This function returns the vector that contains all attached meshes of the model instance.

Returns:
A reference to the mesh vector.

void CalModel::setLodLevel (  float  lodLevel  ) 
 

Sets the LOD level.

This function sets the LOD level of all attached meshes.

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

void CalModel::setMaterialSet (  int  setId  ) 
 

Sets the material set.

This function sets the material set of all attached meshes.

Parameters:
setId The ID of the material set.

void CalModel::setUserData (  Cal::UserData  userData  ) 
 

Stores user data.

This function stores user data in the model instance.

Parameters:
userData The user data that should be stored.

void CalModel::update (  float  deltaTime  ) 
 

Updates the model instance.

This function updates the model instance for a given amount of time.

Parameters:
deltaTime The elapsed time in seconds since the last update.


The documentation for this class was generated from the following files:
Generated at Wed Apr 7 16:57:17 2004 by The Cal3D Team with doxygen 1.3.6 © 1997-2001 Dimitri van Heesch