Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6443 in orxonox.OLD for trunk/src/world_entities/space_ships


Ignore:
Timestamp:
Jan 8, 2006, 5:44:04 PM (19 years ago)
Author:
bensch
Message:

huge pipeline

Location:
trunk/src/world_entities/space_ships
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/space_ships/helicopter.cc

    r6426 r6443  
    8989  cannon->setName("BFG");
    9090
    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);
    9696
    9797  this->getWeaponManager()->changeWeaponConfig(1);
     
    176176//   this->getWeaponManager()->setSlotPosition(9, Vector(-2.5, -0.3, 2.0));
    177177//   this->getWeaponManager()->setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));:
    178      
     178
    179179  this->getWeaponManager()->getFixedTarget()->setParent(this);
    180180  this->getWeaponManager()->getFixedTarget()->setRelCoor(100000,0,0);
     
    211211}
    212212
    213 
    214 /**
    215  * adds a weapon to the weapon list of the spaceship
    216  * @param weapon to add
    217 */
    218 void Helicopter::addWeapon(Weapon* weapon)
    219 {
    220   this->getWeaponManager()->addWeapon(weapon);
    221 }
    222 
    223 
    224 /**
    225  *  removes a weapon from the spaceship
    226  * @param weapon to remove
    227 */
    228 void Helicopter::removeWeapon(Weapon* weapon)
    229 {
    230   this->getWeaponManager()->removeWeapon(weapon);
    231 }
    232213
    233214/**
     
    267248*/
    268249void Helicopter::tick (float time)
    269 { 
     250{
    270251  tailrotorspeed += xMouse/20;
    271252  if (tailrotorspeed >= 0.07) tailrotorspeed = 0.07;
    272253  else if (tailrotorspeed <= -0.07) tailrotorspeed = -0.07;
    273  
     254
    274255  if (tailrotorspeed > 0.0008) tailrotorspeed -= 0.001;
    275256  else if (tailrotorspeed < -0.0008) tailrotorspeed += 0.001;
    276257  if (tailrotorspeed <= 0.001 && tailrotorspeed >= -0.001) tailrotorspeed = 0;
    277  
     258
    278259  // spaceship controlled movement
    279260  this->calculateVelocity(time);
     
    286267  //physics: Gravity
    287268  this->shiftCoor(Vector(0,-1,0));
    288  
     269
    289270  this->shiftCoor(getAbsDirY()*rotorspeed);
    290271
     
    400381    if(rotorspeed >= 1.05) rotorspeed -= 0.05;
    401382  }
    402  
     383
    403384  if (this->bDescend )
    404385  {
     
    470451    this->xMouse = event.xRel*mouseSensitivity;
    471452    this->yMouse = event.yRel*mouseSensitivity;
    472    
     453
    473454    //this->shiftDir(Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0))*Quaternion(-M_PI/4*yMouse*mouseSensitivity, Vector(0,0,1)));
    474455  }
     
    486467    {
    487468      turret = new Turret();
    488       this->getWeaponManager()->addWeapon(turret, 2);
     469      this->addWeapon(turret, 2);
    489470      this->getWeaponManager()->changeWeaponConfig(2);
    490471    }
     
    495476    {
    496477      turret = new AimingTurret();
    497       this->getWeaponManager()->addWeapon(turret, 3);
     478      this->addWeapon(turret, 3);
    498479
    499480      this->getWeaponManager()->changeWeaponConfig(3);
  • trunk/src/world_entities/space_ships/helicopter.h

    r6426 r6443  
    2626    virtual void enter();
    2727    virtual void leave();
    28 
    29     void addWeapon(Weapon* weapon );
    30     void removeWeapon(Weapon* weapon);
    3128
    3229    virtual void postSpawn();
  • trunk/src/world_entities/space_ships/space_ship.cc

    r6440 r6443  
    103103  cannon->setName("BFG");
    104104
    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);
    110110
    111111  this->getWeaponManager()->changeWeaponConfig(1);
     
    221221}
    222222
    223 /**
    224  * adds a weapon to the weapon list of the spaceship
    225  * @param weapon to add
    226 */
    227 void SpaceShip::addWeapon(Weapon* weapon)
    228 {
    229   this->getWeaponManager()->addWeapon(weapon);
    230 }
    231 
    232 
    233 /**
    234  *  removes a weapon from the spaceship
    235  * @param weapon to remove
    236 */
    237 void SpaceShip::removeWeapon(Weapon* weapon)
    238 {
    239   this->getWeaponManager()->removeWeapon(weapon);
    240 }
    241223
    242224/**
     
    451433      this->bFire = event.bPressed;
    452434  else if( event.type == KeyMapper::PEV_NEXT_WEAPON && event.bPressed)
     435  {
    453436    this->getWeaponManager()->nextWeaponConfig();//if( !event.bPressed) this->bWeaponChange = !this->bWeaponChange;
     437  }
    454438  else if ( event.type == KeyMapper::PEV_PREVIOUS_WEAPON && event.bPressed)
    455439    this->getWeaponManager()->previousWeaponConfig();
     
    503487    {
    504488      turret = new Turret();
    505       this->getWeaponManager()->addWeapon(turret, 2);
     489      this->addWeapon(turret, 2);
    506490      this->getWeaponManager()->changeWeaponConfig(2);
    507491    }
     
    513497      turret = dynamic_cast<Weapon*>(Factory::fabricate(CL_TARGETING_TURRET));
    514498      if (turret != NULL)
    515       this->getWeaponManager()->addWeapon(turret, 3);
     499      this->addWeapon(turret, 3);
    516500
    517501      this->getWeaponManager()->changeWeaponConfig(3);
  • trunk/src/world_entities/space_ships/space_ship.h

    r6426 r6443  
    3030    virtual void enter();
    3131    virtual void leave();
    32 
    33     void addWeapon(Weapon* weapon );
    34     void removeWeapon(Weapon* weapon);
    3532
    3633    virtual void postSpawn();
Note: See TracChangeset for help on using the changeset viewer.