Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 13, 2008, 5:01:10 PM (17 years ago)
Author:
scheusso
Message:

merge network3 and camera branch into merge branch

File:
1 edited

Legend:

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

    r1263 r1264  
    6666        }
    6767    }
     68   
    6869
    6970    WorldEntity::~WorldEntity()
    7071    {
     72      // just to make sure we clean out all scene nodes
     73      if(this->getNode())
     74        this->getNode()->removeAndDestroyAllChildren();
    7175    }
    7276
     
    7579        if (!this->bStatic_)
    7680        {
     81//             COUT(4) << "acceleration: " << this->acceleration_ << " velocity: " << this->velocity_ << std::endl;
    7782            this->velocity_ += (dt * this->acceleration_);
    7883            this->translate(dt * this->velocity_, Ogre::Node::TS_LOCAL);
     
    8994        create();
    9095    }
     96   
    9197
    9298    void WorldEntity::setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll)
     
    115121
    116122        XMLPortObject(WorldEntity, WorldEntity, "attached", attachWorldEntity, getAttachedWorldEntity, xmlelement, mode, false, true);
     123       
     124        WorldEntity::create();
    117125    }
    118126
     
    121129    {
    122130      // register coordinates
    123       registerVar( (void*) &(this->getPosition().x), sizeof(this->getPosition().x), network::DATA);
    124       registerVar( (void*) &(this->getPosition().y), sizeof(this->getPosition().y), network::DATA);
    125       registerVar( (void*) &(this->getPosition().z), sizeof(this->getPosition().z), network::DATA);
     131      registerVar( (void*) &(this->getPosition().x), sizeof(this->getPosition().x), network::DATA, 0x3);
     132      registerVar( (void*) &(this->getPosition().y), sizeof(this->getPosition().y), network::DATA, 0x3);
     133      registerVar( (void*) &(this->getPosition().z), sizeof(this->getPosition().z), network::DATA, 0x3);
    126134      // register orientation
    127       registerVar( (void*) &(this->getOrientation().w), sizeof(this->getOrientation().w), network::DATA);
    128       registerVar( (void*) &(this->getOrientation().x), sizeof(this->getOrientation().x), network::DATA);
    129       registerVar( (void*) &(this->getOrientation().y), sizeof(this->getOrientation().y), network::DATA);
    130       registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA);
    131       // not needed at the moment, because we don't have prediction yet
     135      registerVar( (void*) &(this->getOrientation().w), sizeof(this->getOrientation().w), network::DATA, 0x3);
     136      registerVar( (void*) &(this->getOrientation().x), sizeof(this->getOrientation().x), network::DATA, 0x3);
     137      registerVar( (void*) &(this->getOrientation().y), sizeof(this->getOrientation().y), network::DATA, 0x3);
     138      registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA, 0x3);
    132139      // register velocity_
    133       registerVar( (void*) &(this->getVelocity().x), sizeof(this->getVelocity().x), network::DATA);
    134       registerVar( (void*) &(this->getVelocity().y), sizeof(this->getVelocity().y), network::DATA);
    135       registerVar( (void*) &(this->getVelocity().z), sizeof(this->getVelocity().z), network::DATA);
    136       // register rotationAxis/rate
    137       registerVar( (void*) &(this->getRotationRate()), sizeof(this->getRotationRate()), network::DATA);
    138       registerVar( (void*) &(this->getRotationAxis().x), sizeof(this->getRotationAxis().x), network::DATA);
    139       registerVar( (void*) &(this->getRotationAxis().y), sizeof(this->getRotationAxis().y), network::DATA);
    140       registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA);
     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);
     148      // register scale of node
     149      registerVar( (void*) &(this->getScale().x), sizeof(this->getScale().x), network::DATA, 0x3);
     150      registerVar( (void*) &(this->getScale().y), sizeof(this->getScale().y), network::DATA, 0x3);
     151      registerVar( (void*) &(this->getScale().z), sizeof(this->getScale().z), network::DATA, 0x3);
     152      //register staticity
     153      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);
    141159    }
    142160
Note: See TracChangeset for help on using the changeset viewer.