Main Page   Class Hierarchy   Compound List   File List   Compound Members  

Bone.h

00001 #ifndef BONE_H_JMF695
00002 #define BONE_H_JMF695
00003 
00004 #include "global.h"
00005 
00006 class Bone;
00007 typedef std::vector<Bone*> BoneList;
00008 typedef BoneList::iterator BoneListIter;
00009 typedef BoneList::const_iterator BoneListCIter;
00010 
00011 class StaticModel;
00012 
00023 class Bone {
00024 public:
00033     Bone();
00034 
00043     Bone( const std::string& name, const Matrix& refMat, const Matrix& offMat );
00044 
00048     ~Bone();
00049 
00053     void setName( std::string& name );
00054 
00058     void setReferenceMatrix( const Matrix& m );
00059 
00063     void setOffsetMatrix( const Matrix& m );
00064     
00068     const std::string& getName() const;
00069 
00075     void loadBoneNameSet( BoneNameSet& boneSet, bool incParent, bool incChildren ) const;
00076 
00086     Bone* findBone( const std::string& boneName );
00087 
00091     void setTransform( const Matrix& newMat );
00092 
00097     void applyNewTransform( const Matrix& newMat );
00098 
00103     void updateHierarchy( const Matrix& worldMat );
00104 
00108     const Matrix& getFinalMatrix() const;
00109 
00113     const Matrix& getReferenceMatrix() const;
00114 
00119     void loadSkinMatrix( Matrix& m ) const;
00120 
00125     Bone* getParent();
00126 
00134     BoneListIter beginChildren();
00135 
00143     BoneListIter endChildren();
00144 
00160     void addChild( Bone* newChild );
00161 
00168     void debugRender( StaticModel& m );
00169 
00173     void printHierarchy( std::ostream& o, int level = 0 );
00174 
00175 private:
00176     Bone( const Bone& other );
00177     Bone& operator=( const Bone& rhs );
00178 
00179     std::string name; //name of the bone
00180 
00181     Matrix refMat;    //reference "pose" matrix
00182     Matrix offMat;    //offset matrix
00183     Matrix transMat;  //transform for this Bone only
00184     Matrix finalMat;  //current final transformed matrix
00185 
00186     Bone* parent;
00187 
00188     BoneList children;
00189 };
00190 
00191 #endif
00192 

Generated on Wed May 14 01:38:07 2003 for CG Skeletal Animation Project by doxygen1.2.18