- Cal3D 0.9 API Reference - |
00001 //****************************************************************************// 00002 // corebone.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_COREBONE_H 00012 #define CAL_COREBONE_H 00013 00014 //****************************************************************************// 00015 // Includes // 00016 //****************************************************************************// 00017 00018 #include "cal3d/global.h" 00019 #include "cal3d/matrix.h" 00020 #include "cal3d/vector.h" 00021 #include "cal3d/quaternion.h" 00022 00023 //****************************************************************************// 00024 // Forward declarations // 00025 //****************************************************************************// 00026 00027 class CalCoreSkeleton; 00028 class CalCoreModel; 00029 00030 //****************************************************************************// 00031 // Class declaration // 00032 //****************************************************************************// 00033 00034 00035 /*****************************************************************************/ 00039 class CAL3D_API CalCoreBone 00040 { 00041 // member variables 00042 protected: 00043 std::string m_strName; 00044 CalCoreSkeleton *m_pCoreSkeleton; 00045 int m_parentId; 00046 std::list<int> m_listChildId; 00047 CalVector m_translation; 00048 CalQuaternion m_rotation; 00049 CalVector m_translationAbsolute; 00050 CalQuaternion m_rotationAbsolute; 00051 CalVector m_translationBoneSpace; 00052 CalQuaternion m_rotationBoneSpace; 00053 Cal::UserData m_userData; 00054 00055 CalBoundingBox m_boundingBox; 00056 CalVector m_boundingPosition[6]; 00057 bool m_boundingBoxPrecomputed; 00058 00059 00060 // constructors/destructor 00061 public: 00062 CalCoreBone(); 00063 virtual ~CalCoreBone(); 00064 00065 // member functions 00066 public: 00067 bool addChildId(int childId); 00068 void calculateState(); 00069 bool create(const std::string& strName); 00070 void destroy(); 00071 std::list<int>& getListChildId(); 00072 const std::string& getName(); 00073 int getParentId(); 00074 CalCoreSkeleton *getCoreSkeleton(); 00075 const CalQuaternion& getRotation(); 00076 const CalQuaternion& getRotationAbsolute(); 00077 const CalQuaternion& getRotationBoneSpace(); 00078 const CalVector& getTranslation(); 00079 const CalVector& getTranslationAbsolute(); 00080 const CalVector& getTranslationBoneSpace(); 00081 Cal::UserData getUserData(); 00082 void setCoreSkeleton(CalCoreSkeleton *pCoreSkeleton); 00083 void setParentId(int parentId); 00084 void setRotation(const CalQuaternion& rotation); 00085 void setRotationBoneSpace(const CalQuaternion& rotation); 00086 void setTranslation(const CalVector& translation); 00087 void setTranslationBoneSpace(const CalVector& translation); 00088 void setUserData(Cal::UserData userData); 00089 00090 void calculateBoundingBox(CalCoreModel * pCoreModel); 00091 CalBoundingBox & getBoundingBox(); 00092 void getBoundingData(int planeId,CalVector & position); 00093 bool isBoundingBoxPrecomputed(); 00094 void scale(float factor); 00095 00096 }; 00097 00098 #endif 00099 00100 //****************************************************************************//