Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/ogre/Tests/PlayPen/include/AnimationBlender.h @ 56

Last change on this file since 56 was 5, checked in by anonymous, 17 years ago

=hoffentlich gehts jetzt

File size: 977 bytes
Line 
1// From http://www.ogre3d.org/wiki/index.php/AnimationBlender
2
3#include "OgreEntity.h"
4
5using namespace Ogre;
6
7class AnimationBlender
8{
9public:
10        enum BlendingTransition
11        {
12                BlendSwitch,         // stop source and start dest
13                BlendWhileAnimating,   // cross fade, blend source animation out while blending destination animation in
14                BlendThenAnimate      // blend source to first frame of dest, when done, start dest anim
15        };
16
17private:
18        Entity *mEntity;
19        AnimationState *mSource;
20        AnimationState *mTarget;
21
22        BlendingTransition mTransition;
23
24        bool loop;
25
26        ~AnimationBlender() {}
27
28public: 
29        Real mTimeleft, mDuration;
30
31        bool complete;
32
33        void blend( const String &animation, BlendingTransition transition, Real duration, bool loop );
34        void addTime( Real );
35        Real getProgress() { return mTimeleft/ mDuration; }
36        AnimationState *getSource() { return mSource; }
37        AnimationState *getTarget() { return mTarget; }
38        AnimationBlender( Entity *);
39        void init( const String &animation );
40};
Note: See TracBrowser for help on using the repository browser.