Changeset 3752 in orxonox.OLD for orxonox/trunk/src/simple_animation.cc
- Timestamp:
- Apr 7, 2005, 10:13:42 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/simple_animation.cc
r3744 r3752 73 73 delete iterator; 74 74 delete this->frames; 75 singletonRef = NULL; 75 76 } 76 77 … … 118 119 void SimpleAnimation::selectObject(WorldEntity* entity) 119 120 { 120 printf("SimpleAnimation::selectObject() - selecing active object\n");121 121 Animation* anim = getAnimationFromWorldEntity(entity); 122 122 if( anim == NULL) 123 123 { 124 printf("SimpleAnimation::selectObject() - object not found, creating one\n");125 124 anim = new Animation; 126 125 anim->object = entity; … … 128 127 anim->tmpVect = new Vector(); 129 128 anim->frames = new tList<KeyFrame>(); 129 anim->animMode = LOOP; 130 130 bRunning = false; 131 131 deltaT = 0.0; 132 132 this->animators->add(anim); 133 133 } 134 else135 printf("SimpleAnimation::selectObject() - animation already existent, using it\n");136 134 this->workingAnimator = anim; 137 printf("SimpleAnimation::selectObject() - selection completed\n");138 135 } 139 136 … … 203 200 } 204 201 202 203 void SimpleAnimation::setAnimationMode(animationMode mode) 204 { 205 if( !this->bDescriptive || this->workingAnimator == NULL) 206 { 207 PRINTF(1)("SimpleAnimation: executing animation code outside a AnimationBegin()/AnimationEnd() - ignoring\n"); 208 return; 209 } 210 this->workingAnimator->animMode = mode; 211 } 205 212 206 213 /** … … 323 330 anim->lastFrame = anim->currentFrame; 324 331 anim->currentFrame = anim->frames->nextElement(anim->currentFrame); 332 if( anim->currentFrame == anim->frames->firstElement() && anim->animMode == SINGLE) 333 { 334 anim->bRunning = false; 335 return; 336 } 325 337 anim->movMode = anim->currentFrame->mode; 326 338 if( anim->movMode == NEG_EXP) … … 335 347 { 336 348 case LINEAR: 337 338 349 *anim->tmpVect = *anim->currentFrame->position - *anim->lastFrame->position; 339 350 *anim->tmpVect = *anim->tmpVect * anim->localTime / anim->currentFrame->time;
Note: See TracChangeset
for help on using the changeset viewer.