Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6537 in orxonox.OLD for branches/spaceshipcontrol/src/world_entities


Ignore:
Timestamp:
Jan 18, 2006, 1:36:27 PM (19 years ago)
Author:
bknecht
Message:

Control: Minimumspeed for SpaceShip

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.cc

    r6509 r6537  
    291291
    292292  // this is the air friction (necessary for a smooth control)
    293   if(travelSpeed != 0) velocity -= velocity.getNormalized()*travelSpeed*travelSpeed*0.0005;
     293  if(travelSpeed >= 120) velocity -= velocity.getNormalized()*travelSpeed*travelSpeed*0.0001;
     294  else velocity -= velocity.getNormalized()*travelSpeed*0.001;
    294295 
    295296  //other physics (gravity)
    296   if((this->getAbsDirY()).y*travelSpeed < 60 && (this->getAbsDirY()).y>0)
    297   move += Vector(0,-1,0)*120*time + Vector(0,2,0)*(this->getAbsDirY()).y*travelSpeed*time;
    298   if((this->getAbsDirY()).y*travelSpeed < 60 && (this->getAbsDirY()).y<0)
    299   move += Vector(0,-1,0)*120*time - Vector(0,2,0)*(this->getAbsDirY()).y*travelSpeed*time;
     297  if((this->getAbsDirY()).y*travelSpeed < 120 && (this->getAbsDirY()).y>0)
     298  move += Vector(0,-1,0)*60*time + Vector(0,1,0)*(this->getAbsDirY()).y*travelSpeed/2*time;
     299  if((this->getAbsDirY()).y*travelSpeed < 120 && (this->getAbsDirY()).y<0)
     300  move += Vector(0,-1,0)*60*time - Vector(0,1,0)*(this->getAbsDirY()).y*travelSpeed/2*time;
    300301
    301302  //hoover effect
     
    337338      //accel += (this->getAbsDirX())*2;
    338339     
    339       accel += (this->getAbsDirX())*3*acceleration;
     340      accel += (this->getAbsDirX())*acceleration;
    340341
    341342   }
     
    345346     //this->shiftCoor((this->getAbsDirX())*-1);
    346347     //accel -= (this->getAbsDirX())*2;
    347      accel -= (this->getAbsDirX())*3*acceleration;
     348     accel -= (this->getAbsDirX())*0.5*acceleration;
    348349   }
    349350
Note: See TracChangeset for help on using the changeset viewer.