Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5906 in orxonox.OLD for branches/spaceshipcontrol


Ignore:
Timestamp:
Dec 3, 2005, 9:30:54 PM (19 years ago)
Author:
snellen
Message:

space_ship.cc updated

File:
1 edited

Legend:

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

    r5905 r5906  
    256256  Vector move = (velocity)*time;
    257257
    258   /*if( velocity.len() != 0 )
     258  //orient the spaceship model in the direction of movement.
     259  if( velocity.len() != 0 )
    259260   {
    260261     this->setAbsDir(Quaternion(velocity, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)));
    261262   }
    262   */
     263
    263264  this->shiftCoor (move);
    264265
     
    279280  /* FIXME: calculating the direction and orthDirection every timeSlice is redundant! save it somewhere */
    280281  /* calculate the direction in which the craft is heading  */
    281   Vector direction (1.0, 0.0, 0.0);
    282   //direction = this->absDirection.apply (direction);
    283    Vector orthDirection (0.0, 0.0, 1.0);
    284   //orthDirection = orthDirection.cross (direction);
     282   Vector forwardDirection (1.0, 0.0, 0.0);
     283   //direction = this->absDirection.apply (direction);
     284   Vector rightDirection (0.0, 0.0, 1.0);
     285   //orthDirection = orthDirection.cross (direction);
     286   Vector upDirection (0.0, 1.0, 0.0);
    285287
    286288
     
    288290   {
    289291    //if(velocity.len() == 0)
    290       accel += direction;//((this->getAbsDir()).getSpacialAxis().getNormalized());
     292     accel += forwardDirection;
    291293    //else
    292294      //travelSpeed++;
     
    296298   {
    297299    //if(velocity.len() == 0)
    298       accel -= direction;//((this->getAbsDir()).getSpacialAxis().getNormalized());
     300     accel -= forwardDirection;
    299301   // else
    300302     //travelSpeed--;
     
    303305  if( this->bLeft /* > -this->getRelCoor().z*2*/)
    304306  {
    305     accel -=(orthDirection);
     307    accel -= rightDirection;
    306308    //rot +=Vector(1,0,0);
    307309    //rotVal -= .4;
     
    309311  if( this->bRight /* > this->getRelCoor().z*2*/)
    310312  {
    311     accel += orthDirection;
     313    accel += rightDirection;
    312314    //rot += Vector(1,0,0);
    313315    //rotVal += .4;
     
    315317  if (this->bAscend )
    316318  {
    317     accel += Vector(0,1,0);
     319    accel += upDirection;
    318320    //rot += Vector(0,0,1);
    319321    //rotVal += .4;
     
    321323  if (this->bDescend )
    322324  {
    323     accel -= Vector(0,1,0);
     325    accel -= upDirection;
    324326    //rot += Vector(0,0,1);
    325327    //rotVal -= .4;
Note: See TracChangeset for help on using the changeset viewer.