Last change
on this file since 3858 was
3847,
checked in by bensch, 20 years ago
|
orxonox/trunk: naming of animation changed
Anim → Animation
tAnim → tAnimation
Animation → Animation3D
@paede: i hope you like it.
|
File size:
1.6 KB
|
Rev | Line | |
---|
[3245] | 1 | /*! |
---|
[3812] | 2 | \file animation_player.h |
---|
[3245] | 3 | */ |
---|
[1853] | 4 | |
---|
[3812] | 5 | #ifndef _ANIMATION_PLAYER_H |
---|
| 6 | #define _ANIMATION_PLAYER_H |
---|
[1853] | 7 | |
---|
[3543] | 8 | #include "base_object.h" |
---|
[3812] | 9 | #include "animation.h" |
---|
[1853] | 10 | |
---|
[3812] | 11 | /* FORWARD DEFINITION */ |
---|
[3543] | 12 | |
---|
[3812] | 13 | //! A AnimationPlayer, that handles the animation of all the Animations in the scene. |
---|
[3820] | 14 | /** |
---|
| 15 | <b>AnimationPlayer usage:</b> \n |
---|
| 16 | |
---|
| 17 | <b>Initialisation</b>: AnimationPlayer::getInstance() does the trick this is |
---|
| 18 | usually done when initializing a world \n |
---|
| 19 | <b>Adding Animations</b>: create an Animation the following Way: |
---|
| 20 | \li Anim* animation = new Anim(); // also use any other Subclass of Animation to initialize this |
---|
| 21 | \li set some parameters: also see the specific classes for more info |
---|
| 22 | \n |
---|
| 23 | if you do not want a specific Animation to be handled by the AnimationPlayer, you have to |
---|
| 24 | unload it explicitely with animation->doNotHandle(); |
---|
| 25 | \n |
---|
| 26 | eveything else will be done by the AnimationPlayer itself.\n |
---|
| 27 | */ |
---|
[3812] | 28 | class AnimationPlayer : public BaseObject { |
---|
[3543] | 29 | |
---|
[3812] | 30 | public: |
---|
| 31 | static AnimationPlayer* getInstance(void); |
---|
| 32 | virtual ~AnimationPlayer(void); |
---|
[2036] | 33 | |
---|
[3821] | 34 | // animation handling |
---|
[3847] | 35 | void addAnimation(Animation* animation); |
---|
| 36 | void removeAnimation(Animation* animation); |
---|
[3816] | 37 | void flush(void); |
---|
[1853] | 38 | |
---|
[3821] | 39 | // time functions |
---|
[3812] | 40 | void tick(float timePassed); |
---|
[3821] | 41 | void play(void); |
---|
| 42 | void pause(void); |
---|
[1853] | 43 | |
---|
[3847] | 44 | Animation* getObjectFromBaseObject(const BaseObject* baseObject) const; |
---|
[3833] | 45 | |
---|
[3816] | 46 | void debug(void); |
---|
| 47 | |
---|
[3245] | 48 | private: |
---|
[3812] | 49 | /* singleton */ |
---|
| 50 | AnimationPlayer(void); |
---|
| 51 | static AnimationPlayer* singletonRef; |
---|
[3245] | 52 | |
---|
[3812] | 53 | /* class specific */ |
---|
[3847] | 54 | tList<Animation>* animationList; //!< A List of Animations to be handled. |
---|
[3821] | 55 | bool bRunning; //!< If the AnimationPlayer is running. |
---|
[1853] | 56 | }; |
---|
| 57 | |
---|
[3812] | 58 | |
---|
| 59 | #endif /* _ANIMATION_PLAYER_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.