- Timestamp:
- Apr 6, 2005, 11:24:17 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/simple_animation.cc
r3732 r3733 52 52 this->tmpVect = new Vector(); 53 53 this->lastPosition = new Vector(); 54 this->deltaT = 0.2; 54 55 } 55 56 … … 269 270 this->currentFrame = this->frames->nextElement(this->currentFrame); 270 271 this->mode = this->currentFrame->mode; 272 if( this->mode == NEG_EXP) 273 { 274 *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position; 275 deltaT = 1/this->currentFrame->time * logf(1.0 + 100.0/this->tmpVect->len()); 276 } 271 277 } 272 278 … … 286 292 case NEG_EXP: 287 293 *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position; 288 *this->tmpVect = *this->tmpVect * (1 - exp(- this->localTime / this->currentFrame->time));294 *this->tmpVect = *this->tmpVect * (1 - exp(- this->localTime * this->deltaT)); 289 295 this->currentFrame->object->setRelCoor(*this->lastFrame->position + *this->tmpVect); 290 296 *this->lastPosition = *this->tmpVect; -
orxonox/trunk/src/simple_animation.h
r3729 r3733 67 67 68 68 static SimpleAnimation* singletonRef; 69 bool bDescriptive; //<! is true, when AnimatorBegin() was executed but no AnimatorEnd() yet: in describtive mode: pass commands 69 70 bool bRunning; //<! is set, when the animation is running 70 71 tList<KeyFrame>* frames; //<! where keyframes are stored in … … 78 79 Vector* tmpVect; //<! this is the temporary vector save place - 79 80 WorldEntity* workingObject; //<! this is a pointer to the current working object that has been selected via selectObject() 80 bool bDescriptive; //<! is true, when AnimatorBegin() was executed but no AnimatorEnd() yet: in describtive mode: pass commands 81 float deltaT; //<! this is a time constant for the movement 82 81 83 }; 82 84 -
orxonox/trunk/src/story_entities/world.cc
r3732 r3733 474 474 f1->position = new Vector(10.0, 1.0, -1.0); 475 475 f1->direction = new Quaternion(); 476 f1->time = 1.0;477 f1->mode = SIN;476 f1->time = 0.5; 477 f1->mode = NEG_EXP; 478 478 479 479 … … 481 481 f2->position = new Vector(10.0, 1.0, 1.0); 482 482 f2->direction = new Quaternion(); 483 f2->time = 1.0;484 f2->mode = SIN;483 f2->time = 0.5; 484 f2->mode = NEG_EXP; 485 485 486 486 KeyFrame* f3 = new KeyFrame; 487 487 f3->position = new Vector(5.0, 1.0, -1.0); 488 488 f3->direction = new Quaternion(); 489 f3->time = 1.0;490 f3->mode = SIN;489 f3->time = 0.5; 490 f3->mode = NEG_EXP; 491 491 492 492
Note: See TracChangeset
for help on using the changeset viewer.