Changeset 3825 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Apr 14, 2005, 1:29:39 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/animation.h
r3820 r3825 33 33 ANIM_LINEAR, 34 34 ANIM_SINE, 35 ANIM_COSINE, 36 ANIM_EXP, 37 ANIM_NEG_EXP, 38 ANIM_QUADRATIC, 35 39 ANIM_RANDOM}; 36 40 … … 40 44 ANIM_INF_REWIND};//, ANIM_DELETE} 41 45 42 struct AnimKeyFrame46 typedef struct AnimKeyFrame 43 47 { 44 48 float duration; … … 103 107 void setAnimFunc(ANIM_FUNCTION animFunc); 104 108 105 float random(float timePassed) const;106 109 float constant(float timePassed) const; 107 110 float linear(float timePassed) const; 108 111 float sine(float timePassed) const; 112 float cosine(float timePassed) const; 113 float exp(float timePassed) const; 114 float negExp(float timePassed) const; 115 float quadratic(float timePassed) const; 116 float random(float timePassed) const; 109 117 // ANIM_FUNCTION animFunc; 110 118 float (tAnim<T>::*animFunc)(float) const; … … 254 262 this->animFunc = &tAnim<T>::linear; 255 263 break; 264 case ANIM_SINE: 265 this->animFunc = &tAnim<T>::sine; 266 break; 267 case ANIM_COSINE: 268 this->animFunc = &tAnim<T>::cosine; 269 break; 270 case ANIM_EXP: 271 this->animFunc = &tAnim<T>::exp; 272 break; 273 case ANIM_NEG_EXP: 274 this->animFunc = &tAnim<T>::negExp; 275 break; 276 case ANIM_SINE: 277 this->animFunc = &tAnim<T>::quadratic; 278 break; 256 279 case ANIM_RANDOM: 257 280 this->animFunc = &tAnim<T>::random; 258 break;259 case ANIM_SINE:260 this->animFunc = &tAnim<T>::sine;261 281 break; 262 282 } … … 289 309 float tAnim<T>::sine(float timePassed) const 290 310 { 291 292 } 311 return this->currentkeyFrame->value - (this->nextKeyFrame->value - this->currentKeyFrame->value) 312 * sin(timePassed / this->currentKeyFrame->duration * M_PI); 313 } 314 315 template<class T> 316 float tAnim<T>::cosine(float timePassed) const 317 { 318 return this->currentkeyFrame->value - (this->nextKeyFrame->value - this->currentKeyFrame->value) 319 * cos(timePassed / this->currentKeyFrame->duration * M_PI); 320 } 321 322 template<class T> 323 float tAnim<T>::exp(float timePassed) const 324 { 325 326 } 327 328 template<class T> 329 float tAnim<T>::negExp(float timePassed) const 330 { 331 332 } 333 334 template<class T> 335 float tAnim<T>::quadratic(float timePassed) const 336 { 337 338 } 339 293 340 294 341 #endif /* _ANIMATION_H */
Note: See TracChangeset
for help on using the changeset viewer.