Changeset 10704 in orxonox.OLD for branches/presentation/src/world_entities/weapons/bsp_weapon.cc
- Timestamp:
- Jun 15, 2007, 11:12:29 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/world_entities/weapons/bsp_weapon.cc
r10698 r10704 31 31 * Standard constructor 32 32 */ 33 BspWeapon::BspWeapon ( )34 { 35 this->init( );33 BspWeapon::BspWeapon ( OM_LIST list ) 34 { 35 this->init( list ); 36 36 } 37 37 … … 49 49 BspWeapon::BspWeapon (const TiXmlElement* root) 50 50 { 51 this->init( );51 this->init( OM_GROUP_00 ); 52 52 if (root != NULL) 53 53 { … … 94 94 void BspWeapon::tick( float dt ) 95 95 { 96 PRINTF(0)("BSPWEAPON TICK: %d %f %f\n", bFire, bRate, dt ); 96 97 if (bFire) { 97 if (bRate < 0) {98 if (bRate <= 0) { 98 99 bRate += fireRate; 100 PRINTF(0)("BSPWEAPON SHOOT\n"); 99 101 this->shoot(); 100 102 } … … 111 113 } 112 114 113 void BspWeapon::init( )114 { 115 bRate = 0 ;115 void BspWeapon::init( OM_LIST list ) 116 { 117 bRate = 0.0; 116 118 bFire = false; 117 119 range = 1000; … … 123 125 this->aimingSystem = new AimingSystem( this ); 124 126 this->aimingSystem->setParent( this ); 125 this->aimingSystem->toList( OM_GROUP_00);127 this->aimingSystem->toList(list); 126 128 127 129 } … … 157 159 158 160 bool hit = false; 161 162 PRINTF(0)("groups: %d %d %d %d\n", this->getOMListNumber(), this->aimingSystem->getOMListNumber(), OM_GROUP_01, OM_GROUP_00); 159 163 160 164 if ( target == NULL ) … … 170 174 hit = true; 171 175 printf( "HIT %s\n", target->getClassName().c_str() ); 176 target->hit( this->damage, this ); 172 177 } 173 178 else … … 178 183 } 179 184 180 if ( !hit ) 181 { 182 //Vector explosionPos = this->getAbsCoor() + this->getAbsDir().apply( Vector( 1, 0, 0 ) )*shortestDist; 183 184 //TODO create explosion at explosionPos 185 } 185 186 186 187 187 … … 196 196 (*it)->draw(); 197 197 } 198 #if 0198 #if 1 199 199 glMatrixMode(GL_MODELVIEW); 200 200 glPushMatrix();
Note: See TracChangeset
for help on using the changeset viewer.