Changeset 1264 for code/branches/merge/src/orxonox/objects/WorldEntity.cc
- Timestamp:
- May 13, 2008, 5:01:10 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/merge/src/orxonox/objects/WorldEntity.cc
r1263 r1264 66 66 } 67 67 } 68 68 69 69 70 WorldEntity::~WorldEntity() 70 71 { 72 // just to make sure we clean out all scene nodes 73 if(this->getNode()) 74 this->getNode()->removeAndDestroyAllChildren(); 71 75 } 72 76 … … 75 79 if (!this->bStatic_) 76 80 { 81 // COUT(4) << "acceleration: " << this->acceleration_ << " velocity: " << this->velocity_ << std::endl; 77 82 this->velocity_ += (dt * this->acceleration_); 78 83 this->translate(dt * this->velocity_, Ogre::Node::TS_LOCAL); … … 89 94 create(); 90 95 } 96 91 97 92 98 void WorldEntity::setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll) … … 115 121 116 122 XMLPortObject(WorldEntity, WorldEntity, "attached", attachWorldEntity, getAttachedWorldEntity, xmlelement, mode, false, true); 123 124 WorldEntity::create(); 117 125 } 118 126 … … 121 129 { 122 130 // 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); 126 134 // 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); 132 139 // 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); 141 159 } 142 160
Note: See TracChangeset
for help on using the changeset viewer.