- Cal3D 0.11 API Reference -

animation.h

00001 //****************************************************************************//
00002 // animation.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_ANIMATION_H
00012 #define CAL_ANIMATION_H
00013 
00014 
00015 #include "cal3d/global.h"
00016 
00017 
00018 class CalCoreAnimation;
00019 class CalModel;
00020 
00021 class CAL3D_API CalAnimation
00022 {
00023 public:
00024   enum Type
00025   {
00026     TYPE_NONE = 0,
00027     TYPE_CYCLE,
00028     TYPE_POSE,
00029     TYPE_ACTION
00030   };
00031 
00032   enum State
00033   {
00034     STATE_NONE = 0,
00035     STATE_SYNC,
00036     STATE_ASYNC,
00037     STATE_IN,
00038     STATE_STEADY,
00039     STATE_OUT,
00040     STATE_STOPPED
00041   };
00042 
00043 protected:
00044   CalAnimation(CalCoreAnimation* pCoreAnimation);
00045 public:
00046     virtual ~CalAnimation() {  }
00047 
00048   CalCoreAnimation *getCoreAnimation();
00049   State getState();
00050   float getTime();
00051   Type getType();
00052   float getWeight();
00053   void setTime(float time);
00054   void setTimeFactor(float timeFactor);
00055   float getTimeFactor();
00056 
00057   void checkCallbacks(float animationTime,CalModel *model);
00058   void completeCallbacks(CalModel *model);
00059 
00060 protected:
00061   void setType(Type type) {
00062     m_type = type;
00063   }
00064 
00065   void setState(State state) {
00066     m_state = state;
00067   }
00068 
00069   void setWeight(float weight) {
00070     m_weight = weight;
00071   }
00072 
00073 
00074 private:
00075 
00076   CalCoreAnimation *m_pCoreAnimation;
00077   std::vector<float> m_lastCallbackTimes;
00078   Type m_type;
00079   State m_state;
00080   float m_time;
00081   float m_timeFactor;
00082   float m_weight;
00083 };
00084 
00085 #endif
00086 
00087 //****************************************************************************//

Generated at Thu Jun 29 19:03:59 2006 by The Cal3D Team with Doxygen 1.4.6