Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Dec 21, 2005, 1:49:06 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the christmas branche to the trunk
merged with command:
svn merge -r6165:HEAD christmas_branche/ ../trunk/
no conflicts

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore set to
      Makefile.in
      Makefile
      configure
      *.kdevelop
      Doxyfile
      config.log
      config.h
      config.status
      stamp-h1
      autom4te.cache
      aclocal.m4
  • trunk/src

    • Property svn:ignore set to
      .deps
      orxonox
      Makefile
      Makefile.in

  • trunk/src/world_entities/space_ships/helicopter.cc

    r6162 r6222  
    9595
    9696  this->getWeaponManager()->changeWeaponConfig(1);
     97  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
    9798}
    9899
     
    184185
    185186
     187
     188
     189void Helicopter::enter()
     190{
     191  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true);
     192
     193
     194}
     195
     196void Helicopter::leave()
     197{
     198  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     199
     200
     201}
     202
     203
    186204/**
    187205 * adds a weapon to the weapon list of the spaceship
     
    324342         if(this->getAbsDirZ().y > 0.02) this->shiftDir(Quaternion(time/5, Vector(1,0,0)));
    325343   }
    326    
     344
    327345  if( this->bRight /* > this->getRelCoor().z*2*/)
    328346  {
  • trunk/src/world_entities/space_ships/helicopter.h

    r6162 r6222  
    2424    void loadParams(const TiXmlElement* root);
    2525
     26    virtual void enter();
     27    virtual void leave();
     28
    2629    void addWeapon(Weapon* weapon );
    2730    void removeWeapon(Weapon* weapon);
     
    3942
    4043  private:
    41 
    4244    void calculateVelocity(float time);
    4345    void weaponAction();
     
    6567    float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
    6668    float                 acceleration;       //!< the acceleration of the player.
    67    
     69
    6870    float                 airViscosity;
    6971
  • trunk/src/world_entities/space_ships/space_ship.cc

    r6162 r6222  
    112112  PRINTF(4)("SPACESHIP INIT\n");
    113113
    114   EventHandler::getInstance()->grabEvents(true);
     114//   EventHandler::getInstance()->grabEvents(true);
    115115
    116116  bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false;
     
    177177  this->getWeaponManager()->getFixedTarget()->setRelCoor(100000,0,0);
    178178
     179  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
    179180}
    180181
     
    188189}
    189190
     191
     192void SpaceShip::enter()
     193{
     194  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true);
     195
     196
     197}
     198
     199void SpaceShip::leave()
     200{
     201  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     202
     203
     204}
    190205
    191206/**
     
    267282  velocity += ((this->getAbsDirX())*travelSpeed-velocity)*airViscosity;
    268283  velocity = (velocity.getNormalized())*travelSpeed;
    269  
     284
    270285  //orient the spaceship in direction of the mouse
    271286   rotQuat = Quaternion::quatSlerp( this->getAbsDir(),mouseDir,fabsf(time)*3);
    272    if (this->getAbsDir().distance(rotQuat) > 0.001) 
     287   if (this->getAbsDir().distance(rotQuat) > 0.001)
    273288    this->setAbsDir( rotQuat);
    274289   //this->setAbsDirSoft(mouseDir,5);
    275    
     290
    276291  // this is the air friction (necessary for a smooth control)
    277292  if(velocity.len() != 0) velocity -= velocity*0.01;
     
    308323  /* calculate the direction in which the craft is heading  */
    309324
     325  Plane plane(Vector(0,1,0), Vector(0,0,0));
     326
    310327  if( this->bUp )
    311328   {
    312329     //this->shiftCoor(this->getAbsDirX());
    313330      accel += (this->getAbsDirX())*2;
    314      
     331
    315332      /* Heli-Steuerung
    316333         accel += (this->getAbsDirX()*2;
  • trunk/src/world_entities/space_ships/space_ship.h

    r6162 r6222  
    2626    void init();
    2727    void loadParams(const TiXmlElement* root);
     28
     29    virtual void enter();
     30    virtual void leave();
    2831
    2932    void addWeapon(Weapon* weapon );
Note: See TracChangeset for help on using the changeset viewer.