Changeset 3986 in orxonox.OLD
- Timestamp:
- Apr 26, 2005, 12:38:20 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/story_entities/world.cc
r3984 r3986 478 478 479 479 480 animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_ SINE, ANIM_LINEAR);481 animation->addKeyFrame(Vector(0, 2, 0), Quaternion(M_PI, Vector(0,1,0)), 1.0, ANIM_ SINE, ANIM_LINEAR);482 animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_ SINE, ANIM_SINE);480 animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR); 481 animation->addKeyFrame(Vector(0, 2, 0), Quaternion(M_PI, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR); 482 animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR); 483 483 484 484 -
orxonox/trunk/src/util/animation/animation3d.cc
r3985 r3986 46 46 this->animFuncMov = &Animation3D::mLinear; 47 47 this->animFuncRot = &Animation3D::rLinear; 48 49 this->bRunning = false; 48 50 } 49 51 … … 172 174 switch (animFuncMov) 173 175 { 174 default:175 176 case ANIM_CONSTANT: 176 177 this->animFuncMov = &Animation3D::mConstant; … … 197 198 this->animFuncMov = &Animation3D::mNegExp; 198 199 this->expFactorMov = -1.0 / this->currentKeyFrame->duration * logf(DELTA_X_3D); 200 this->currentKeyFrame->lastPosition = Vector(); 199 201 break; 200 202 case ANIM_QUADRATIC: … … 204 206 this->animFuncMov = &Animation3D::mRandom; 205 207 break; 208 default: 209 break; 206 210 } 207 211 } … … 215 219 void Animation3D::mConstant(float timePassed) const 216 220 { 217 this->object->setRelCoor(this->currentKeyFrame->position);221 //this->object->setRelCoor(this->currentKeyFrame->position); 218 222 219 223 /* … … 296 300 void Animation3D::mNegExp(float timePassed) const 297 301 { 302 Vector v; 303 v = (this->nextKeyFrame->position - this->currentKeyFrame->position) * (1.0 - expf(- timePassed * expFactorMov)); 304 this->object->shiftCoor(v - this->currentKeyFrame->lastPosition); 305 this->currentKeyFrame->lastPosition = v; 306 307 /* 298 308 this->object->setRelCoor( this->currentKeyFrame->position + 299 309 (this->nextKeyFrame->position - this->currentKeyFrame->position) * 300 310 (1.0 - expf(- timePassed * expFactorMov)) ); 311 */ 301 312 } 302 313 … … 320 331 void Animation3D::mRandom(float timePassed) const 321 332 { 333 /* 322 334 this->object->setRelCoor(this->currentKeyFrame->position + 323 335 (this->nextKeyFrame->position - this->currentKeyFrame->position) * (float)rand()/(float)RAND_MAX); 324 336 this->object->setRelDir(this->currentKeyFrame->direction + 325 337 (this->nextKeyFrame->direction - this->currentKeyFrame->direction)* (float)rand()/(float)RAND_MAX); 338 */ 326 339 } 327 340 … … 338 351 switch (animFuncRot) 339 352 { 340 default:353 default: 341 354 case ANIM_CONSTANT: 342 355 this->animFuncRot = &Animation3D::rConstant; 356 printf("a;sdlfkja;lskdjf;alskjdf;lasjdf;lasjdf;lasjdf;lajsdf\n"); 343 357 break; 344 358 case ANIM_LINEAR: … … 364 378 this->animFuncRot = &Animation3D::rRandom; 365 379 break; 380 366 381 } 367 382 } -
orxonox/trunk/src/world_entities/environment.cc
r3964 r3986 50 50 void Environment::draw () 51 51 { 52 //this->getRelCoor() ->debug();52 //this->getRelCoor().debug(); 53 53 54 54 glMatrixMode(GL_MODELVIEW); -
orxonox/trunk/src/world_entities/test_gun.cc
r3980 r3986 50 50 this->animation1 = new Animation3D(this->objectComponent1); 51 51 //this->animation2 = new Animation3D(this); 52 parent->addChild(this->objectComponent1, PNODE_ALL); 52 //parent->addChild(this->objectComponent1, PNODE_ALL); 53 this->addChild(this->objectComponent1, PNODE_ALL); 53 54 54 55 this->animation1->setInfinity(ANIM_INF_CONSTANT); … … 58 59 this->projectileOffset = Vector(1.0, 0.0, -0.35); 59 60 60 this->animation1->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR); 61 this->animation1->addKeyFrame(Vector(-3.0, 0.1, 3.0), Quaternion(), 0.5, ANIM_LINEAR); 62 this->animation1->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR); 63 64 //this->animation2->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_LINEAR); 65 //this->animation2->addKeyFrame(Vector(-2.6, 0.1, 1.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_LINEAR); 61 //this->animation1->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR); 62 //this->animation1->addKeyFrame(Vector(-3.0, 0.1, 3.0), Quaternion(), 0.5, ANIM_LINEAR); 63 //this->animation1->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR); 64 65 this->animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 66 this->animation1->addKeyFrame(Vector(-0.4, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 67 this->animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_CONSTANT); 68 69 70 //this->animation2->addKeyFrame(Vector(0, 0, 0.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_LINEAR); 71 //this->animation2->addKeyFrame(Vector(0, 0, 2.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_LINEAR); 72 //this->animation2->addKeyFrame(Vector(0, 0, 0.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_LINEAR); 66 73 } 67 74 else if( this->leftRight == W_RIGHT) … … 69 76 this->projectileOffset = Vector(1.0, 0.0, 0.5); 70 77 71 this->animation1->addKeyFrame(Vector(-2.6, 0.1, -2.5), Quaternion(), 0.1, ANIM_NEG_EXP); 72 this->animation1->addKeyFrame(Vector(-3.0, 0.1, -2.5), Quaternion(), 0.5, ANIM_NEG_EXP); 73 this->animation1->addKeyFrame(Vector(-2.6, 0.1, -2.5), Quaternion(), 0.1, ANIM_NEG_EXP); 78 //this->animation1->addKeyFrame(Vector(-2.6, 0.1, -2.5), Quaternion(), 0.1, ANIM_LINEAR); 79 //this->animation1->addKeyFrame(Vector(-3.0, 0.1, -2.5), Quaternion(), 0.5, ANIM_LINEAR); 80 //this->animation1->addKeyFrame(Vector(-2.6, 0.1, -2.5), Quaternion(), 0.1, ANIM_LINEAR); 81 82 this->animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 83 this->animation1->addKeyFrame(Vector(-0.4, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 84 this->animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_CONSTANT); 85 86 87 //this->animation2->addKeyFrame(Vector(0, 0, 0.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_LINEAR); 88 //this->animation2->addKeyFrame(Vector(0, 0, 2.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_LINEAR); 89 //this->animation2->addKeyFrame(Vector(0, 0, 0.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_LINEAR); 74 90 } 91 75 92 } 76 93 … … 95 112 { 96 113 printf("ACTIVATE \n"); 97 this->animation2->replay();114 //this->animation2->replay(); 98 115 } 99 116 … … 180 197 void TestGun::draw () 181 198 { 199 //this->getRelCoor().debug(); 200 //this->getAbsCoor().debug(); 201 202 this->objectComponent1->getRelCoor().debug(); 203 //this->objectComponent1->getAbsCoor().debug(); 204 182 205 /* draw gun body */ 183 206 glMatrixMode(GL_MODELVIEW);
Note: See TracChangeset
for help on using the changeset viewer.