- Cal3D 0.11 API Reference - |
Public Member Functions | |
CalCoreModel (const std::string &name) | |
Constructs the core model instance. | |
~CalCoreModel () | |
Destructs the core model instance. | |
Cal::UserData | getUserData () |
Provides access to the user data. | |
void | setUserData (Cal::UserData userData) |
Stores user data. | |
void | scale (float factor) |
Scale the core model. | |
int | addCoreAnimation (CalCoreAnimation *pCoreAnimation) |
Adds a core animation. | |
CalCoreAnimation * | getCoreAnimation (int coreAnimationId) |
Provides access to a core animation. | |
int | getCoreAnimationCount () |
Returns the number of core animations. | |
int | loadCoreAnimation (const std::string &strFilename) |
Loads a core animation. | |
int | loadCoreAnimation (const std::string &strFilename, const std::string &strAnimationName) |
Loads a core animation and bind it to a name. | |
int | unloadCoreAnimation (const std::string &name) |
Delete the resources used by the named core animation. | |
int | unloadCoreAnimation (int coreAnimationId) |
Delete the resources used by a core animation. | |
bool | saveCoreAnimation (const std::string &strFilename, int coreAnimationId) |
Saves a core animation. | |
bool | addAnimationName (const std::string &strAnimationName, int coreAnimationId) |
Creates or overwrites a string-to-animation ID mapping. | |
int | getCoreAnimationId (const std::string &strAnimationName) |
Retrieves the ID of the animation referenced by a string. | |
int | addCoreMorphAnimation (CalCoreMorphAnimation *pCoreMorphAnimation) |
Adds a core morph animation. | |
CalCoreMorphAnimation * | getCoreMorphAnimation (int coreMorphAnimationId) |
Provides access to a core morph animation. | |
int | getCoreMorphAnimationCount () |
Returns the number of core morph animations. | |
int | addCoreMaterial (CalCoreMaterial *pCoreMaterial) |
Adds a core material. | |
bool | createCoreMaterialThread (int coreMaterialThreadId) |
Creates a core material thread. | |
CalCoreMaterial * | getCoreMaterial (int coreMaterialId) |
Provides access to a core material. | |
int | getCoreMaterialCount () |
Returns the number of core materials. | |
int | getCoreMaterialId (int coreMaterialThreadId, int coreMaterialSetId) |
Returns a specified core material ID. | |
int | loadCoreMaterial (const std::string &strFilename) |
Loads a core material. | |
int | loadCoreMaterial (const std::string &strFilename, const std::string &strMaterialName) |
Loads a core material and bind it to a name. | |
int | unloadCoreMaterial (const std::string &name) |
Delete the resources used by the named core material. | |
int | unloadCoreMaterial (int coreMaterialId) |
Delete the resources used by a core material. | |
bool | saveCoreMaterial (const std::string &strFilename, int coreMaterialId) |
Saves a core material. | |
bool | setCoreMaterialId (int coreMaterialThreadId, int coreMaterialSetId, int coreMaterialId) |
Sets a core material ID. | |
bool | addMaterialName (const std::string &strMaterialName, int coreMaterialId) |
Creates or overwrites a string-to-core-material ID mapping. | |
int | getCoreMaterialId (const std::string &strMaterialName) |
Retrieves the ID of the core material referenced by a string. | |
int | addCoreMesh (CalCoreMesh *pCoreMesh) |
Adds a core mesh. | |
CalCoreMesh * | getCoreMesh (int coreMeshId) |
Provides access to a core mesh. | |
int | getCoreMeshCount () |
Returns the number of core meshes. | |
int | loadCoreMesh (const std::string &strFilename) |
Loads a core mesh. | |
int | loadCoreMesh (const std::string &strFilename, const std::string &strMeshName) |
Loads a core mesh and bind it to a name. | |
int | unloadCoreMesh (const std::string &name) |
Delete the resources used by the named core mesh. | |
int | unloadCoreMesh (int coreMeshId) |
Delete the resources used by a core mesh. | |
bool | saveCoreMesh (const std::string &strFilename, int coreMeshId) |
Saves a core mesh. | |
bool | addMeshName (const std::string &strMeshName, int coreMeshId) |
Creates or overwrites a string-to-core-mesh ID mapping. | |
int | getCoreMeshId (const std::string &strMeshName) |
Retrieves the ID of the core mesh referenced by a string. | |
CalCoreSkeleton * | getCoreSkeleton () |
Provides access to the core skeleton. | |
bool | loadCoreSkeleton (const std::string &strFilename) |
Loads the core skeleton. | |
bool | saveCoreSkeleton (const std::string &strFilename) |
Saves the core skeleton. | |
void | setCoreSkeleton (CalCoreSkeleton *pCoreSkeleton) |
Sets the core skeleton. | |
void | addBoneName (const std::string &strBoneName, int boneId) |
Creates or overwrites a string-to-boneId mapping. | |
int | getBoneId (const std::string &strBoneName) |
Retrieves the ID of the bone referenced by a string. |
CalCoreModel::CalCoreModel | ( | const std::string & | name | ) |
Constructs the core model instance.
This function is the default constructor of the core model instance.
Destructs the core model instance.
This function is the destructor of the core model instance.
bool CalCoreModel::addAnimationName | ( | const std::string & | strAnimationName, |
int | coreAnimationId | ||
) |
Creates or overwrites a string-to-animation ID mapping.
This function makes an animation ID reference-able by a string name. Note that we don't verify that the ID is valid because the animation may be added later. Also, if there is already a helper with this name, it will be overwritten without warning.
strAnimationName | The string that will be associated with the ID. |
coreAnimationId | The ID number of the animation to be referenced by the string. |
void CalCoreModel::addBoneName | ( | const std::string & | strBoneName, |
int | boneId | ||
) |
Creates or overwrites a string-to-boneId mapping.
This function makes a bone ID reference-able by a string name.
strBoneName | The string that will be associated with the ID. |
boneId | The ID number of the bone that will be referenced by the string. |
int CalCoreModel::addCoreAnimation | ( | CalCoreAnimation * | pCoreAnimation | ) |
Adds a core animation.
This function adds a core animation to the core model instance.
pCoreAnimation | A pointer to the core animation that should be added. |
int CalCoreModel::addCoreMaterial | ( | CalCoreMaterial * | pCoreMaterial | ) |
Adds a core material.
This function adds a core material to the core model instance.
pCoreMaterial | A pointer to the core material that should be added. |
int CalCoreModel::addCoreMesh | ( | CalCoreMesh * | pCoreMesh | ) |
Adds a core mesh.
This function adds a core mesh to the core model instance.
pCoreMesh | A pointer to the core mesh that should be added. |
int CalCoreModel::addCoreMorphAnimation | ( | CalCoreMorphAnimation * | pCoreMorphAnimation | ) |
Adds a core morph animation.
This function adds a core morph animation to the core model instance.
pCoreMorphAnimation | A pointer to the core morph animation that should be added. |
bool CalCoreModel::addMaterialName | ( | const std::string & | strMaterialName, |
int | coreMaterialId | ||
) |
Creates or overwrites a string-to-core-material ID mapping.
This function makes a core material ID reference-able by a string name. Note that we don't verify that the ID is valid because the material may be added later. Also, if there is already a helper with this name, it will be overwritten without warning.
strMaterialName | The string that will be associated with the ID. |
coreMaterialId | The core ID number of the material to be referenced by the string. |
bool CalCoreModel::addMeshName | ( | const std::string & | strMeshName, |
int | coreMeshId | ||
) |
Creates or overwrites a string-to-core-mesh ID mapping.
This function makes a core mesh ID reference-able by a string name. Note that we don't verify that the ID is valid because the mesh may be added later. Also, if there is already a helper with this name, it will be overwritten without warning.
strMeshName | The string that will be associated with the ID. |
coreMeshId | The core ID number of the mesh to be referenced by the string. |
bool CalCoreModel::createCoreMaterialThread | ( | int | coreMaterialThreadId | ) |
Creates a core material thread.
This function creates a new core material thread with the given ID.
coreMaterialThreadId | The ID of the core material thread that should be created. |
int CalCoreModel::getBoneId | ( | const std::string & | strBoneName | ) |
Retrieves the ID of the bone referenced by a string.
This function returns a bone ID
strBoneName | A string that is associated with a bone ID number. |
CalCoreAnimation * CalCoreModel::getCoreAnimation | ( | int | coreAnimationId | ) |
Provides access to a core animation.
This function returns the core animation with the given ID.
coreAnimationId | The ID of the core animation that should be returned. |
Returns the number of core animations.
This function returns the number of core animations in the core model instance.
int CalCoreModel::getCoreAnimationId | ( | const std::string & | strAnimationName | ) |
Retrieves the ID of the animation referenced by a string.
This function returns an animation ID
strAnimationName | A string that is associated with an anim ID number. |
CalCoreMaterial * CalCoreModel::getCoreMaterial | ( | int | coreMaterialId | ) |
Provides access to a core material.
This function returns the core material with the given ID.
coreMaterialId | The ID of the core material that should be returned. |
Returns the number of core materials.
This function returns the number of core materials in the core model instance.
int CalCoreModel::getCoreMaterialId | ( | int | coreMaterialThreadId, |
int | coreMaterialSetId | ||
) |
Returns a specified core material ID.
This function returns the core material ID for a specified core material thread / core material set pair.
coreMaterialThreadId | The ID of the core material thread. |
coreMaterialSetId | The ID of the core material set. |
int CalCoreModel::getCoreMaterialId | ( | const std::string & | strMaterialName | ) |
Retrieves the ID of the core material referenced by a string.
This function returns a core material ID
strMaterialName | A string that is associated with a core material ID number. |
CalCoreMesh * CalCoreModel::getCoreMesh | ( | int | coreMeshId | ) |
Provides access to a core mesh.
This function returns the core mesh with the given ID.
coreMeshId | The ID of the core mesh that should be returned. |
int CalCoreModel::getCoreMeshCount | ( | ) |
Returns the number of core meshes.
This function returns the number of core meshes in the core model instance.
int CalCoreModel::getCoreMeshId | ( | const std::string & | strMeshName | ) |
Retrieves the ID of the core mesh referenced by a string.
This function returns a core mesh ID
strMeshName | A string that is associated with a core mesh ID number. |
CalCoreMorphAnimation * CalCoreModel::getCoreMorphAnimation | ( | int | coreMorphAnimationId | ) |
Provides access to a core morph animation.
This function returns the core morph animation with the given ID.
coreMorphAnimationId | The ID of the core morph animation that should be returned. |
Returns the number of core morph animations.
This function returns the number of core morph animations in the core model instance.
Provides access to the core skeleton.
This function returns the core skeleton.
Cal::UserData CalCoreModel::getUserData | ( | ) |
Provides access to the user data.
This function returns the user data stored in the core model instance.
int CalCoreModel::loadCoreAnimation | ( | const std::string & | strFilename | ) |
Loads a core animation.
This function loads a core animation from a file.
strFilename | The file from which the core animation should be loaded from. |
int CalCoreModel::loadCoreAnimation | ( | const std::string & | strFilename, |
const std::string & | strAnimationName | ||
) |
Loads a core animation and bind it to a name.
This function loads a core animation from a file. It is equivalent to calling addAnimName(strAnimationName, loadCoreAnimation(strFilename)). If strAnimationName is already associated to a coreAnimationId because of a previous call to addAnimName, the same coreAnimationId will be used.
strFilename | The file from which the core animation should be loaded from. |
strAnimationName | A string that is associated with an anim ID number. |
int CalCoreModel::loadCoreMaterial | ( | const std::string & | strFilename | ) |
Loads a core material.
This function loads a core material from a file.
strFilename | The file from which the core material should be loaded from. |
int CalCoreModel::loadCoreMaterial | ( | const std::string & | strFilename, |
const std::string & | strMaterialName | ||
) |
Loads a core material and bind it to a name.
This function loads a core material from a file. It is equivalent to calling addMaterialName(strMaterialName, loadCoreMaterial(strFilename)). If strMaterialName is already associated to a coreMaterialId because of a previous call to addMaterialName, the same coreMaterialId will be used.
strFilename | The file from which the core material should be loaded from. |
strMaterialName | A string that is associated with an anim ID number. |
int CalCoreModel::loadCoreMesh | ( | const std::string & | strFilename | ) |
Loads a core mesh.
This function loads a core mesh from a file.
strFilename | The file from which the core mesh should be loaded from. |
int CalCoreModel::loadCoreMesh | ( | const std::string & | strFilename, |
const std::string & | strMeshName | ||
) |
Loads a core mesh and bind it to a name.
This function loads a core mesh from a file. It is equivalent to calling addMeshName(strMeshName, loadCoreMesh(strFilename)). If strMeshName is already associated to a coreMeshId because of a previous call to addMeshName, the same coreMeshId will be used.
strFilename | The file from which the core mesh should be loaded from. |
strMeshName | A string that is associated with an anim ID number. |
bool CalCoreModel::loadCoreSkeleton | ( | const std::string & | strFilename | ) |
Loads the core skeleton.
This function loads the core skeleton from a file.
strFilename | The file from which the core skeleton should be loaded from. |
bool CalCoreModel::saveCoreAnimation | ( | const std::string & | strFilename, |
int | coreAnimationId | ||
) |
Saves a core animation.
This function saves a core animation to a file.
strFilename | The file to which the core animation should be saved to. |
coreAnimationId | The ID of the core animation that should be saved. |
bool CalCoreModel::saveCoreMaterial | ( | const std::string & | strFilename, |
int | coreMaterialId | ||
) |
Saves a core material.
This function saves a core material to a file.
strFilename | The file to which the core material should be saved to. |
coreMaterialId | The ID of the core material that should be saved. |
bool CalCoreModel::saveCoreMesh | ( | const std::string & | strFilename, |
int | coreMeshId | ||
) |
Saves a core mesh.
This function saves a core mesh to a file.
strFilename | The file to which the core mesh should be saved to. |
coreMeshId | The ID of the core mesh that should be saved. |
bool CalCoreModel::saveCoreSkeleton | ( | const std::string & | strFilename | ) |
Saves the core skeleton.
This function saves the core skeleton to a file.
strFilename | The file to which the core skeleton should be saved to. |
void CalCoreModel::scale | ( | float | factor | ) |
Scale the core model.
This function rescale all data that are in the core model instance
factor | A float with the scale factor |
bool CalCoreModel::setCoreMaterialId | ( | int | coreMaterialThreadId, |
int | coreMaterialSetId, | ||
int | coreMaterialId | ||
) |
Sets a core material ID.
This function sets a core material ID for a core material thread / core material set pair.
coreMaterialThreadId | The ID of the core material thread. |
coreMaterialSetId | The ID of the core maetrial set. |
coreMaterialId | The ID of the core maetrial. |
void CalCoreModel::setCoreSkeleton | ( | CalCoreSkeleton * | pCoreSkeleton | ) |
Sets the core skeleton.
This function sets the core skeleton of the core model instance..
pCoreSkeleton | The core skeleton that should be set. |
void CalCoreModel::setUserData | ( | Cal::UserData | userData | ) |
Stores user data.
This function stores user data in the core model instance.
userData | The user data that should be stored. |
int CalCoreModel::unloadCoreAnimation | ( | const std::string & | name | ) |
Delete the resources used by the named core animation.
The name must be associated with a valid core animation Id with the function getAnimationId. The caller must ensure that the corresponding is not referenced anywhere otherwise unpredictable results will occur.
name | The symbolic name of the core animation to unload. |
int CalCoreModel::unloadCoreAnimation | ( | int | coreAnimationId | ) |
Delete the resources used by a core animation.
The caller must ensure that the corresponding is not referenced anywhere otherwise unpredictable results will occur.
coreAnimationId | The ID of the core animation that should be unloaded. |
int CalCoreModel::unloadCoreMaterial | ( | const std::string & | name | ) |
Delete the resources used by the named core material.
The name must be associated with a valid core material Id with the function getMaterialId. The caller must ensure that the corresponding is not referenced anywhere otherwise unpredictable results will occur.
name | The symbolic name of the core material to unload. |
int CalCoreModel::unloadCoreMaterial | ( | int | coreMaterialId | ) |
Delete the resources used by a core material.
The caller must ensure that the corresponding is not referenced anywhere otherwise unpredictable results will occur.
coreMaterialId | The ID of the core material that should be unloaded. |
int CalCoreModel::unloadCoreMesh | ( | const std::string & | name | ) |
Delete the resources used by the named core mesh.
The name must be associated with a valid core mesh Id with the function getMeshId. The caller must ensure that the corresponding is not referenced anywhere otherwise unpredictable results will occur.
name | The symbolic name of the core mesh to unload. |
int CalCoreModel::unloadCoreMesh | ( | int | coreMeshId | ) |
Delete the resources used by a core mesh.
The caller must ensure that the corresponding is not referenced anywhere otherwise unpredictable results will occur.
coreMeshId | The ID of the core mesh that should be unloaded. |