- Cal3D 0.11 API Reference -

Public Member Functions | List of all members
CalModel Class Reference
Inheritance diagram for CalModel:
cal3d::noncopyable

Public Member Functions

 CalModel (CalCoreModel *pCoreModel)
 Constructs the model instance. More...
 
 ~CalModel ()
 Destructs the model instance. More...
 
bool attachMesh (int coreMeshId)
 Attachs a mesh. More...
 
bool detachMesh (int coreMeshId)
 Detaches a mesh. More...
 
CalCoreModelgetCoreModel ()
 Provides access to the core model. More...
 
const CalCoreModelgetCoreModel () const
 Provides access to the core model. More...
 
CalMeshgetMesh (int coreMeshId)
 Provides access to an attached mesh. More...
 
const CalMeshgetMesh (int coreMeshId) const
 Provides access to an attached mesh. More...
 
CalMixergetMixer ()
 Returns the mixer. More...
 
const CalMixergetMixer () const
 Returns the mixer. More...
 
const CalAbstractMixergetAbstractMixer () const
 Returns the mixer. More...
 
void setAbstractMixer (CalAbstractMixer *pMixer)
 Sets the mixer to a CalAbstractMixer subclass instance. More...
 
CalMorphTargetMixergetMorphTargetMixer ()
 Provides access to the morph target mixer. More...
 
const CalMorphTargetMixergetMorphTargetMixer () const
 Provides access to the morph target mixer. More...
 
CalPhysiquegetPhysique ()
 Provides access to the physique. More...
 
const CalPhysiquegetPhysique () const
 Provides access to the physique. More...
 
void setPhysique (CalPhysique *physique)
 Sets the physique. More...
 
CalRenderergetRenderer ()
 Provides access to the renderer. More...
 
const CalRenderergetRenderer () const
 Provides access to the renderer. More...
 
CalSkeletongetSkeleton ()
 Provides access to the skeleton. More...
 
const CalSkeletongetSkeleton () const
 Provides access to the skeleton. More...
 
CalSpringSystemgetSpringSystem ()
 Provides access to the spring system. More...
 
const CalSpringSystemgetSpringSystem () const
 Provides access to the spring system. More...
 
CalBoundingBoxgetBoundingBox (bool precision=false)
 Returns the global bounding box of the model. More...
 
const Cal::UserData getUserData () const
 Provides access to the user data. More...
 
std::vector< CalMesh * > & getVectorMesh ()
 Returns the mesh vector. More...
 
void setLodLevel (float lodLevel)
 Sets the LOD level. More...
 
void setMaterialSet (int setId)
 Sets the material set. More...
 
void setUserData (Cal::UserData userData)
 Stores user data. More...
 
void update (float deltaTime)
 Updates the model instance. More...
 
void disableInternalData ()
 Disable internal data (and thus springs system) More...
 

Constructor & Destructor Documentation

◆ CalModel()

CalModel::CalModel ( CalCoreModel pCoreModel)

Constructs the model instance.

This function is the default constructor of the model instance.

◆ ~CalModel()

CalModel::~CalModel ( )

Destructs the model instance.

This function is the destructor of the model instance.

Member Function Documentation

◆ attachMesh()

bool CalModel::attachMesh ( int  coreMeshId)

Attachs a mesh.

This function attachs a mesh to the model instance.

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

◆ detachMesh()

bool CalModel::detachMesh ( int  coreMeshId)

Detaches a mesh.

This function detaches a mesh from the model instance.

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

◆ disableInternalData()

void CalModel::disableInternalData ( )

Disable internal data (and thus springs system)

◆ getAbstractMixer()

const CalAbstractMixer * CalModel::getAbstractMixer ( ) const

Returns the mixer.

Returns
  • a pointer to the mixer
  • 0 if no mixer was set

◆ getBoundingBox()

CalBoundingBox & CalModel::getBoundingBox ( bool  precision = false)

Returns the global bounding box of the model.

This function returns the global bounding box of the model.

Parameters
precision: indicate if the function need to compute a correct bounding box
Returns
bounding box.

