Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 25, 2008, 11:08:19 PM (17 years ago)
Author:
scheusso
Message:

implemented some sort of buffer for the spaceship movements (makes the movements on the client smoother)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/orxonox/objects/SpaceShip.cc

    r1413 r1425  
    7070      Iterator<SpaceShip> it;
    7171      for(it = ObjectList<SpaceShip>::start(); it; ++it){
    72         if((it)->server_ || ( network::Client::getSingleton() && network::Client::getSingleton()->getShipID()==it->objectID ) )
     72        if( (it)->myShip_ )
    7373          return *it;
    7474      }
     
    109109      mouseY_(0.0f),
    110110      emitterRate_(0.0f),
    111       server_(false)
     111      myShip_(false)
    112112    {
    113113        RegisterObject(SpaceShip);
     
    140140
    141141    bool SpaceShip::create(){
     142      if(!myShip_){
     143        if(network::Client::getSingleton() && objectID == network::Client::getSingleton()->getShipID())
     144          myShip_=true;
     145      }
    142146      if(Model::create())
    143147        this->init();
     
    299303        XMLPortParamLoadOnly(SpaceShip, "transDamp", setTransDamp, xmlelement, mode);
    300304        XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, mode);
    301         server_=true; // TODO: this is only a hack
     305        myShip_=true; // TODO: this is only a hack
    302306        SpaceShip::create();
    303307        getFocus();
     
    354358
    355359            Projectile *p = new Projectile(this);
     360            p->create();
    356361
    357362            p->setBacksync(true);
     
    439444            this->tt_->setRate(0);
    440445
    441         if( (network::Client::getSingleton() &&  network::Client::getSingleton()->getShipID() == objectID) || server_ )
     446        if( myShip_ )
    442447        {
    443448          COUT(4) << "steering our ship: " << objectID << std::endl;
Note: See TracChangeset for help on using the changeset viewer.