- 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   enum CompositionFunction {
00043     CompositionFunctionNull = 0,
00044     CompositionFunctionReplace,
00045     CompositionFunctionAverage,
00046     CompositionFunctionCrossFade
00047   };
00048 
00049 protected:
00050   CalAnimation(CalCoreAnimation *pCoreAnimation);
00051 public:
00052     virtual ~CalAnimation() {  }
00053 
00054   CalCoreAnimation *getCoreAnimation();
00055   const CalCoreAnimation *getCoreAnimation() const;
00056   State getState() const;
00057   float getTime() const;
00058   Type getType() const;
00059   float getWeight() const;
00060   void setTime(float time);
00061   void setTimeFactor(float timeFactor);
00062   float getTimeFactor() const;
00063 
00064   void checkCallbacks(float animationTime, CalModel *model);
00065   void completeCallbacks(CalModel *model);
00066 
00067 protected:
00068   void setType(Type type) {
00069     m_type = type;
00070   }
00071 
00072   void setState(State state) {
00073     m_state = state;
00074   }
00075 
00076   void setWeight(float weight) {
00077     m_weight = weight;
00078   }
00079 
00080 
00081 private:
00082 
00083   CalCoreAnimation *m_pCoreAnimation;
00084   std::vector<float> m_lastCallbackTimes;
00085   Type m_type;
00086   State m_state;
00087   float m_time;
00088   float m_timeFactor;
00089   float m_weight;
00090 };
00091 
00092 #endif
00093 
00094 //****************************************************************************//

Generated by The Cal3D Team with Doxygen 1.7.3