11#ifndef CAL_COREMODEL_H
12#define CAL_COREMODEL_H
15#include "cal3d/coreanimation.h"
16#include "cal3d/corematerial.h"
17#include "cal3d/coremesh.h"
18#include "cal3d/coreskeleton.h"
19#include "cal3d/global.h"
35 const std::string&
getName()
const;
36 void setName(
const char* inName );
38 void scale(
float factor);
42 int getNumCoreAnimations()
const;
45 bool removeCoreAnimation(
int id );
48 bool removeCoreAnimatedMorph(
int id );
52 int loadCoreAnimation(
const std::string& strFilename,
const std::string& strAnimationName);
56 bool saveCoreAnimation(
const std::string& strFilename,
int coreAnimationId)
const;
57 bool addAnimationName(
const std::string& strAnimationName,
int coreAnimationId);
65 int getNumCoreAnimatedMorphs()
const;
66 int getCoreMorphAnimationCount()
const;
70 int loadCoreAnimatedMorph(
void* buffer,
unsigned int bufferLength,
const std::string& strAnimatedMorphName);
74 bool addAnimatedMorphName(
const std::string& strAnimatedMorphName,
int coreAnimatedMorphId);
79 bool createInternal(
const std::string& strName);
80 bool createWithName(
char const * strName);
82 int getCoreAnimationMaxId();
89 int loadCoreMaterial(
const std::string& strFilename,
const std::string& strMaterialName);
93 bool saveCoreMaterial(
const std::string& strFilename,
int coreMaterialId)
const;
94 bool setCoreMaterialId(
int coreMaterialThreadId,
int coreMaterialSetId,
int coreMaterialId);
95 bool addMaterialName(
const std::string& strMaterialName,
int coreMaterialId);
105 int loadCoreMesh(
void* buffer,
const std::string& strMeshName);
106 int loadCoreMesh(
const std::string& strFilename,
const std::string& strMeshName);
110 bool saveCoreMesh(
const std::string& strFilename,
int coreMeshId)
const;
111 bool addMeshName(
const std::string& strMeshName,
int coreMeshId);
121 void addBoneName(
const std::string& strBoneName,
int boneId);
122 int getBoneId(
const std::string& strBoneName)
const;
123 void setCoreMeshManagementOn(
bool p ) { m_coreMeshManagement = p; }
124 bool getCoreMeshManagementOn() {
return m_coreMeshManagement; }
125 void setCoreAnimationManagementOn(
bool p ) { m_coreAnimationManagement = p; }
126 bool getCoreAnimationManagementOn() {
return m_coreAnimationManagement; }
130 std::string m_strName;
131 CalCoreSkeletonPtr m_pCoreSkeleton;
132 std::vector<CalCoreAnimationPtr> m_vectorCoreAnimation;
133 std::vector<CalCoreAnimatedMorph *> m_vectorCoreAnimatedMorph;
135 std::vector<CalCoreMeshPtr> m_vectorCoreMesh;
136 std::vector<CalCoreMeshPtr> m_vectorMorphMesh;
137 std::vector<CalCoreMaterialPtr> m_vectorCoreMaterial;
138 std::map<int, std::map<int, int> > m_mapmapCoreMaterialThread;
139 Cal::UserData m_userData;
140 std::map<std::string, int> m_animationName;
141 std::map<std::string, int> m_animatedMorphName;
142 std::map<std::string, int> m_materialName;
143 std::map<std::string, int> m_meshName;
144 bool m_coreMeshManagement;
145 bool m_coreAnimationManagement;
146 unsigned int m_magic;
The core animatedMorph class.
Definition coreanimatedmorph.h:37
Definition coreanimation.h:24
Definition corematerial.h:23
CalCoreAnimation * getCoreAnimation(int coreAnimationId)
Provides access to a core animation.
Definition coremodel.cpp:430
bool saveCoreAnimatedMorph(const std::string &strFilename, int coreAnimatedMorphId) const
Saves a core animated morph.
Definition coremodel.cpp:1583
void addBoneName(const std::string &strBoneName, int boneId)
Creates or overwrites a string-to-boneId mapping.
Definition coremodel.cpp:1755
int loadCoreAnimatedMorph(const std::string &strFilename)
Loads a core animatedMorph.
Definition coremodel.cpp:962
int unloadCoreAnimatedMorph(const std::string &name)
Delete the resources used by the named core animated morph.
Definition coremodel.cpp:1073
void replaceCoreMesh(int coreMeshId, CalCoreMesh *pCoreMesh)
Replaces a core mesh.
Definition coremodel.cpp:365
int getCoreMeshCount() const
Returns the number of core meshes.
Definition coremodel.cpp:688
int getCoreAnimationCount() const
Returns the number of core animations.
Definition coremodel.cpp:479
int addCoreAnimation(CalCoreAnimation *pCoreAnimation)
Adds a core animation.
Definition coremodel.cpp:126
int unloadCoreMesh(const std::string &name)
Delete the resources used by the named core mesh.
Definition coremodel.cpp:1460
int unloadCoreAnimation(const std::string &name)
Delete the resources used by the named core animation.
Definition coremodel.cpp:879
bool setCoreMaterialId(int coreMaterialThreadId, int coreMaterialSetId, int coreMaterialId)
Sets a core material ID.
Definition coremodel.cpp:1697
bool loadCoreSkeleton(const std::string &strFilename)
Loads the core skeleton.
Definition coremodel.cpp:1507
bool saveCoreAnimation(const std::string &strFilename, int coreAnimationId) const
Saves a core animation.
Definition coremodel.cpp:1548
const std::string & getName() const
Returns the name.
Definition coremodel.cpp:378
void setCoreSkeleton(CalCoreSkeleton *pCoreSkeleton)
Sets the core skeleton.
Definition coremodel.cpp:1728
CalCoreModel(const std::string &name)
Constructs the core model instance.
Definition coremodel.cpp:41
bool saveCoreMaterial(const std::string &strFilename, int coreMaterialId) const
Saves a core material.
Definition coremodel.cpp:1618
Cal::UserData getUserData()
Provides access to the user data.
Definition coremodel.cpp:731
int getCoreMaterialId(int coreMaterialThreadId, int coreMaterialSetId) const
Returns a specified core material ID.
Definition coremodel.cpp:608
void scale(float factor)
Scale the core model.
Definition coremodel.cpp:2066
bool saveCoreSkeleton(const std::string &strFilename) const
Saves the core skeleton.
Definition coremodel.cpp:1669
int loadCoreMaterial(const std::string &strFilename)
Loads a core material.
Definition coremodel.cpp:1120
int loadCoreMesh(const std::string &strFilename)
Loads a core mesh.
Definition coremodel.cpp:1313
int getBoneId(const std::string &strBoneName) const
Retrieves the ID of the bone referenced by a string.
Definition coremodel.cpp:1776
int getCoreMaterialCount() const
Returns the number of core materials.
Definition coremodel.cpp:589
bool saveCoreMesh(const std::string &strFilename, int coreMeshId) const
Saves a core mesh.
Definition coremodel.cpp:1644
CalCoreAnimatedMorph * getCoreAnimatedMorph(int coreAnimatedMorphId)
Provides access to a core morph animation.
Definition coremodel.cpp:496
int unloadCoreMaterial(const std::string &name)
Delete the resources used by the named core material.
Definition coremodel.cpp:1266
CalCoreMesh * getCoreMesh(int coreMeshId)
Provides access to a core mesh.
Definition coremodel.cpp:646
void cloneCoreMaterials()
Replace each core material by a copy.
Definition coremodel.cpp:314
bool addMaterialName(const std::string &strMaterialName, int coreMaterialId)
Creates or overwrites a string-to-core-material ID mapping.
Definition coremodel.cpp:1897
int addCoreMaterial(CalCoreMaterial *pCoreMaterial)
Adds a core material.
Definition coremodel.cpp:292
CalCoreMaterial * getCoreMaterial(int coreMaterialId)
Provides access to a core material.
Definition coremodel.cpp:546
int getCoreAnimatedMorphId(const std::string &strAnimatedMorphName) const
Retrieves the ID of the animated morph referenced by a string.
Definition coremodel.cpp:236
void setName(const char *inName)
Changes the name.
Definition coremodel.cpp:390
bool addAnimationName(const std::string &strAnimationName, int coreAnimationId)
Creates or overwrites a string-to-animation ID mapping.
Definition coremodel.cpp:1798
int addCoreAnimatedMorph(CalCoreAnimatedMorph *pCoreAnimatedMorph)
Adds a core animated morph (different from a morph animation).
Definition coremodel.cpp:209
int getCoreMeshId(const std::string &strMeshName) const
Retrieves the ID of the core mesh referenced by a string.
Definition coremodel.cpp:2009
CalCoreSkeleton * getCoreSkeleton()
Provides access to the core skeleton.
Definition coremodel.cpp:703
bool createCoreMaterialThread(int coreMaterialThreadId)
Creates a core material thread.
Definition coremodel.cpp:409
int loadCoreAnimation(const std::string &strFilename)
Loads a core animation.
Definition coremodel.cpp:762
bool addMeshName(const std::string &strMeshName, int coreMeshId)
Creates or overwrites a string-to-core-mesh ID mapping.
Definition coremodel.cpp:1984
void setUserData(Cal::UserData userData)
Stores user data.
Definition coremodel.cpp:1741
int getCoreAnimationId(const std::string &strAnimationName) const
Retrieves the ID of the animation referenced by a string.
Definition coremodel.cpp:1837
int addCoreMesh(CalCoreMesh *pCoreMesh)
Adds a core mesh.
Definition coremodel.cpp:339
Definition coreskeleton.h:25