- Timestamp:
- Apr 26, 2005, 12:08:46 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/story_entities/world.cc
r3964 r3965 475 475 Animation3D* animation = new Animation3D(c); 476 476 animation->setInfinity(ANIM_INF_REPLAY); 477 animation->addKeyFrame(Vector(0, 0, 0), Quaternion(), 1.0, ANIM_ NEG_EXP);478 animation->addKeyFrame(Vector( 5, 5, -5), Quaternion(), 1.0, ANIM_NEG_EXP);479 animation->addKeyFrame(Vector(0, 0, 0), Quaternion(), 1.0, ANIM_ NEG_EXP);477 animation->addKeyFrame(Vector(0, 0, 0), Quaternion(), 1.0, ANIM_SINE); 478 animation->addKeyFrame(Vector(1, 1, -1), Quaternion(), 1.0, ANIM_SINE); 479 animation->addKeyFrame(Vector(0, 0, 0), Quaternion(), 1.0, ANIM_SINE); 480 480 481 481 -
orxonox/trunk/src/util/animation/animation3d.cc
r3964 r3965 262 262 void Animation3D::sine(float timePassed) const 263 263 { 264 if( timePassed < this->currentKeyFrame->duration/2.0) 265 this->object->setRelCoor( this->currentKeyFrame->position + (this->nextKeyFrame->position - this->currentKeyFrame->position) * 266 sin( M_PI * timePassed /this->currentKeyFrame->duration) / 2.0); 267 else 268 this->object->setRelCoor( this->nextKeyFrame->position - (this->nextKeyFrame->position - this->currentKeyFrame->position) * 269 sin( M_PI * (1.0 - timePassed /this->currentKeyFrame->duration) )/2.0); 270 } 271 272 273 /* 274 if (timePassed * 2.0 < this->currentKeyFrame->duration) 275 return this->currentKeyFrame->value + (this->nextKeyFrame->value - this->currentKeyFrame->value) 276 * sin( M_PI * timePassed / this->currentKeyFrame->duration)/2; 277 else 278 return this->nextKeyFrame->value - (this->nextKeyFrame->value - this->currentKeyFrame->value) 279 * sin( M_PI * (1.0 - timePassed / this->currentKeyFrame->duration))/2; 280 281 */ 282 283 /** 284 \brief a cosine interpolation between this keyframe and the next one 285 \param timePassed The time passed since this Keyframe began 286 287 \todo implement 288 */ 289 void Animation3D::cosine(float timePassed) const 290 { 264 291 this->linear(timePassed); 265 292 } 266 293 267 294 /** 268 \brief a cosine interpolation between this keyframe and the next one 269 \param timePassed The time passed since this Keyframe began 270 271 \todo implement 272 */ 273 void Animation3D::cosine(float timePassed) const 295 \brief an exponential interpolation between this keyframe and the next one 296 \param timePassed The time passed since this Keyframe began 297 */ 298 void Animation3D::exp(float timePassed) const 274 299 { 275 300 this->linear(timePassed); … … 277 302 278 303 /** 279 \brief an exponential interpolation between this keyframe and the next one280 \param timePassed The time passed since this Keyframe began281 */282 void Animation3D::exp(float timePassed) const283 {284 this->linear(timePassed);285 }286 287 /**288 304 \brief a negative exponential interpolation between this keyframe and the next one 289 305 \param timePassed The time passed since this Keyframe began 290 291 \todo implement292 306 */ 293 307 void Animation3D::negExp(float timePassed) const … … 297 311 (1.0 - expf(- timePassed * expFactor)) ); 298 312 } 299 300 /*301 float d = this->currentKeyFrame->value - this->nextKeyFrame->value;302 float e = d * (1.0 - expf(- timePassed * expFactor));303 return this->currentKeyFrame->value - e;304 */305 313 306 314
Note: See TracChangeset
for help on using the changeset viewer.