Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5901 in orxonox.OLD


Ignore:
Timestamp:
Dec 3, 2005, 7:23:37 PM (18 years ago)
Author:
snellen
Message:

disconnectControllable() in player.cc implemented

Location:
branches/spaceshipcontrol/src/world_entities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/spaceshipcontrol/src/world_entities/player.cc

    r5899 r5901  
    5353
    5454
    55 
    56 void Player::process(const Event &event)
    57 {
    58   if (likely(this->controllable != NULL))
    59     this->controllable->process(event);
    60 }
    61 
    62 
    6355bool Player::setControllable(Playable* controllable)
    6456{
     
    7264}
    7365
     66bool Player::disconnectControllable()
     67 {
     68   if(this->controllable == NULL) return true;
    7469
     70   if(this->controllable->unsubscribePlayer(this))
     71   {
     72     this->controllable = NULL;
     73     return true;
     74   }
     75   else
     76     return false;
     77 }
     78
     79 void Player::process(const Event &event)
     80 {
     81   if (likely(this->controllable != NULL))
     82     this->controllable->process(event);
     83 }
     84
  • branches/spaceshipcontrol/src/world_entities/player.h

    r5899 r5901  
    2626
    2727    bool              setControllable(Playable* controllalble);
    28     void              disconnectControllable();
    2928    inline Playable*  getControllable() { return this->controllable; };
     29
     30    bool              disconnectControllable();
    3031
    3132    // eventListener extension.
  • branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.cc

    r5900 r5901  
    256256  Vector move = (velocity)*time;
    257257
    258   if( velocity.len() != 0 )
     258  /*if( velocity.len() != 0 )
    259259   {
    260260     this->setAbsDir(Quaternion(velocity, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)));
    261261   }
    262 
     262  */
    263263  this->shiftCoor (move);
    264264
     
    289289    if(velocity.len() == 0)
    290290      accel += ((this->getAbsDir()).getSpacialAxis().getNormalized());
    291     else
    292       travelSpeed++;
     291    //else
     292      //travelSpeed++;
    293293   }
    294294
     
    297297    if(velocity.len() == 0)
    298298      accel -= ((this->getAbsDir()).getSpacialAxis().getNormalized());
    299     else
    300     travelSpeed--;
     299   // else
     300     //travelSpeed--;
    301301   }
    302302
Note: See TracChangeset for help on using the changeset viewer.