Changeset 3732 in orxonox.OLD for orxonox/trunk/src/simple_animation.cc
- Timestamp:
- Apr 6, 2005, 10:48:58 AM (19 years ago)
- File:
-
- 1 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:
Note: See TracChangeset
for help on using the changeset viewer.