Changeset 2470
- Timestamp:
- Dec 15, 2008, 9:40:09 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/orxonox/objects/worldentities/MovableEntity.cc
r2459 r2470 34 34 #include "core/XMLPort.h" 35 35 #include "core/Executor.h" 36 #include "core/Core.h" 36 37 #include "tools/Timer.h" 37 38 … … 49 50 this->overwrite_position_ = Vector3::ZERO; 50 51 this->overwrite_orientation_ = Quaternion::IDENTITY; 51 52 this->setPriority( priority::low );53 52 54 // Resynchronise every few seconds because we only work with velocities (no positions)55 continuousResynchroTimer_ = new Timer<MovableEntity>(CONTINUOUS_SYNCHRONIZATION_TIME + rnd(-1, 1), 56 true, this, createExecutor(createFunctor(&MovableEntity::resynchronize)), false);53 this->continuousResynchroTimer_ = 0; 54 55 this->setPriority(priority::low); 57 56 58 57 this->registerVariables(); … … 62 61 { 63 62 if (this->isInitialized()) 64 delete this->continuousResynchroTimer_; 63 if (this->continuousResynchroTimer_) 64 delete this->continuousResynchroTimer_; 65 65 } 66 66 … … 90 90 void MovableEntity::resynchronize() 91 91 { 92 if (Core::isMaster() && !this->continuousResynchroTimer_) 93 { 94 // Resynchronise every few seconds because we only work with velocities (no positions) 95 continuousResynchroTimer_ = new Timer<MovableEntity>(CONTINUOUS_SYNCHRONIZATION_TIME + rnd(-1, 1), 96 true, this, createExecutor(createFunctor(&MovableEntity::resynchronize)), false); 97 } 98 92 99 this->overwrite_position_ = this->getPosition(); 93 100 this->overwrite_orientation_ = this->getOrientation();
Note: See TracChangeset
for help on using the changeset viewer.