◆ getCoreModel() [1/2]

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 happened

◆ getCoreModel() [2/2]

const CalCoreModel * CalModel::getCoreModel ( ) const

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 happened

◆ getMesh() [1/2]

CalMesh * CalModel::getMesh ( int  coreMeshId)

Provides access to an attached mesh.

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

Parameters
coreMeshIdThe 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 happened

◆ getMesh() [2/2]

const CalMesh * CalModel::getMesh ( int  coreMeshId) const

Provides access to an attached mesh.

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

Parameters
coreMeshIdThe 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 happened

◆ getMixer() [1/2]

CalMixer * CalModel::getMixer ( )

Returns the mixer.

If a mixer that is not an instance of CalMixer was set with the CalModel::setAbstractMixer method, an INVALID_MIXER_TYPE error (see CalError) is set and 0 is returned.

Returns
  • a pointer to the mixer
  • 0 if an error happened

◆ getMixer() [2/2]

const CalMixer * CalModel::getMixer ( ) const

Returns the mixer.

If a mixer that is not an instance of CalMixer was set with the CalModel::setAbstractMixer method, an INVALID_MIXER_TYPE error (see CalError) is set and 0 is returned.

Returns
  • a pointer to the mixer
  • 0 if an error happened

◆ getMorphTargetMixer() [1/2]

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 happened

◆ getMorphTargetMixer() [2/2]

const CalMorphTargetMixer * CalModel::getMorphTargetMixer ( ) const

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 happened

◆ getPhysique() [1/2]

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 happened

◆ getPhysique() [2/2]

const CalPhysique * CalModel::getPhysique ( ) const

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 happened

◆ getRenderer() [1/2]

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 happened

◆ getRenderer() [2/2]

const CalRenderer * CalModel::getRenderer ( ) const

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 happened

◆ getSkeleton() [1/2]

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 happened

◆ getSkeleton() [2/2]

const CalSkeleton * CalModel::getSkeleton ( ) const

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 happened

◆ getSpringSystem() [1/2]

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 happened

◆ getSpringSystem() [2/2]

const CalSpringSystem * CalModel::getSpringSystem ( ) const

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 happened

◆ getUserData()

const Cal::UserData CalModel::getUserData ( ) const

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.

◆ getVectorMesh()

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.

◆ setAbstractMixer()

void CalModel::setAbstractMixer ( CalAbstractMixer pMixer)

Sets the mixer to a CalAbstractMixer subclass instance.

If a mixer was already set (with CalModel::setAbstractMixer or because the CalModel::create method created a CalMixer instance), its destroy method is called. The existing mixer is not deallocated, it is the responsibility of the caller to call the getAbstractMixer method and deallocate the returned instance if appropriate.

pMixer will be deallocated by cal3d if and only if the CalModel::destroy function is called.

The create method of pMixer is called.

pMixer may be null. After setting a null pointer, the caller MUST call CalModel::create or CalModel::setAbstractMixer with a non-null pointer before any other method is called.

Parameters
pMixeris a pointer to a CalAbstractMixer subclass instance.

◆ setLodLevel()

void CalModel::setLodLevel ( float  lodLevel)

Sets the LOD level.

This function sets the LOD level of all attached meshes.

Parameters
lodLevelThe LOD level in the range [0.0, 1.0].

◆ setMaterialSet()

void CalModel::setMaterialSet ( int  setId)

Sets the material set.

This function sets the material set of all attached meshes.

Parameters
setIdThe ID of the material set.

◆ setPhysique()

void CalModel::setPhysique ( CalPhysique physique)

Sets the physique.

This function changes the physique of the model.

Parameters
physiqueThe new physique object.

◆ setUserData()

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

Stores user data.

This function stores user data in the model instance.

Parameters
userDataThe user data that should be stored.

◆ update()

void CalModel::update ( float  deltaTime)

Updates the model instance.

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

Parameters
deltaTimeThe elapsed time in seconds since the last update.

The documentation for this class was generated from the following files:

Generated by The Cal3D Team with Doxygen 1.8.14