Changeset 4955 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons/test_gun.cc
- Timestamp:
- Jul 25, 2005, 3:48:55 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/test_gun.cc
r4953 r4955 26 26 #include "model.h" 27 27 #include "test_bullet.h" 28 #include "weapon_manager.h" 28 29 29 30 #include "state.h" … … 44 45 creates a new weapon 45 46 */ 46 TestGun::TestGun (int leftRight) 47 TestGun::TestGun (WeaponManager* weaponManager, int leftRight) 48 : Weapon(weaponManager) 47 49 { 48 50 this->setClassID(CL_TEST_GUN, "TestGun"); … … 158 160 Projectile* pj = dynamic_cast<Projectile*>(this->getProjectileFactory()->resurrect()); 159 161 162 PNode* target = this->getWeaponManager()->getFixedTarget(); 163 164 if (target != NULL) 165 { 166 target->debugDraw(); 167 Vector test = ((target->getAbsCoor() - this->getAbsCoor())*5); 168 pj->setVelocity(test/20.0);//this->getVelocity()); 169 } 170 else 171 pj->setVelocity(target->getVelocity()); 172 173 160 174 pj->setAbsCoor(this->getEmissionPoint()); 161 175 pj->setAbsDir(this->getAbsDir()); 162 pj->setVelocity(this->getVelocity());163 176 State::getWorldEntityList()->add(pj); 164 177 } … … 191 204 void TestGun::draw () 192 205 { 206 this->getWeaponManager()->getFixedTarget()->debugDraw(10); 207 193 208 /* draw gun body */ 194 209 glMatrixMode(GL_MODELVIEW);
Note: See TracChangeset
for help on using the changeset viewer.