- Cal3D 0.9 API Reference - |
00001 //****************************************************************************// 00002 // model.h // 00003 // Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger // 00004 //****************************************************************************// 00005 // This library is free software; you can redistribute it and/or modify it // 00006 // under the terms of the GNU Lesser General Public License as published by // 00007 // the Free Software Foundation; either version 2.1 of the License, or (at // 00008 // your option) any later version. // 00009 //****************************************************************************// 00010 00011 #ifndef CAL_MODEL_H 00012 #define CAL_MODEL_H 00013 00014 //****************************************************************************// 00015 // Includes // 00016 //****************************************************************************// 00017 00018 #include "cal3d/global.h" 00019 #include "cal3d/vector.h" 00020 00021 00022 //****************************************************************************// 00023 // Forward declarations // 00024 //****************************************************************************// 00025 00026 class CalCoreModel; 00027 class CalSkeleton; 00028 class CalAbstractMixer; 00029 class CalMixer; 00030 class CalMorphTargetMixer; 00031 class CalPhysique; 00032 class CalSpringSystem; 00033 class CalRenderer; 00034 class CalMesh; 00035 00036 //****************************************************************************// 00037 // Class declaration // 00038 //****************************************************************************// 00039 00040 /*****************************************************************************/ 00044 class CAL3D_API CalModel 00045 { 00046 // member variables 00047 protected: 00048 CalCoreModel *m_pCoreModel; 00049 CalSkeleton *m_pSkeleton; 00050 CalAbstractMixer *m_pMixer; 00051 CalMorphTargetMixer *m_pMorphTargetMixer; 00052 CalPhysique *m_pPhysique; 00053 CalSpringSystem *m_pSpringSystem; 00054 CalRenderer *m_pRenderer; 00055 Cal::UserData m_userData; 00056 std::vector<CalMesh *> m_vectorMesh; 00057 CalBoundingBox m_boundingBox; 00058 00059 // constructors/destructor 00060 public: 00061 CalModel(); 00062 virtual ~CalModel(); 00063 00064 // member functions 00065 public: 00066 bool attachMesh(int coreMeshId); 00067 bool create(CalCoreModel *pCoreModel); 00068 void destroy(); 00069 bool detachMesh(int coreMeshId); 00070 CalCoreModel *getCoreModel() const; 00071 CalMesh *getMesh(int coreMeshId) const; 00072 CalMixer *getMixer() const; 00073 CalAbstractMixer *getAbstractMixer() const; 00074 void setAbstractMixer(CalAbstractMixer* pMixer); 00075 CalMorphTargetMixer *getMorphTargetMixer() const; 00076 CalPhysique *getPhysique() const; 00077 CalRenderer *getRenderer() const; 00078 CalSkeleton *getSkeleton() const; 00079 CalSpringSystem *getSpringSystem() const; 00080 CalBoundingBox & getBoundingBox(bool precision = false); 00081 Cal::UserData getUserData() const; 00082 std::vector<CalMesh *>& getVectorMesh(); 00083 void setLodLevel(float lodLevel); 00084 void setMaterialSet(int setId); 00085 void setUserData(Cal::UserData userData); 00086 void update(float deltaTime); 00087 void disableInternalData(); 00088 }; 00089 00090 #endif 00091 00092 //****************************************************************************//