Changeset 3984 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Apr 26, 2005, 3:36:56 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/story_entities/world.cc
r3982 r3984 477 477 animation->setInfinity(ANIM_INF_REPLAY); 478 478 479 animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_LINEAR, ANIM_SINE); 480 animation->addKeyFrame(Vector(0, 2, 0), Quaternion(M_PI, Vector(0,1,0)), 1.0, ANIM_LINEAR, ANIM_SINE);481 animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_LINEAR, ANIM_SINE);482 animation-> playNextKeyframes(1);483 //animation->addKeyFrame(Vector(0, 0, 0), Quaternion(), 1.0, ANIM_LINEAR); 479 480 animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_SINE, ANIM_LINEAR); 481 animation->addKeyFrame(Vector(0, 2, 0), Quaternion(M_PI, Vector(0,1,0)), 1.0, ANIM_SINE, ANIM_LINEAR); 482 animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_SINE, ANIM_SINE); 483 484 484 485 485 -
orxonox/trunk/src/util/animation/animation3d.cc
r3982 r3984 183 183 case ANIM_SINE: 184 184 this->animFuncMov = &Animation3D::mSine; 185 this->object->setRelCoor(this->currentKeyFrame->position); 186 this->currentKeyFrame->lastPosition = Vector(); 185 187 break; 186 188 case ANIM_COSINE: … … 242 244 void Animation3D::mSine(float timePassed) const 243 245 { 246 /* 244 247 if( timePassed < this->currentKeyFrame->duration/2.0) 245 248 this->object->setRelCoor( this->currentKeyFrame->position + (this->nextKeyFrame->position - this->currentKeyFrame->position) * … … 248 251 this->object->setRelCoor( this->nextKeyFrame->position - (this->nextKeyFrame->position - this->currentKeyFrame->position) * 249 252 sin( M_PI * (1.0 - timePassed /this->currentKeyFrame->duration) )/2.0); 253 */ 254 Vector v; 255 if( timePassed < this->currentKeyFrame->duration/2.0) 256 v = (this->nextKeyFrame->position - this->currentKeyFrame->position) * sin( M_PI * timePassed /this->currentKeyFrame->duration) / 2.0; 257 else 258 v = (this->nextKeyFrame->position - this->currentKeyFrame->position) * (2.0 + sin( M_PI * (- timePassed /this->currentKeyFrame->duration)) )/ 2.0; 259 260 this->object->shiftCoor(v - this->currentKeyFrame->lastPosition); 261 this->currentKeyFrame->lastPosition = v; 250 262 } 251 263
Note: See TracChangeset
for help on using the changeset viewer.