Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 22, 2008, 2:02:06 PM (17 years ago)
Author:
rgrieder
Message:

merged merge branch back to trunk

Location:
code/trunk/src/orxonox/objects
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/objects/Projectile.cc

    r1293 r1360  
    6363
    6464        this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Projectile::destroyObject)));
     65        this->classID = this->getIdentifier()->getNetworkID(); // TODO: remove this hack
     66//        COUT(3) << this->classID << std::endl;
    6567    }
    6668
  • code/trunk/src/orxonox/objects/SpaceShip.cc

    r1349 r1360  
    6262    SpaceShip* SpaceShip::instance_s;
    6363
     64    SpaceShip *SpaceShip::getLocalShip(){
     65      Iterator<SpaceShip> it;
     66      for(it = ObjectList<SpaceShip>::start(); it; ++it){
     67        if((it)->server_ || ( network::Client::getSingleton() && network::Client::getSingleton()->getShipID()==it->objectID ) )
     68          return *it;
     69      }
     70      return NULL;
     71    }
     72   
    6473    SpaceShip::SpaceShip() :
    6574      //testvector_(0,0,0),
     
    145154    void SpaceShip::init()
    146155    {
    147     if ((server_ || ( network::Client::getSingleton() && network::Client::getSingleton()->getShipID()==objectID ) ))
    148     {
    149           if (!setMouseEventCallback_)
    150           {
    151               InputManager::addMouseHandler(this, "SpaceShip");
    152               setMouseEventCallback_ = true;
    153           }
    154     }
     156        if ((server_ || ( network::Client::getSingleton() && network::Client::getSingleton()->getShipID()==objectID ) ))
     157        {
     158              if (!setMouseEventCallback_)
     159              {
     160                  InputManager::addMouseHandler(this, "SpaceShip");
     161                  //InputManager::enableMouseHandler("SpaceShip");
     162                  setMouseEventCallback_ = true;
     163              }
     164        }
    155165
    156166        // START CREATING THRUSTER
     
    394404        if (this->bLMousePressed_ && this->timeToReload_ <= 0)
    395405        {
     406         
    396407            Projectile *p = new Projectile(this);
     408           
    397409            p->setBacksync(true);
    398410            this->timeToReload_ = this->reloadTime_;
  • code/trunk/src/orxonox/objects/SpaceShip.h

    r1349 r1360  
    4444    {
    4545        public:
     46         
     47            static SpaceShip *getLocalShip();
     48           
    4649            SpaceShip();
    4750            ~SpaceShip();
  • code/trunk/src/orxonox/objects/WorldEntity.cc

    r1293 r1360  
    138138      registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA, 0x3);
    139139      // register velocity_
    140 //       registerVar( (void*) &(this->getVelocity().x), sizeof(this->getVelocity().x), network::DATA, 0x3);
    141 //       registerVar( (void*) &(this->getVelocity().y), sizeof(this->getVelocity().y), network::DATA, 0x3);
    142 //       registerVar( (void*) &(this->getVelocity().z), sizeof(this->getVelocity().z), network::DATA, 0x3);
    143 //       // register rotationAxis/rate
    144 //       registerVar( (void*) &(this->getRotationRate()), sizeof(this->getRotationRate()), network::DATA, 0x3);
    145 //       registerVar( (void*) &(this->getRotationAxis().x), sizeof(this->getRotationAxis().x), network::DATA, 0x3);
    146 //       registerVar( (void*) &(this->getRotationAxis().y), sizeof(this->getRotationAxis().y), network::DATA, 0x3);
    147 //       registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA, 0x3);
     140      registerVar( (void*) &(this->getVelocity().x), sizeof(this->getVelocity().x), network::DATA, 0x3);
     141      registerVar( (void*) &(this->getVelocity().y), sizeof(this->getVelocity().y), network::DATA, 0x3);
     142      registerVar( (void*) &(this->getVelocity().z), sizeof(this->getVelocity().z), network::DATA, 0x3);
     143      // register rotationAxis/rate
     144      registerVar( (void*) &(this->getRotationRate()), sizeof(this->getRotationRate()), network::DATA, 0x3);
     145      registerVar( (void*) &(this->getRotationAxis().x), sizeof(this->getRotationAxis().x), network::DATA, 0x3);
     146      registerVar( (void*) &(this->getRotationAxis().y), sizeof(this->getRotationAxis().y), network::DATA, 0x3);
     147      registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA, 0x3);
    148148      // register scale of node
    149149      registerVar( (void*) &(this->getScale().x), sizeof(this->getScale().x), network::DATA, 0x3);
     
    152152      //register staticity
    153153      registerVar( (void*) &(this->bStatic_), sizeof(this->bStatic_), network::DATA, 0x3);
    154       //register acceleration
    155       // register velocity_
    156 //       registerVar( (void*) &(this->getAcceleration().x), sizeof(this->getAcceleration().x), network::DATA, 0x3);
    157 //       registerVar( (void*) &(this->getAcceleration().y), sizeof(this->getAcceleration().y), network::DATA, 0x3);
    158 //       registerVar( (void*) &(this->getAcceleration().z), sizeof(this->getAcceleration().z), network::DATA, 0x3);
     154      //register acceleration & momentum
     155      registerVar( (void*) &(this->getAcceleration().x), sizeof(this->getAcceleration().x), network::DATA, 0x3);
     156      registerVar( (void*) &(this->getAcceleration().y), sizeof(this->getAcceleration().y), network::DATA, 0x3);
     157      registerVar( (void*) &(this->getAcceleration().z), sizeof(this->getAcceleration().z), network::DATA, 0x3);
     158      registerVar( (void*) &(this->getMomentum()), sizeof(this->getMomentum()), network::DATA);
    159159    }
    160160
Note: See TracChangeset for help on using the changeset viewer.