Changeset 4885 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons/test_gun.cc
- Timestamp:
- Jul 18, 2005, 3:36:18 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/test_gun.cc
r4836 r4885 50 50 51 51 this->model = (Model*)ResourceManager::getInstance()->load("models/test_gun.obj", OBJ, RP_CAMPAIGN); 52 this->idleTime = 0.2f;53 52 this->leftRight = leftRight; 54 53 … … 92 91 this->animation3->addKeyFrame(Vector(-2.6, 0.1, -2.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 93 92 } 94 93 /* 95 94 this->fireSound = (SoundBuffer*)ResourceManager::getInstance()->load("sound/shot1.wav", WAV); 96 95 this->weaponSource = new SoundSource(this->fireSound, this); 97 this->weaponSource->setRolloffFactor(.1); 96 this->weaponSource->setRolloffFactor(.1);*/ 98 97 Projectile* p = new TestBullet(this); 99 // ObjectManager::getInstance()->cache(CL_TEST_BULLET, 100, p); 98 99 // ObjectManager::getInstance()->cache(CL_TEST_BULLET, 100, p); 100 100 //ObjectManager::getInstance()->debug(); 101 102 this->setStateDuration(WS_SHOOTING, .2); 103 104 this->energy = 100; 105 this->minCharge = 2; 106 107 this->setActionSound(WA_SHOOT, "sound/shot1.wav"); 101 108 } 102 109 … … 145 152 void TestGun::fire() 146 153 { 147 if( !this->hasWeaponIdleTimeElapsed()) 148 { 149 this->weaponIdle(); 150 return; 151 } 152 153 Projectile* pj = new TestBullet(this);//dynamic_cast<Projectile*>(ObjectManager::getInstance()->getFromDeadList(CL_TEST_BULLET & CL_MASK_LOWLEVEL_CLASS)); 154 weaponSource->play(); 154 this->energyLoaded -= this->minCharge; 155 Projectile* pj = new TestBullet(this);//dynamic_cast<Projectile*>(ObjectManager::getInstance()->getFromDeadList(CL_TEST_BULLET & CL_MASK_LOWLEVEL_CLASS)); 156 // weaponSource->play(); 155 157 156 158 pj->setAbsCoor(this->getAbsCoor() + this->projectileOffset); … … 158 160 pj->setVelocity(this->getVelocity()); 159 161 State::getWorldEntityList()->add(pj); 160 this->localTime = 0;161 162 162 163 this->animation1->replay(); … … 184 185 void TestGun::destroy () 185 186 {} 186 187 188 /**189 * tick signal for time dependent/driven stuff190 */191 void TestGun::tick (float time)192 {193 this->localTime += time;194 }195 187 196 188
Note: See TracChangeset
for help on using the changeset viewer.