Changeset 3854 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Apr 17, 2005, 2:12:23 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/t_animation.h
r3853 r3854 13 13 co-programmer: ... 14 14 */ 15 16 15 17 16 /*! … … 54 53 55 54 // ANIM_FUNCTION animFunc; 56 float (tAnimation<T>::*animFunc)(float) const; 57 KeyFrameF* currentKeyFrame; 58 KeyFrameF* nextKeyFrame; 59 tList<KeyFrameF>* keyFrameList; 60 61 float expFactor; 62 T* object; 63 void (T::*funcToAnim)(float); 55 float (tAnimation<T>::*animFunc)(float) const; //!< A Function for the AnimationType 56 KeyFrameF* currentKeyFrame; //!< The current KeyFrame 57 KeyFrameF* nextKeyFrame; //!< The KeyFrame we iterate to 58 tList<KeyFrameF>* keyFrameList; //!< The KeyFrameList 59 60 T* object; //!< The Object from which to Animate something 61 void (T::*funcToAnim)(float); //!< The function to Animate 62 63 float expFactor; //!< some factors 64 64 65 }; 65 66 … … 68 69 /** 69 70 \brief standard constructor 70 71 71 */ 72 72 template<class T> … … 91 91 /** 92 92 \brief standard deconstructor 93 93 94 deletes all the Keyframes 94 95 */ 95 96 template<class T> … … 106 107 delete itKF; 107 108 delete this->keyFrameList; 108 109 } 110 109 } 110 111 /** 112 \brief rewinds the Animation to the beginning (first KeyFrame and time == 0) 113 */ 111 114 template<class T> 112 115 void tAnimation<T>::rewind(void) … … 117 120 } 118 121 122 /** 123 \brief sets the Function we want to animate 124 \param object from what object do we want to animate 125 \param funcToAnim which function 126 */ 119 127 template<class T> 120 128 void tAnimation<T>::setFuncToAnim(T* object, void (T::*funcToAnim)(float)) … … 124 132 } 125 133 134 /** 135 \brief Appends a new Keyframe 136 \param value the value of the new KeyFrame 137 \param duration The duration from the new KeyFrame to the next one 138 \param animFunc The function to animate between this keyFrame and the next one 139 */ 126 140 template<class T> 127 141 void tAnimation<T>::addKeyFrame(float value, float duration, ANIM_FUNCTION animFunc) … … 152 166 } 153 167 154 168 /** 169 \brief ticks the Animation 170 \param dt how much time to tick 171 */ 155 172 template<class T> 156 173 void tAnimation<T>::tick(float dt) … … 187 204 } 188 205 189 206 /** 207 \brief Sets The kind of Animation between this keyframe and the next one 208 \param animFunc The Type of Animation to set 209 */ 190 210 template<class T> 191 211 void tAnimation<T>::setAnimFunc(ANIM_FUNCTION animFunc) … … 227 247 228 248 // animation functions 249 250 /** 251 \brief some random animation (fluctuating) 252 \param timePassed The time passed since this Keyframe began 253 */ 229 254 template<class T> 230 255 float tAnimation<T>::random(float timePassed) const 231 256 { 232 return (float)rand()/(float)RAND_MAX; 233 } 234 257 return this->currentKeyFrame->value * (float)rand()/(float)RAND_MAX; 258 } 259 260 /** 261 \brief stays at the value of the currentKeyFrame 262 \param timePassed The time passed since this Keyframe began 263 */ 235 264 template<class T> 236 265 float tAnimation<T>::constant(float timePassed) const … … 239 268 } 240 269 270 /** 271 \brief linear interpolation between this keyframe and the next one 272 \param timePassed The time passed since this Keyframe began 273 */ 241 274 template<class T> 242 275 float tAnimation<T>::linear(float timePassed) const … … 248 281 } 249 282 283 /** 284 \brief a Sinusodial Interpolation between this keyframe and the next one 285 \param timePassed The time passed since this Keyframe began 286 */ 250 287 template<class T> 251 288 float tAnimation<T>::sine(float timePassed) const … … 260 297 } 261 298 299 /** 300 \brief a cosine interpolation between this keyframe and the next one 301 \param timePassed The time passed since this Keyframe began 302 */ 262 303 template<class T> 263 304 float tAnimation<T>::cosine(float timePassed) const … … 273 314 } 274 315 316 /** 317 \brief an exponential interpolation between this keyframe and the next one 318 \param timePassed The time passed since this Keyframe began 319 */ 275 320 template<class T> 276 321 float tAnimation<T>::exp(float timePassed) const … … 278 323 } 279 324 325 /** 326 \brief a negative exponential interpolation between this keyframe and the next one 327 \param timePassed The time passed since this Keyframe began 328 */ 280 329 template<class T> 281 330 float tAnimation<T>::negExp(float timePassed) const … … 286 335 } 287 336 337 /** 338 \brief a quadratic interpolation between this keyframe and the next one 339 \param timePassed The time passed since this Keyframe began 340 */ 288 341 template<class T> 289 342 float tAnimation<T>::quadratic(float timePassed) const
Note: See TracChangeset
for help on using the changeset viewer.