00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CAL_CORESKELETON_H
00012 #define CAL_CORESKELETON_H
00013
00014 #include "cal3d/global.h"
00015 #include "cal3d/vector.h"
00016 #include "cal3d/refcounted.h"
00017 #include "cal3d/refptr.h"
00018
00019
00020 class CalCoreBone;
00021 class CalCoreModel;
00022
00023
00024 class CAL3D_API CalCoreSkeleton : public cal3d::RefCounted
00025 {
00026 protected:
00027 ~CalCoreSkeleton();
00028
00029 public:
00030 CalCoreSkeleton();
00031
00032 int addCoreBone(CalCoreBone *pCoreBone);
00033 void calculateState();
00034 CalCoreBone *getCoreBone(int coreBoneId);
00035 const CalCoreBone *getCoreBone(int coreBoneId) const;
00036 CalCoreBone *getCoreBone(const std::string& strName);
00037 const CalCoreBone *getCoreBone(const std::string& strName) const;
00038 int getCoreBoneId(const std::string& strName) const;
00039 bool mapCoreBoneName(int coreBoneId, const std::string& strName);
00040 std::vector<int>& getVectorRootCoreBoneId();
00041 const std::vector<int>& getVectorRootCoreBoneId() const;
00042 std::vector<CalCoreBone *>& getVectorCoreBone();
00043 const std::vector<CalCoreBone *>& getVectorCoreBone() const;
00044 void calculateBoundingBoxes(CalCoreModel *pCoreModel);
00045 void scale(float factor);
00046 unsigned int getNumCoreBones() const { return ( unsigned int ) m_vectorCoreBone.size(); }
00047 void setSceneAmbientColor( CalVector const & color );
00048 void getSceneAmbientColor( CalVector & color ) const;
00049 void setName(const std::string& name);
00050 const std::string& getName(void) const;
00051
00052 private:
00053 std::vector<CalCoreBone *> m_vectorCoreBone;
00054 std::map< std::string, int > m_mapCoreBoneNames;
00055 std::vector<int> m_vectorRootCoreBoneId;
00056 CalVector m_sceneAmbientColor;
00057 std::string m_name;
00058 };
00059 typedef cal3d::RefPtr<CalCoreSkeleton> CalCoreSkeletonPtr;
00060
00061 #endif
00062
00063