mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-03 23:24:34 +02:00
cause changes to _simulatorID to be broadcast
This commit is contained in:
parent
eace91e833
commit
f42a43e180
3 changed files with 9 additions and 2 deletions
|
@ -1194,3 +1194,9 @@ void EntityItem::updateLifetime(float value) {
|
|||
}
|
||||
}
|
||||
|
||||
void EntityItem::updateSimulatorID(QString value) {
|
||||
if (_simulatorID != value) {
|
||||
_simulatorID = value;
|
||||
_dirtyFlags |= EntityItem::DIRTY_UPDATEABLE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -294,6 +294,7 @@ public:
|
|||
void updateCollisionsWillMove(bool value);
|
||||
void updateLifetime(float value);
|
||||
virtual void updateShapeType(ShapeType type) { /* do nothing */ }
|
||||
void updateSimulatorID(QString value);
|
||||
|
||||
uint32_t getDirtyFlags() const { return _dirtyFlags; }
|
||||
void clearDirtyFlags(uint32_t mask = 0xffff) { _dirtyFlags &= ~mask; }
|
||||
|
|
|
@ -193,11 +193,11 @@ bool EntityMotionState::shouldSendUpdate(uint32_t simulationFrame) {
|
|||
|
||||
if (simulatorID.isEmpty() && _body->isActive()) {
|
||||
// The object is moving and nobody thinks they own the motion. set this Node as the simulator
|
||||
_entity->setSimulatorID(myNodeID);
|
||||
_entity->updateSimulatorID(myNodeID);
|
||||
simulatorID = myNodeID;
|
||||
} else if (simulatorID == myNodeID && !_body->isActive()) {
|
||||
// we are the simulator and the object has stopped. give up "simulator" status
|
||||
_entity->setSimulatorID("");
|
||||
_entity->updateSimulatorID("");
|
||||
simulatorID = "";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue