00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CAL_COREBONE_H
00012 #define CAL_COREBONE_H
00013
00014
00015 #include "cal3d/global.h"
00016 #include "cal3d/matrix.h"
00017 #include "cal3d/vector.h"
00018 #include "cal3d/quaternion.h"
00019
00020
00021 class CalCoreSkeleton;
00022 class CalCoreModel;
00023
00024
00025 class CAL3D_API CalCoreBone
00026 {
00027 public:
00028 CalCoreBone(const std::string& name);
00029 ~CalCoreBone() { }
00030
00031 bool addChildId(int childId);
00032 void calculateState();
00033 std::list<int>& getListChildId();
00034 const std::string& getName();
00035 int getParentId();
00036 CalCoreSkeleton *getCoreSkeleton();
00037 const CalQuaternion& getRotation();
00038 const CalQuaternion& getRotationAbsolute();
00039 const CalQuaternion& getRotationBoneSpace();
00040 const CalVector& getTranslation();
00041 const CalVector& getTranslationAbsolute();
00042 const CalVector& getTranslationBoneSpace();
00043 Cal::UserData getUserData();
00044 void setCoreSkeleton(CalCoreSkeleton *pCoreSkeleton);
00045 void setParentId(int parentId);
00046 void setRotation(const CalQuaternion& rotation);
00047 void setRotationBoneSpace(const CalQuaternion& rotation);
00048 void setTranslation(const CalVector& translation);
00049 void setTranslationBoneSpace(const CalVector& translation);
00050 void setUserData(Cal::UserData userData);
00051
00052 void calculateBoundingBox(CalCoreModel * pCoreModel);
00053 CalBoundingBox & getBoundingBox();
00054 void getBoundingData(int planeId,CalVector & position);
00055 bool isBoundingBoxPrecomputed();
00056 void scale(float factor);
00057
00058 private:
00059 std::string m_strName;
00060 CalCoreSkeleton *m_pCoreSkeleton;
00061 int m_parentId;
00062 std::list<int> m_listChildId;
00063 CalVector m_translation;
00064 CalQuaternion m_rotation;
00065 CalVector m_translationAbsolute;
00066 CalQuaternion m_rotationAbsolute;
00067 CalVector m_translationBoneSpace;
00068 CalQuaternion m_rotationBoneSpace;
00069 Cal::UserData m_userData;
00070
00071 CalBoundingBox m_boundingBox;
00072 CalVector m_boundingPosition[6];
00073 bool m_boundingBoxPrecomputed;
00074 };
00075
00076 #endif
00077
00078