Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 19, 2007, 12:04:49 AM (16 years ago)
Author:
scheusso
Message:

made Model and WorldEntity synchronisable

File:
1 edited

Legend:

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

    r622 r630  
    4646        RegisterObject(WorldEntity);
    4747
     48        registerAllVariables();
    4849        if (Orxonox::getSingleton()->getSceneManager())
    4950        {
     
    151152        }
    152153
     154        create();
     155       
    153156    }
    154157
     158    bool WorldEntity::create(){
     159      return true;
     160    }
     161   
    155162    void WorldEntity::registerAllVariables()
    156163    {
    157       // to be implemented !
     164      // register coordinates
     165      registerVar( (void*) &(this->getPosition().x), sizeof(this->getPosition().x), network::DATA);
     166      registerVar( (void*) &(this->getPosition().y), sizeof(this->getPosition().y), network::DATA);
     167      registerVar( (void*) &(this->getPosition().z), sizeof(this->getPosition().z), network::DATA);
     168      // register orientation
     169      registerVar( (void*) &(this->getOrientation().w), sizeof(this->getOrientation().w), network::DATA);
     170      registerVar( (void*) &(this->getOrientation().x), sizeof(this->getOrientation().x), network::DATA);
     171      registerVar( (void*) &(this->getOrientation().y), sizeof(this->getOrientation().y), network::DATA);
     172      registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA);
     173      // not needed at the moment, because we don't have prediction yet
     174      /*// register velocity_
     175      registerVar( (void*) &(this->getVelocity().x), sizeof(this->getVelocity().x), network::DATA);
     176      registerVar( (void*) &(this->getVelocity().y), sizeof(this->getVelocity().y), network::DATA);
     177      registerVar( (void*) &(this->getVelocity().z), sizeof(this->getVelocity().z), network::DATA);
     178      // register rotationAxis/rate
     179      registerVar( (void*) &(this->getRotationRate()), sizeof(this->getRotationRate()), network::DATA);
     180      registerVar( (void*) &(this->getRotationAxis().x), sizeof(this->getRotationAxis().x), network::DATA);
     181      registerVar( (void*) &(this->getRotationAxis().y), sizeof(this->getRotationAxis().y), network::DATA);
     182      registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA);*/
    158183    }
    159184}
Note: See TracChangeset for help on using the changeset viewer.