Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5893 in orxonox.OLD for branches


Ignore:
Timestamp:
Dec 3, 2005, 4:43:36 PM (19 years ago)
Author:
snellen
Message:

space_ship.cc updated

Location:
branches/spaceshipcontrol/src/world_entities/space_ships
Files:
2 edited

Legend:

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

    r5890 r5893  
    118118//   button->setBindNode(this);
    119119
     120  //add events to the eventlist
    120121  registerEvent(KeyMapper::PEV_UP);
    121122  registerEvent(KeyMapper::PEV_DOWN);
     
    248249{
    249250  // spaceship controlled movement
    250   this->move(time);
     251  this->calculateVelocity(time);
     252
     253  Vector move = (velocity)*time;
     254
     255  this->shiftCoor (move);
    251256
    252257  this->getWeaponManager()->tick(time);
     
    256261
    257262/**
    258  *  action if spaceship moves
     263 *  calculate the velocity
    259264 * @param time the timeslice since the last frame
    260265*/
    261 void SpaceShip::move (float time)
     266void SpaceShip::calculateVelocity (float time)
    262267{
    263268  Vector accel(0.0, 0.0, 0.0);
     
    301306  }
    302307
    303   Vector move = accel * time *acceleration;
    304 
    305 /*  if (accel.z < 0)
    306     this->setRelDirSoft(Quaternion(-.4, accel), 5);
    307   else if (accel.z > 0)
    308     this->setRelDirSoft(Quaternion(.4, accel), 5);
    309   else*/
     308  velocity += accel*time;
    310309  rot.normalize();
    311310  this->setRelDirSoft(Quaternion(rotVal, rot), 5);
    312   this->shiftCoor (move);
    313311}
    314312
  • branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.h

    r5880 r5893  
    4242  private:
    4343
    44     void move(float time);
     44    void calculateVelocity(float time);
    4545    void weaponAction();
    4646
Note: See TracChangeset for help on using the changeset viewer.