Changeset 6443 in orxonox.OLD for trunk/src/world_entities/space_ships
- Timestamp:
- Jan 8, 2006, 5:44:04 PM (19 years ago)
- Location:
- trunk/src/world_entities/space_ships
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/space_ships/helicopter.cc
r6426 r6443 89 89 cannon->setName("BFG"); 90 90 91 this-> getWeaponManager()->addWeapon(wpLeft, 1, 0);92 this-> getWeaponManager()->addWeapon(wpRight,1 ,1);93 this-> getWeaponManager()->addWeapon(cannon, 0, 6);94 95 //this-> getWeaponManager()->addWeapon(turret, 3, 0);91 this->addWeapon(wpLeft, 1, 0); 92 this->addWeapon(wpRight,1 ,1); 93 this->addWeapon(cannon, 0, 6); 94 95 //this->addWeapon(turret, 3, 0); 96 96 97 97 this->getWeaponManager()->changeWeaponConfig(1); … … 176 176 // this->getWeaponManager()->setSlotPosition(9, Vector(-2.5, -0.3, 2.0)); 177 177 // this->getWeaponManager()->setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));: 178 178 179 179 this->getWeaponManager()->getFixedTarget()->setParent(this); 180 180 this->getWeaponManager()->getFixedTarget()->setRelCoor(100000,0,0); … … 211 211 } 212 212 213 214 /**215 * adds a weapon to the weapon list of the spaceship216 * @param weapon to add217 */218 void Helicopter::addWeapon(Weapon* weapon)219 {220 this->getWeaponManager()->addWeapon(weapon);221 }222 223 224 /**225 * removes a weapon from the spaceship226 * @param weapon to remove227 */228 void Helicopter::removeWeapon(Weapon* weapon)229 {230 this->getWeaponManager()->removeWeapon(weapon);231 }232 213 233 214 /** … … 267 248 */ 268 249 void Helicopter::tick (float time) 269 { 250 { 270 251 tailrotorspeed += xMouse/20; 271 252 if (tailrotorspeed >= 0.07) tailrotorspeed = 0.07; 272 253 else if (tailrotorspeed <= -0.07) tailrotorspeed = -0.07; 273 254 274 255 if (tailrotorspeed > 0.0008) tailrotorspeed -= 0.001; 275 256 else if (tailrotorspeed < -0.0008) tailrotorspeed += 0.001; 276 257 if (tailrotorspeed <= 0.001 && tailrotorspeed >= -0.001) tailrotorspeed = 0; 277 258 278 259 // spaceship controlled movement 279 260 this->calculateVelocity(time); … … 286 267 //physics: Gravity 287 268 this->shiftCoor(Vector(0,-1,0)); 288 269 289 270 this->shiftCoor(getAbsDirY()*rotorspeed); 290 271 … … 400 381 if(rotorspeed >= 1.05) rotorspeed -= 0.05; 401 382 } 402 383 403 384 if (this->bDescend ) 404 385 { … … 470 451 this->xMouse = event.xRel*mouseSensitivity; 471 452 this->yMouse = event.yRel*mouseSensitivity; 472 453 473 454 //this->shiftDir(Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0))*Quaternion(-M_PI/4*yMouse*mouseSensitivity, Vector(0,0,1))); 474 455 } … … 486 467 { 487 468 turret = new Turret(); 488 this-> getWeaponManager()->addWeapon(turret, 2);469 this->addWeapon(turret, 2); 489 470 this->getWeaponManager()->changeWeaponConfig(2); 490 471 } … … 495 476 { 496 477 turret = new AimingTurret(); 497 this-> getWeaponManager()->addWeapon(turret, 3);478 this->addWeapon(turret, 3); 498 479 499 480 this->getWeaponManager()->changeWeaponConfig(3); -
trunk/src/world_entities/space_ships/helicopter.h
r6426 r6443 26 26 virtual void enter(); 27 27 virtual void leave(); 28 29 void addWeapon(Weapon* weapon );30 void removeWeapon(Weapon* weapon);31 28 32 29 virtual void postSpawn(); -
trunk/src/world_entities/space_ships/space_ship.cc
r6440 r6443 103 103 cannon->setName("BFG"); 104 104 105 this-> getWeaponManager()->addWeapon(wpLeft, 1, 0);106 this-> getWeaponManager()->addWeapon(wpRight,1 ,1);107 this-> getWeaponManager()->addWeapon(cannon, 0, 6);108 109 //this-> getWeaponManager()->addWeapon(turret, 3, 0);105 this->addWeapon(wpLeft, 1, 0); 106 this->addWeapon(wpRight,1 ,1); 107 this->addWeapon(cannon, 0, 6); 108 109 //this->addWeapon(turret, 3, 0); 110 110 111 111 this->getWeaponManager()->changeWeaponConfig(1); … … 221 221 } 222 222 223 /**224 * adds a weapon to the weapon list of the spaceship225 * @param weapon to add226 */227 void SpaceShip::addWeapon(Weapon* weapon)228 {229 this->getWeaponManager()->addWeapon(weapon);230 }231 232 233 /**234 * removes a weapon from the spaceship235 * @param weapon to remove236 */237 void SpaceShip::removeWeapon(Weapon* weapon)238 {239 this->getWeaponManager()->removeWeapon(weapon);240 }241 223 242 224 /** … … 451 433 this->bFire = event.bPressed; 452 434 else if( event.type == KeyMapper::PEV_NEXT_WEAPON && event.bPressed) 435 { 453 436 this->getWeaponManager()->nextWeaponConfig();//if( !event.bPressed) this->bWeaponChange = !this->bWeaponChange; 437 } 454 438 else if ( event.type == KeyMapper::PEV_PREVIOUS_WEAPON && event.bPressed) 455 439 this->getWeaponManager()->previousWeaponConfig(); … … 503 487 { 504 488 turret = new Turret(); 505 this-> getWeaponManager()->addWeapon(turret, 2);489 this->addWeapon(turret, 2); 506 490 this->getWeaponManager()->changeWeaponConfig(2); 507 491 } … … 513 497 turret = dynamic_cast<Weapon*>(Factory::fabricate(CL_TARGETING_TURRET)); 514 498 if (turret != NULL) 515 this-> getWeaponManager()->addWeapon(turret, 3);499 this->addWeapon(turret, 3); 516 500 517 501 this->getWeaponManager()->changeWeaponConfig(3); -
trunk/src/world_entities/space_ships/space_ship.h
r6426 r6443 30 30 virtual void enter(); 31 31 virtual void leave(); 32 33 void addWeapon(Weapon* weapon );34 void removeWeapon(Weapon* weapon);35 32 36 33 virtual void postSpawn();
Note: See TracChangeset
for help on using the changeset viewer.