- Cal3D 0.9 API Reference - |
00001 //****************************************************************************// 00002 // bone.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_BONE_H 00012 #define CAL_BONE_H 00013 00014 //****************************************************************************// 00015 // Includes // 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 // Forward declarations // 00026 //****************************************************************************// 00027 00028 //class CalCoreBone; 00029 class CalSkeleton; 00030 class CalModel; 00031 class CalCoreModel; 00032 //class CalBoundingBox; 00033 00034 //****************************************************************************// 00035 // Class declaration // 00036 //****************************************************************************// 00037 00038 /*****************************************************************************/ 00042 class CAL3D_API CalBone 00043 { 00044 // member variables 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 CalBoundingBox m_boundingBox; 00058 00059 00060 // constructors/destructor 00061 public: 00062 CalBone(); 00063 virtual ~CalBone(); 00064 00065 // member functions 00066 public: 00067 void blendState(float weight, const CalVector& translation, const CalQuaternion& rotation); 00068 void calculateState(); 00069 void clearState(); 00070 bool create(CalCoreBone *pCoreBone); 00071 void destroy(); 00072 CalCoreBone *getCoreBone(); 00073 void setCoreState(); 00074 void setCoreStateRecursive(); 00075 void setRotation(const CalQuaternion& rotation); 00076 const CalQuaternion& getRotation(); 00077 const CalQuaternion& getRotationAbsolute(); 00078 const CalQuaternion& getRotationBoneSpace(); 00079 void setTranslation(const CalVector& translation); 00080 const CalVector& getTranslation(); 00081 const CalVector& getTranslationAbsolute(); 00082 const CalVector& getTranslationBoneSpace(); 00083 const CalMatrix& getTransformMatrix(); 00084 void lockState(); 00085 void setSkeleton(CalSkeleton *pSkeleton); 00086 void calculateBoundingBox(); 00087 CalBoundingBox & getBoundingBox(); 00088 00089 00090 }; 00091 00092 #endif 00093 00094 //****************************************************************************//