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 | |
---|
5 | using namespace Ogre; |
---|
6 | |
---|
7 | class AnimationBlender |
---|
8 | { |
---|
9 | public: |
---|
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 | |
---|
17 | private: |
---|
18 | Entity *mEntity; |
---|
19 | AnimationState *mSource; |
---|
20 | AnimationState *mTarget; |
---|
21 | |
---|
22 | BlendingTransition mTransition; |
---|
23 | |
---|
24 | bool loop; |
---|
25 | |
---|
26 | ~AnimationBlender() {} |
---|
27 | |
---|
28 | public: |
---|
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.