source:
orxonox.OLD/orxonox/trunk/src/animation.cc
@
3852
| Last change on this file since 3852 was 3847, checked in by bensch, 21 years ago | |
|---|---|
| File size: 1.3 KB | |
| Rev | Line | |
|---|---|---|
| [3782] | 1 | /* |
| 2 | orxonox - the future of 3D-vertical-scrollers | |
| 3 | ||
| 4 | Copyright (C) 2004 orx | |
| 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify | |
| 7 | it under the terms of the GNU General Public License as published by | |
| 8 | the Free Software Foundation; either version 2, or (at your option) | |
| 9 | any later version. | |
| 10 | ||
| 11 | ### File Specific: | |
| 12 | main-programmer: Benjamin Grauer | |
| 13 | co-programmer: ... | |
| 14 | */ | |
| 15 | ||
| 16 | ||
| 17 | #include "animation.h" | |
| 18 | #include "debug.h" | |
| [3812] | 19 | #include "animation_player.h" |
| [3782] | 20 | |
| 21 | ||
| [3847] | 22 | Animation::Animation(void) |
| [3795] | 23 | { |
| [3784] | 24 | // initialize a beginning KeyFrame, that will be deleted afterwards |
| 25 | this->bHasKeys = false; | |
| [3820] | 26 | this->bHandled = true; |
| [3833] | 27 | this->baseObject = NULL; |
| [3784] | 28 | |
| [3785] | 29 | // setting default values |
| [3786] | 30 | this->localTime = 0.0; |
| [3787] | 31 | this->bRunning = true; |
| [3812] | 32 | |
| 33 | AnimationPlayer::getInstance()->addAnimation(this); | |
| [3782] | 34 | } |
| 35 | ||
| [3847] | 36 | Animation::~Animation(void) |
| [3784] | 37 | { |
| [3820] | 38 | this->doNotHandle(); |
| [3784] | 39 | } |
| 40 | ||
| [3847] | 41 | void Animation::doNotHandle(void) |
| [3820] | 42 | { |
| 43 | if (this->bHandled) | |
| 44 | AnimationPlayer::getInstance()->removeAnimation(this); | |
| 45 | } | |
| 46 | ||
| 47 | ||
| [3847] | 48 | void Animation::setInfinity(ANIM_INFINITY postInfinity) |
| [3784] | 49 | { |
| 50 | this->postInfinity = postInfinity; | |
| 51 | } | |
| [3797] | 52 | |
| 53 | ||
| [3847] | 54 | void Animation::play() |
| [3797] | 55 | { |
| 56 | this->bRunning = true; | |
| 57 | } | |
| [3833] | 58 | |
| 59 | ||
| [3847] | 60 | void Animation::stop() |
| [3797] | 61 | { |
| 62 | this->rewind(); | |
| [3798] | 63 | this->bRunning = true; |
| 64 | this->tick(0.0); | |
| [3797] | 65 | this->bRunning = false; |
| 66 | } | |
| [3847] | 67 | void Animation::pause() |
| [3797] | 68 | { |
| 69 | this->bRunning = false; | |
| 70 | } | |
| [3847] | 71 | void Animation::replay() |
| [3797] | 72 | { |
| 73 | this->rewind(); | |
| 74 | this->bRunning = true; | |
| 75 | } |
Note: See TracBrowser
for help on using the repository browser.










