00001 #ifndef KEYFRAMES_H_KMD123
00002 #define KEYFRAMES_H_KMD123
00003
00004 #include "global.h"
00005
00010 class Key {
00011 public:
00012 Key() {}
00013 Key( float time ) : time( time ) {}
00014
00015 float time;
00016
00017 bool operator < ( const Key& rhs ) const;
00018
00019 bool operator > ( const Key& rhs ) const;
00020
00021 bool operator < ( float rhs ) const;
00022
00023 bool operator > ( float rhs ) const;
00024
00025 bool operator >= ( float rhs ) const;
00026
00027 bool operator <= ( float rhs ) const;
00028 };
00029
00033 class RotKey : public Key {
00034 public:
00035 RotKey() {}
00036 RotKey( float time, const Quaternion& rot ) : Key( time ), rot(rot) {}
00037
00038 Quaternion rot;
00039
00043 RotKey interp( const RotKey& next, float atTime ) const;
00044 };
00045
00049 class VectKey : public Key {
00050 public:
00051 VectKey() {}
00052 VectKey( float time, const Vector& v ) : Key( time ), v(v) {}
00053
00054 Vector v;
00055
00059 VectKey interp( const VectKey& next, float atTime ) const;
00060 };
00061
00062 typedef std::vector<RotKey> RKeyList;
00063 typedef RKeyList::iterator RKeyListIter;
00064 typedef RKeyList::const_iterator RKeyListCIter;
00065
00066 typedef std::vector<VectKey> SKeyList;
00067 typedef SKeyList::iterator SKeyListIter;
00068 typedef SKeyList::const_iterator SKeyListCIter;
00069
00070 typedef std::vector<VectKey> TKeyList;
00071 typedef TKeyList::iterator TKeyListIter;
00072 typedef TKeyList::const_iterator TKeyListCIter;
00073
00080 struct AnimationKeys {
00081 std::string boneName;
00082 RKeyList rKeys;
00083 SKeyList sKeys;
00084 TKeyList tKeys;
00085 };
00086
00087 typedef std::vector<AnimationKeys> AKeysList;
00088 typedef AKeysList::iterator AKeysListIter;
00089 typedef AKeysList::const_iterator AKeysListCIter;
00090
00091 #endif
00092