D:/Papagan/490.2006/490.2006/korsan/Papagan/490.2006/korsan/Papagan/Animation.h

Go to the documentation of this file.
00001 
00002 #ifndef ANIMATION_H
00003 #define ANIMATION_H
00004 
00005 #include<Ogre.h>
00006 
00007 using namespace Ogre;
00008 using namespace std;
00009 
00015 class AnimationElement 
00016 {
00017 
00018 protected:
00019         
00020         char* jointName;
00021         int             mStartFrameNo;
00022         int             mEndFrameNo;
00023         float   mAngle;
00024         Vector3 mAxis;
00025         Quaternion*     mQuaternion;
00026         int     id;
00027 
00028 public:
00029         AnimationElement() 
00030         {
00031                 jointName = new char[10];
00032         }
00033         AnimationElement(char* jointName, int aStartFrameNo, int aEndFrameNo, float anAngle, Vector3 anAxis, int id);
00034         ~AnimationElement() 
00035         {
00036         }
00037 
00038         //Bone* getBone();
00039         char* getJointName();
00040         int             getStartFrameNo();
00041         int             getEndFrameNo();
00042         float   getAngle();
00043         Vector3 getAxis();
00044         Quaternion&     getQuaternion();
00045         const char* getAxisName();
00046         int             getId();
00047         void    setId(int id);
00048         void    setStartFrameNo(int sf);
00049         void    setEndFrameNo(int);
00050         void    setAngle(float);
00051         void    setAxis(char* axisName);
00052         void    setJointName(char* jointName);
00053 };
00054 
00059 class PapaganAnimation 
00060 {
00061 protected:
00062         int frameNo;
00063         int maxFrameNo;
00064         int state;
00065         vector<AnimationElement> mSignAnimation;
00066         //Bone *manuallyControlledBone;
00067         Skeleton *skeleton;
00068         void calculateMaxFrameNo();
00069 
00070 public:
00071         PapaganAnimation(Skeleton *skeleton) 
00072         {
00073                 //manuallyControlledBone = NULL;
00074                 frameNo = 0;
00075                 state = 1;
00076                 this->skeleton = skeleton;
00077         }
00078         void addAnimationElement(const AnimationElement &anAnimationElement);
00079         void deleteLast();
00080         void drawAnimationFrame(void); 
00081         //void saveAnimationToFile(char* aFileName);
00082         void saveToXML (char *fileName); 
00083         vector<AnimationElement> getSignAnimation(); 
00084         //void incrementFrameNo(void);
00085         void reset(void); 
00086         bool isEnded(void); 
00087         void setState(int state);
00088         void play(void); 
00089         void setSkeleton(Skeleton* skeleton);
00090         Skeleton * getSkeleton(); 
00091         
00092         void editAnimationXML(char*, int, char* jointName, char* axisName, int startFrame, int endFrame, float angle); 
00093         
00094         int getFrameNo();
00095         int getMaxFrameNo();
00096         int getState();
00097         void rewind(float sliderValue); 
00098 
00099         void setSignAnimation(vector<AnimationElement> &signAnimation);
00100 };
00101 
00102 #endif  ANIMATION_H

Generated on Mon May 29 01:10:33 2006 for Papagan by  doxygen 1.4.6-NO