00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CAL_BONE_H
00012 #define CAL_BONE_H
00013
00014
00015
00016
00017
00018 #include "cal3d/global.h"
00019 #include "cal3d/vector.h"
00020 #include "cal3d/quaternion.h"
00021 #include "cal3d/matrix.h"
00022 #include "cal3d/corebone.h"
00023
00024
00025
00026
00027
00028
00029 class CalSkeleton;
00030 class CalModel;
00031 class CalCoreModel;
00032
00033
00034
00035
00036
00037
00038
00042 class CAL3D_API CalBone
00043 {
00044
00045 protected:
00046 CalCoreBone *m_pCoreBone;
00047 CalSkeleton *m_pSkeleton;
00048 float m_accumulatedWeight;
00049 float m_accumulatedWeightAbsolute;
00050 CalVector m_translation;
00051 CalQuaternion m_rotation;
00052 CalVector m_translationAbsolute;
00053 CalQuaternion m_rotationAbsolute;
00054 CalVector m_translationBoneSpace;
00055 CalQuaternion m_rotationBoneSpace;
00056 CalMatrix m_transformMatrix;
00057
00058 CalBoundingBox m_boundingBox;
00059
00060
00061
00062 public:
00063 CalBone();
00064 virtual ~CalBone();
00065
00066
00067 public:
00068 void blendState(float weight, const CalVector& translation, const CalQuaternion& rotation);
00069 void calculateState();
00070 void clearState();
00071 bool create(CalCoreBone *pCoreBone);
00072 void destroy();
00073 CalCoreBone *getCoreBone();
00074 void setCoreState();
00075 void setCoreStateRecursive();
00076 void setRotation(const CalQuaternion& rotation);
00077 const CalQuaternion& getRotation();
00078 const CalQuaternion& getRotationAbsolute();
00079 const CalQuaternion& getRotationBoneSpace();
00080 void setTranslation(const CalVector& translation);
00081 const CalVector& getTranslation();
00082 const CalVector& getTranslationAbsolute();
00083 const CalVector& getTranslationBoneSpace();
00084 const CalMatrix& getTransformMatrix();
00085 void lockState();
00086 void setSkeleton(CalSkeleton *pSkeleton);
00087 void calculateBoundingBox();
00088 CalBoundingBox & getBoundingBox();
00089
00090
00091 };
00092
00093 #endif
00094
00095