Changeset 4893 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons/test_gun.cc
- Timestamp:
- Jul 19, 2005, 5:16:07 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/test_gun.cc
r4890 r4893 53 53 54 54 this->objectComponent1 = new PNode(); 55 this->animation1 = new Animation3D(this->objectComponent1);56 this->animation2 = new Animation3D(this);57 this->animation3 = new Animation3D(this);55 Animation3D* animation1 = this->createAnimation(WS_SHOOTING, this->objectComponent1); 56 Animation3D* animation2 = this->createAnimation(WS_ACTIVATING, this); 57 Animation3D* animation3 = this->createAnimation(WS_DEACTIVATING, this); 58 58 //parent->addChild(this->objectComponent1, PNODE_ALL); 59 59 this->addChild(this->objectComponent1, PNODE_ALL); 60 60 61 this->animation1->setInfinity(ANIM_INF_CONSTANT);62 this->animation2->setInfinity(ANIM_INF_CONSTANT);63 this->animation3->setInfinity(ANIM_INF_CONSTANT);61 animation1->setInfinity(ANIM_INF_CONSTANT); 62 animation2->setInfinity(ANIM_INF_CONSTANT); 63 animation3->setInfinity(ANIM_INF_CONSTANT); 64 64 if( this->leftRight == W_LEFT) 65 65 { 66 66 this->projectileOffset = Vector(1.0, 0.0, -0.35); 67 67 68 this->animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);69 this->animation1->addKeyFrame(Vector(-0.4, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);70 this->animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_CONSTANT);71 72 this->animation2->addKeyFrame(Vector(-2.6, 0.1, 2.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);73 this->animation2->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);74 75 this->animation3->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);76 this->animation3->addKeyFrame(Vector(-2.6, 0.1, 2.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);68 animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 69 animation1->addKeyFrame(Vector(-0.4, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 70 animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_CONSTANT); 71 72 animation2->addKeyFrame(Vector(-2.6, 0.1, 2.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 73 animation2->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 74 75 animation3->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 76 animation3->addKeyFrame(Vector(-2.6, 0.1, 2.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 77 77 } 78 78 else if( this->leftRight == W_RIGHT) … … 81 81 82 82 this->objectComponent1->setRelCoor(Vector(0,0,0.35)); 83 this->animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);84 this->animation1->addKeyFrame(Vector(-0.4, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);85 this->animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.0, ANIM_LINEAR, ANIM_CONSTANT);86 87 this->animation2->addKeyFrame(Vector(-2.6, 0.1, -2.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);88 this->animation2->addKeyFrame(Vector(-2.6, 0.1, -3.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);89 90 this->animation3->addKeyFrame(Vector(-2.6, 0.1, -3.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);91 this->animation3->addKeyFrame(Vector(-2.6, 0.1, -2.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);83 animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 84 animation1->addKeyFrame(Vector(-0.4, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 85 animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.0, ANIM_LINEAR, ANIM_CONSTANT); 86 87 animation2->addKeyFrame(Vector(-2.6, 0.1, -2.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 88 animation2->addKeyFrame(Vector(-2.6, 0.1, -3.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 89 90 animation3->addKeyFrame(Vector(-2.6, 0.1, -3.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 91 animation3->addKeyFrame(Vector(-2.6, 0.1, -2.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 92 92 } 93 93 /* … … 128 128 void TestGun::activate() 129 129 { 130 this->animation2->replay();131 130 } 132 131 … … 141 140 void TestGun::deactivate() 142 141 { 143 this->animation3->replay();144 142 } 145 143 … … 153 151 void TestGun::fire() 154 152 { 155 this->energyLoaded -= this->minCharge;156 153 Projectile* pj = new TestBullet(this);//dynamic_cast<Projectile*>(ObjectManager::getInstance()->getFromDeadList(CL_TEST_BULLET & CL_MASK_LOWLEVEL_CLASS)); 157 154 // weaponSource->play(); … … 161 158 pj->setVelocity(this->getVelocity()); 162 159 State::getWorldEntityList()->add(pj); 163 164 this->animation1->replay();165 160 } 166 161
Note: See TracChangeset
for help on using the changeset viewer.