- Timestamp:
- Apr 6, 2005, 10:48:58 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/simple_animation.cc
r3731 r3732 263 263 this->localTime -= this->currentFrame->time; 264 264 265 this->currentFrame->object->setRelCoor( this->currentFrame->position);265 this->currentFrame->object->setRelCoor(*this->currentFrame->position); 266 266 *this->lastPosition = *this->currentFrame->position; 267 267 268 268 this->lastFrame = this->currentFrame; 269 269 this->currentFrame = this->frames->nextElement(this->currentFrame); 270 this->mode = this->currentFrame->mode; 270 271 } 271 272 … … 275 276 case LINEAR: 276 277 277 *this->tmpVect = *this-> lastFrame->position - *this->currentFrame->position;278 *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position; 278 279 *this->tmpVect = *this->tmpVect * this->localTime / this->currentFrame->time; 279 //this->currentFrame->object->shiftCoor(*this->tmpVect - *this->lastPosition); 280 this->currentFrame->object->setRelCoor(*this->currentFrame->position + *this->tmpVect); 280 this->currentFrame->object->setRelCoor(*this->lastFrame->position + *this->tmpVect); 281 281 *this->lastPosition = *this->tmpVect; 282 //printf("shift vector: ");this->lastPosition->debug();283 282 break; 284 283 case EXP: … … 288 287 *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position; 289 288 *this->tmpVect = *this->tmpVect * (1 - exp(- this->localTime / this->currentFrame->time)); 289 this->currentFrame->object->setRelCoor(*this->lastFrame->position + *this->tmpVect); 290 *this->lastPosition = *this->tmpVect; 290 291 break; 291 292 case SIN: 292 293 *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position; 293 *this->tmpVect = *this->tmpVect * (1 - cos(- this->localTime / this->currentFrame->time)); 294 *this->tmpVect = *this->tmpVect * 0.5*(1 - cos(M_PI * this->localTime / this->currentFrame->time)); 295 this->currentFrame->object->setRelCoor(*this->lastFrame->position + *this->tmpVect); 296 *this->lastPosition = *this->tmpVect; 294 297 break; 295 298 case COS: -
orxonox/trunk/src/story_entities/world.cc
r3731 r3732 472 472 473 473 KeyFrame* f1 = new KeyFrame; 474 f1->position = new Vector(10.0, 1.0, 1.0);474 f1->position = new Vector(10.0, 1.0, -1.0); 475 475 f1->direction = new Quaternion(); 476 476 f1->time = 1.0; 477 f1->mode = LINEAR;477 f1->mode = SIN; 478 478 479 479 480 480 KeyFrame* f2 = new KeyFrame; 481 f2->position = new Vector(10.0, 1.0, -1.0);481 f2->position = new Vector(10.0, 1.0, 1.0); 482 482 f2->direction = new Quaternion(); 483 483 f2->time = 1.0; 484 f2->mode = LINEAR;484 f2->mode = SIN; 485 485 486 486 KeyFrame* f3 = new KeyFrame; 487 f3->position = new Vector( 10.0, 0.0, -1.0);487 f3->position = new Vector(5.0, 1.0, -1.0); 488 488 f3->direction = new Quaternion(); 489 489 f3->time = 1.0; 490 f3->mode = LINEAR;490 f3->mode = SIN; 491 491 492 492 … … 495 495 this->simpleAnimation->addKeyFrame(f1); 496 496 this->simpleAnimation->addKeyFrame(f2); 497 //this->simpleAnimation->addKeyFrame(f3);497 this->simpleAnimation->addKeyFrame(f3); 498 498 //this->simpleAnimation->addKeyFrame(f2); 499 499 this->simpleAnimation->animatorEnd();
Note: See TracChangeset
for help on using the changeset viewer.