- Cal3D 0.11 API Reference - |
Public Member Functions | |
CalCoreModel (const std::string &name) | |
Constructs the core model instance. | |
CalCoreModel (const CalCoreModel &inOther) | |
Constructs a copy of a core model instance. | |
~CalCoreModel () | |
Destructs the core model instance. | |
Cal::UserData | getUserData () |
Provides access to the user data. | |
const Cal::UserData | getUserData () const |
Provides access to the user data. | |
void | setUserData (Cal::UserData userData) |
Stores user data. | |
const std::string & | getName () const |
Returns the name. | |
void | setName (const char *inName) |
Changes the name. | |
void | scale (float factor) |
Scale the core model. | |
int | getNumCoreAnimations () const |
int | addCoreAnimation (CalCoreAnimation *pCoreAnimation) |
Adds a core animation. | |
bool | removeCoreAnimation (int id) |
CalCoreAnimation * | getCoreAnimation (int coreAnimationId) |
Provides access to a core animation. | |
const CalCoreAnimation * | getCoreAnimation (int coreAnimationId) const |
Provides access to a core animation. | |
bool | removeCoreAnimatedMorph (int id) |
int | getCoreAnimationCount () const |
Returns the number of core animations. | |
int | loadCoreAnimation (const std::string &strFilename) |
Loads a core animation. | |
int | loadCoreAnimation (void *buffer, const std::string &strAnimationName) |
int | loadCoreAnimation (const std::string &strFilename, const std::string &strAnimationName) |
Loads a core animation and bind it to a name. | |
int | loadCoreAnimation (void *buffer) |
Loads a core animation. | |
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) const |
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) const |
Retrieves the ID of the animation referenced by a string. | |
int | addCoreAnimatedMorph (CalCoreAnimatedMorph *pCoreAnimatedMorph) |
Adds a core animated morph (different from a morph animation). | |
CalCoreAnimatedMorph * | getCoreAnimatedMorph (int coreAnimatedMorphId) |
Provides access to a core morph animation. | |
const CalCoreAnimatedMorph * | getCoreAnimatedMorph (int coreAnimatedMorphId) const |
int | getCoreAnimatedMorphId (const std::string &strAnimatedMorphName) const |
Retrieves the ID of the animated morph referenced by a string. | |
int | getNumCoreAnimatedMorphs () const |
int | getCoreMorphAnimationCount () const |
int | loadCoreAnimatedMorph (const std::string &strFilename) |
Loads a core animatedMorph. | |
int | loadCoreAnimatedMorph (const std::string &strFilename, const std::string &strAnimatedMorphName) |
int | loadCoreAnimatedMorph (void *buffer, unsigned int bufferLength) |
int | loadCoreAnimatedMorph (void *buffer, unsigned int bufferLength, const std::string &strAnimatedMorphName) |
int | unloadCoreAnimatedMorph (const std::string &name) |
Delete the resources used by the named core animated morph. | |
int | unloadCoreAnimatedMorph (int coreAnimatedMorphId) |
Delete the resources used by a core animated orph. | |
bool | saveCoreAnimatedMorph (const std::string &strFilename, int coreAnimatedMorphId) const |
Saves a core animated morph. | |
bool | addAnimatedMorphName (const std::string &strAnimatedMorphName, int coreAnimatedMorphId) |
int | addCoreMaterial (CalCoreMaterial *pCoreMaterial) |
Adds a core material. | |
void | cloneCoreMaterials () |
Replace each core material by a copy. | |
bool | createInternal (const std::string &strName) |
bool | createWithName (char const *strName) |
bool | createCoreMaterialThread (int coreMaterialThreadId) |
Creates a core material thread. | |
int | getCoreAnimationMaxId () |
CalCoreMaterial * | getCoreMaterial (int coreMaterialId) |
Provides access to a core material. | |
const CalCoreMaterial * | getCoreMaterial (int coreMaterialId) const |
Provides access to a core material. | |
int | getCoreMaterialCount () const |
Returns the number of core materials. | |
int | getCoreMaterialId (int coreMaterialThreadId, int coreMaterialSetId) const |
Returns a specified core material ID. | |
int | loadCoreMaterial (const std::string &strFilename) |
Loads a core material. | |
int | loadCoreMaterial (void *buffer, const std::string &strMaterialName) |
int | loadCoreMaterial (const std::string &strFilename, const std::string &strMaterialName) |
Loads a core material and bind it to a name. | |
int | loadCoreMaterial (void *buffer) |
Loads a core material. | |
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) const |
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) const |
Retrieves the ID of the core material referenced by a string. | |
int | addCoreMesh (CalCoreMesh *pCoreMesh) |
Adds a core mesh. | |
void | replaceCoreMesh (int coreMeshId, CalCoreMesh *pCoreMesh) |
Replaces a core mesh. | |
CalCoreMesh * | getCoreMesh (int coreMeshId) |
Provides access to a core mesh. | |
const CalCoreMesh * | getCoreMesh (int coreMeshId) const |
Provides access to a core mesh. | |
int | getCoreMeshCount () const |
Returns the number of core meshes. | |
int | loadCoreMesh (const std::string &strFilename) |
Loads a core mesh. | |
int | loadCoreMesh (void *buffer, const std::string &strMeshName) |
int | loadCoreMesh (const std::string &strFilename, const std::string &strMeshName) |
Loads a core mesh and bind it to a name. | |
int | loadCoreMesh (void *buffer) |
Loads a core mesh. | |
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) const |
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) const |
Retrieves the ID of the core mesh referenced by a string. | |
CalCoreSkeleton * | getCoreSkeleton () |
Provides access to the core skeleton. | |
const CalCoreSkeleton * | getCoreSkeleton () const |
Provides access to the core skeleton. | |
bool | loadCoreSkeleton (const std::string &strFilename) |
Loads the core skeleton. | |
bool | loadCoreSkeleton (void *buffer) |
Loads the core skeleton. | |
bool | saveCoreSkeleton (const std::string &strFilename) const |
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) const |
Retrieves the ID of the bone referenced by a string. | |
void | setCoreMeshManagementOn (bool p) |
bool | getCoreMeshManagementOn () |
void | setCoreAnimationManagementOn (bool p) |
bool | getCoreAnimationManagementOn () |
CalCoreModel::CalCoreModel | ( | const std::string & | name | ) |
Constructs the core model instance.
This function is the default constructor of the core model instance.
CalCoreModel::CalCoreModel | ( | const CalCoreModel & | inOther | ) |
Constructs a copy of a core model instance.
This function is the copy constructor of the core model instance.
CalCoreModel::~CalCoreModel | ( | ) |
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::addCoreAnimatedMorph | ( | CalCoreAnimatedMorph * | pCoreAnimatedMorph | ) |
Adds a core animated morph (different from a morph animation).
Loads a core animated morph (different from a morph animation), and adds it to the model instance. The model instance will free the loaded core animated more when the model instance is freed.
pCoreAnimation | A pointer to the core animated morph that should be added. |
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. |
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 | ) | const |
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. |
CalCoreAnimatedMorph * CalCoreModel::getCoreAnimatedMorph | ( | int | coreAnimatedMorphId | ) |
Provides access to a core morph animation.
This function returns the core morph animation with the given ID.
coreAnimatedMorphId | The ID of the core morph animation that should be returned. |
int CalCoreModel::getCoreAnimatedMorphId | ( | const std::string & | name | ) | const |
Retrieves the ID of the animated morph referenced by a string.
This function returns an animated morph ID
name | A string that is associated with an anim morph 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. |
const CalCoreAnimation * CalCoreModel::getCoreAnimation | ( | int | coreAnimationId | ) | const |
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. |
int CalCoreModel::getCoreAnimationCount | ( | ) | const |
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 | ) | const |
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. |
const CalCoreMaterial * CalCoreModel::getCoreMaterial | ( | int | coreMaterialId | ) | const |
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. |
int CalCoreModel::getCoreMaterialCount | ( | ) | const |
Returns the number of core materials.
This function returns the number of core materials in the core model instance.
int CalCoreModel::getCoreMaterialId | ( | const std::string & | strMaterialName | ) | const |
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. |
int CalCoreModel::getCoreMaterialId | ( | int | coreMaterialThreadId, |
int | coreMaterialSetId ) const |
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. |
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. |
const CalCoreMesh * CalCoreModel::getCoreMesh | ( | int | coreMeshId | ) | const |
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 | ( | ) | const |
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 | ) | const |
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. |
CalCoreSkeleton * CalCoreModel::getCoreSkeleton | ( | ) |
Provides access to the core skeleton.
This function returns the core skeleton.
const CalCoreSkeleton * CalCoreModel::getCoreSkeleton | ( | ) | const |
Provides access to the core skeleton.
This function returns the core skeleton.
const std::string & CalCoreModel::getName | ( | ) | const |
Returns the name.
This function returns the name of the core model instance.
Cal::UserData CalCoreModel::getUserData | ( | ) |
Provides access to the user data.
This function returns the user data stored in the core model instance.
const Cal::UserData CalCoreModel::getUserData | ( | ) | const |
Provides access to the user data.
This function returns the user data stored in the core model instance.
int CalCoreModel::loadCoreAnimatedMorph | ( | const std::string & | strFilename | ) |
Loads a core animatedMorph.
This function loads a core animatedMorph from a file.
strFilename | The file from which the core animatedMorph should be loaded from. |
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::loadCoreAnimation | ( | void * | buffer | ) |
Loads a core animation.
This function loads a core animation from a buffer.
buffer | The buffer from which the core animation should be loaded. |
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::loadCoreMaterial | ( | void * | buffer | ) |
Loads a core material.
This function loads a core material from a buffer.
buffer | The buffer from which the core material should be loaded. |
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. |
int CalCoreModel::loadCoreMesh | ( | void * | buffer | ) |
Loads a core mesh.
This function loads a core mesh from a buffer.
buffer | The buffer from which the core mesh should be loaded. |
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::loadCoreSkeleton | ( | void * | buffer | ) |
Loads the core skeleton.
This function loads the core skeleton from a buffer.
buffer | The buffer from which the core skeleton should be loaded. |
void CalCoreModel::replaceCoreMesh | ( | int | coreMeshId, |
CalCoreMesh * | pCoreMesh ) |
Replaces a core mesh.
This function replaces a core mesh in the core model instance. - JWWalker
coreMeshId | The ID of the core mesh that should be replaced. |
pCoreMesh | A pointer to the core mesh that should be added. |
bool CalCoreModel::saveCoreAnimatedMorph | ( | const std::string & | strFilename, |
int | coreAnimatedMorphId ) const |
Saves a core animated morph.
This function saves a core animated morph to a file.
strFilename | The file to which the core animated morph should be saved to. |
coreAnimatedMorphId | The ID of the core animated morph that should be saved. |
bool CalCoreModel::saveCoreAnimation | ( | const std::string & | strFilename, |
int | coreAnimationId ) const |
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 ) const |
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 ) const |
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 | ) | const |
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::setName | ( | const char * | inName | ) |
Changes the name.
This function sets the name of the core model instance.
The | name as string. |
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::unloadCoreAnimatedMorph | ( | const std::string & | name | ) |
Delete the resources used by the named core animated morph.
The name must be associated with a valid core animated morph Id with the function getAnimatedMorphId. The caller must ensure that the corresponding is not referenced anywhere otherwise unpredictable results will occur.
name | The symbolic name of the core animated morph to unload. |
int CalCoreModel::unloadCoreAnimatedMorph | ( | int | coreAnimatedMorphId | ) |
Delete the resources used by a core animated orph.
The caller must ensure that the corresponding is not referenced anywhere otherwise unpredictable results will occur.
coreAnimatedMorphId | The ID of the core animated morph that should be unloaded. |
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. |