- Timestamp:
- Apr 17, 2005, 1:56:03 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/animation.cc
r3847 r3853 19 19 #include "animation_player.h" 20 20 21 21 /** 22 \brief creates a new Animation 23 24 This also adds the Animation automatically to the AnimationPlayer's list 25 */ 22 26 Animation::Animation(void) 23 27 { … … 34 38 } 35 39 40 /** 41 \brief destructs the Animation 42 43 this also takes the animation out of the AnimationPlayer's list (if it is there) 44 */ 36 45 Animation::~Animation(void) 37 46 { … … 39 48 } 40 49 50 /** 51 \brief tells the AnimationPlayer, that we do not wish to handle this animation 52 automatically. 53 54 This means that it will not be ticked, and not be deleted with the AnimationPlayer 55 */ 41 56 void Animation::doNotHandle(void) 42 57 { … … 45 60 } 46 61 47 62 /** 63 \brief Sets the infinitymode 64 \param postInfinity How the Animation should advance after the last Keyframe 65 */ 48 66 void Animation::setInfinity(ANIM_INFINITY postInfinity) 49 67 { … … 51 69 } 52 70 53 71 /** 72 \brief plays the animation back from the current Time forward 73 */ 54 74 void Animation::play() 55 75 { … … 57 77 } 58 78 59 79 /** 80 \brief Stops the animation. eg. pause(); rewind(); 81 */ 60 82 void Animation::stop() 61 83 { … … 65 87 this->bRunning = false; 66 88 } 89 90 /** 91 \brief Pauses the animation. Stays at the current Time 92 */ 67 93 void Animation::pause() 68 94 { 69 95 this->bRunning = false; 70 96 } 97 98 /** 99 \brief replays the animation, eg. rewind();play(); 100 */ 71 101 void Animation::replay() 72 102 { -
orxonox/trunk/src/animation.h
r3852 r3853 14 14 #define DELTA_X 0.05 //!< the percentag of the distance that doesnt have to be done by neg_exp (asymptotical) ~ maschinendelta 15 15 16 //! An enumerator of Functions to describe the flow of the Animation 16 17 typedef enum ANIM_FUNCTION {ANIM_CONSTANT, 17 18 ANIM_LINEAR, … … 23 24 ANIM_RANDOM}; 24 25 26 //! An enumerator describing what the animation should do after the last keyframe. 25 27 typedef enum ANIM_INFINITY {ANIM_INF_CONSTANT, 26 28 ANIM_INF_LINEAR, … … 28 30 ANIM_INF_REWIND};//, ANIM_DELETE} 29 31 32 //! A Struct for Keyframes that simply hold a float 30 33 typedef struct KeyFrameF 31 34 { 32 float duration; 33 float value; 34 ANIM_FUNCTION animFunc; 35 float duration; //!< duration of this keyframe 36 float value; //!< value of this keyframe 37 ANIM_FUNCTION animFunc; //!< with whitch function to iterate to the next KeyFrameF 35 38 }; 36 39 40 //! A Superclass for describing an animation (all animations will be derived from this one) 41 /** implement in subclasses: 42 * 43 * De-/Constructor 44 * Animation Functions 45 * virtual tick 46 * List of keyFrames 47 * currentKeyFrame/nextKeyFrame 48 * virtual rewind, to go to the first Keyframe. (other functions will call this one) 49 */ 37 50 class Animation 38 51 { … … 47 60 void pause(); 48 61 void replay(); 62 //! A virtual function that should change to the first keyframe. 49 63 virtual void rewind() = 0; 50 64 /** \brief A virtual function that ticks the animation \param dt the time passed */ 51 65 virtual void tick(float dt) = 0; 52 53 /* implement in subclasses:54 *55 * De-/Constructor56 * Animation Functions57 * virtual tick58 * List of keyFrames59 * currentKeyFrame/nextKeyFrame60 * virtual rewind, to go to the first Keyframe. (other functions will call this one)61 */62 66 63 67 /** … … 70 74 71 75 // variables 72 73 float localTime; 74 ANIM_INFINITY postInfinity; 76 float localTime; //!< The Time passed since the beginning of the currentKeyFrame. 77 ANIM_INFINITY postInfinity; //!< describing what the animation should do after the last keyframe. 75 78 76 79 BaseObject* baseObject; //!< The same as object in the derived classes, but with reference to BaseObject 77 bool bHasKeys; 80 bool bHasKeys; //!< If the animation has any keys at all. Needed to add the first keyframe (and delete the dummy). 78 81 bool bHandled; //!< If this Animation is handled by the AnimationPlayer. 79 bool bRunning; 82 bool bRunning; //!< If the animation is running 80 83 }; 81 84 -
orxonox/trunk/src/animation3d.cc
r3852 r3853 113 113 { 114 114 case ANIM_INF_CONSTANT: 115 this->localTime = 0.0; 115 116 this->bRunning = false; 116 117 break; -
orxonox/trunk/src/t_animation.h
r3852 r3853 171 171 { 172 172 case ANIM_INF_CONSTANT: 173 this->localTime = 0.0; 173 174 this->bRunning = false; 174 175 break;
Note: See TracChangeset
for help on using the changeset viewer.