mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 16:10:40 +02:00
remove pessimistic send of object updates
we have not yet seen the headache of packetloss and unreliable messages
This commit is contained in:
parent
250fd98fee
commit
4c1cd991f4
1 changed files with 9 additions and 14 deletions
|
@ -133,16 +133,10 @@ bool ObjectMotionState::shouldSendUpdate(uint32_t simulationFrame) {
|
|||
_sentFrame = simulationFrame;
|
||||
bool isActive = _body->isActive();
|
||||
|
||||
if (isActive) {
|
||||
const float MAX_UPDATE_PERIOD_FOR_ACTIVE_THINGS = 10.0f;
|
||||
if (dt > MAX_UPDATE_PERIOD_FOR_ACTIVE_THINGS) {
|
||||
return true;
|
||||
}
|
||||
} else if (_sentMoving) {
|
||||
if (!isActive) {
|
||||
if (_sentMoving) {
|
||||
// this object just went inactive so send an update immediately
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
const float NON_MOVING_UPDATE_PERIOD = 1.0f;
|
||||
if (dt > NON_MOVING_UPDATE_PERIOD && _numNonMovingUpdates < MAX_NUM_NON_MOVING_UPDATES) {
|
||||
|
@ -151,6 +145,7 @@ bool ObjectMotionState::shouldSendUpdate(uint32_t simulationFrame) {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Else we measure the error between current and extrapolated transform (according to expected behavior
|
||||
// of remote EntitySimulation) and return true if the error is significant.
|
||||
|
|
Loading…
Reference in a new issue