Changeset 3739 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Apr 7, 2005, 12:33:01 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 4 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 } -
orxonox/trunk/src/simple_animation.h
r3738 r3739 98 98 Vector* tmpVect; //<! this is the temporary vector save place - 99 99 WorldEntity* workingObject; //<! this is a pointer to the current working object that has been selected via selectObject() 100 Animat or* workingAnimator; //<! the animator with which you are currently working100 Animation* workingAnimator; //<! the animator with which you are currently working 101 101 float deltaT; //<! this is a time constant for the movement 102 103 Animation* getAnimationFromWorldEntity(WorldEntity* entity); 102 104 103 105 }; -
orxonox/trunk/src/story_entities/world.cc
r3734 r3739 472 472 473 473 KeyFrame* f1 = new KeyFrame; 474 f1->position = new Vector( 20.0, 1.0, -1.0);474 f1->position = new Vector(-1.1, 0.0, 2.6); 475 475 f1->direction = new Quaternion(); 476 f1->time = 0.3;476 f1->time = 1.0; 477 477 f1->mode = NEG_EXP; 478 478 479 479 480 480 KeyFrame* f2 = new KeyFrame; 481 f2->position = new Vector( 10.0, 1.0, 5.0);481 f2->position = new Vector(-2.1, 0.0, 2.6); 482 482 f2->direction = new Quaternion(); 483 f2->time = 0. 5;483 f2->time = 0.1; 484 484 f2->mode = NEG_EXP; 485 485 486 486 KeyFrame* f3 = new KeyFrame; 487 f3->position = new Vector( 5.0, 2.0, -1.0);487 f3->position = new Vector(-1.1, 0.0, 2.6); 488 488 f3->direction = new Quaternion(); 489 f3->time = 0. 5;489 f3->time = 0.2; 490 490 f3->mode = NEG_EXP; 491 491 … … 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(); -
orxonox/trunk/src/world_entities/environment.cc
r3729 r3739 29 29 Environment::Environment () : WorldEntity() 30 30 { 31 this->model = (Model*) ResourceManager::getInstance()->load(" sphere", RP_LEVEL);31 this->model = (Model*) ResourceManager::getInstance()->load("cube", RP_LEVEL); 32 32 // this->model = new OBJModel("../data/models/fighter.obj"); 33 33 }
Note: See TracChangeset
for help on using the changeset viewer.