Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 26, 2008, 5:02:14 PM (17 years ago)
Author:
scheusso
Message:

Made various changes to Classes WorldEntity, Model, SpaceShip,
BulletManager and AmmunitionDump in order to make them really
synchronisable.
I hope, that everythings still working now. I only did some small tests
(ie no segfault when running/starting and acting)

File:
1 edited

Legend:

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

    r871 r927  
    4949        RegisterObject(WorldEntity);
    5050
    51         if (Orxonox::getSingleton()->getSceneManager())
    52         {
    53             std::ostringstream name;
    54             name << (WorldEntity::worldEntityCounter_s++);
    55             this->setName("WorldEntity" + name.str());
    56             this->node_ = Orxonox::getSingleton()->getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName());
    57         }
    58         else
    59         {
    60             this->node_ = 0;
    61         }
     51        //create();
    6252
    6353        this->bStatic_ = true;
     
    6757        this->rotationRate_ = 0;
    6858        this->momentum_ = 0;
     59       
     60        if (Orxonox::getSingleton()->getSceneManager())
     61        {
     62          std::ostringstream name;
     63          name << (WorldEntity::worldEntityCounter_s++);
     64          this->setName("WorldEntity" + name.str());
     65          this->node_ = Orxonox::getSingleton()->getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName());
     66       
     67          registerAllVariables();
     68        }
     69        else
     70        {
     71          this->node_ = 0;
     72        }
    6973    }
    7074
     
    8993
    9094        BaseObject::loadParams(xmlElem);
     95        create();
    9196/*
    9297        if (xmlElem->Attribute("position"))
     
    185190    }
    186191
    187     bool WorldEntity::create(){
    188       registerAllVariables();
    189       return true;
    190     }
    191192
    192193    void WorldEntity::registerAllVariables()
    193194    {
    194 /*      // register coordinates
     195      // register coordinates
    195196      registerVar( (void*) &(this->getPosition().x), sizeof(this->getPosition().x), network::DATA);
    196197      registerVar( (void*) &(this->getPosition().y), sizeof(this->getPosition().y), network::DATA);
     
    200201      registerVar( (void*) &(this->getOrientation().x), sizeof(this->getOrientation().x), network::DATA);
    201202      registerVar( (void*) &(this->getOrientation().y), sizeof(this->getOrientation().y), network::DATA);
    202       registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA);*/
     203      registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA);
    203204      // not needed at the moment, because we don't have prediction yet
    204       /*// register velocity_
     205      // register velocity_
    205206      registerVar( (void*) &(this->getVelocity().x), sizeof(this->getVelocity().x), network::DATA);
    206207      registerVar( (void*) &(this->getVelocity().y), sizeof(this->getVelocity().y), network::DATA);
     
    210211      registerVar( (void*) &(this->getRotationAxis().x), sizeof(this->getRotationAxis().x), network::DATA);
    211212      registerVar( (void*) &(this->getRotationAxis().y), sizeof(this->getRotationAxis().y), network::DATA);
    212       registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA);*/
     213      registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA);
    213214    }
    214215
Note: See TracChangeset for help on using the changeset viewer.