Changeset 3739 in orxonox.OLD for orxonox/trunk/src/simple_animation.cc
- Timestamp:
- Apr 7, 2005, 12:33:01 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/simple_animation.cc
r3738 r3739 101 101 102 102 103 /* 104 Vector* lastPosition; 105 Vector* tmpVect; 106 tList<KeyFrame>* frames; 107 animationMode animMode; 108 movementMode movMode; 109 bool bRunning; 110 float deltaT; 111 */ 112 103 113 /** 104 114 \brief select an object to work on by using this function … … 107 117 void SimpleAnimation::selectObject(WorldEntity* entity) 108 118 { 109 this->workingObject = entity; 119 Animation* anim = getAnimationFromWorldEntity(entity); 120 if( anim == NULL) 121 { 122 printf("SimpleAnimation::selectObject() - object not found, creating one\n"); 123 anim = new Animation; 124 anim->object = entity; 125 anim->lastPosition = new Vector(); 126 anim->tmpVect = new Vector(); 127 frames = new tList<KeyFrame>(); 128 bRunning = false; 129 deltaT = 0.0; 130 this->animators->add(anim); 131 } 132 this->workingAnimator = anim; 110 133 } 111 134 … … 323 346 delete anim; 324 347 } 348 349 350 351 Animation* SimpleAnimation::getAnimationFromWorldEntity(WorldEntity* entity) 352 { 353 tIterator<Animation>* iterator = this->animators->getIterator(); 354 Animation* anim = iterator->nextElement(); 355 while( anim != NULL) 356 { 357 if( anim->object == entity) 358 return anim; 359 anim = iterator->nextElement(); 360 } 361 delete iterator; 362 return NULL; 363 }
Note: See TracChangeset
for help on using the changeset viewer.