Changeset 2421 for code/branches
- Timestamp:
- Dec 13, 2008, 2:37:53 PM (16 years ago)
- Location:
- code/branches/physics/src/orxonox/objects/worldentities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics/src/orxonox/objects/worldentities/MovableEntity.cc
r2408 r2421 38 38 { 39 39 static const float MAX_RESYNCHRONIZE_TIME = 3.0f; 40 static const float CONTINUOUS_SYNCHRONIZATION_TIME = 10.0f; 40 41 41 42 CreateFactory(MovableEntity); … … 48 49 this->overwrite_orientation_ = Quaternion::IDENTITY; 49 50 51 // Resynchronise every few seconds because we only work with velocities (no positions) 52 continuousResynchroTimer_ = new Timer<MovableEntity>(CONTINUOUS_SYNCHRONIZATION_TIME + rnd(-1, 1), 53 true, this, createExecutor(createFunctor(&MovableEntity::resynchronize)), false); 54 50 55 this->registerVariables(); 51 56 } … … 53 58 MovableEntity::~MovableEntity() 54 59 { 60 if (this->isInitialized()) 61 delete this->continuousResynchroTimer_; 55 62 } 56 63 … … 90 97 void MovableEntity::clientConnected(unsigned int clientID) 91 98 { 92 resynchronize(); 93 new Timer<MovableEntity>(rnd() * MAX_RESYNCHRONIZE_TIME, true, this, createExecutor(createFunctor(&MovableEntity::resynchronize)), false); 99 new Timer<MovableEntity>(rnd() * MAX_RESYNCHRONIZE_TIME, false, this, createExecutor(createFunctor(&MovableEntity::resynchronize)), true); 94 100 } 95 101 -
code/branches/physics/src/orxonox/objects/worldentities/MovableEntity.h
r2408 r2421 65 65 Vector3 overwrite_position_; 66 66 Quaternion overwrite_orientation_; 67 Timer<MovableEntity>* continuousResynchroTimer_; 67 68 }; 68 69 }
Note: See TracChangeset
for help on using the changeset viewer.