mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +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,22 +133,17 @@ 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 (!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) {
|
||||
// RELIABLE_SEND_HACK: since we're not yet using a reliable method for non-moving update packets we repeat these
|
||||
// at a faster rate than the MAX period above, and only send a limited number of them.
|
||||
return true;
|
||||
} else {
|
||||
const float NON_MOVING_UPDATE_PERIOD = 1.0f;
|
||||
if (dt > NON_MOVING_UPDATE_PERIOD && _numNonMovingUpdates < MAX_NUM_NON_MOVING_UPDATES) {
|
||||
// RELIABLE_SEND_HACK: since we're not yet using a reliable method for non-moving update packets we repeat these
|
||||
// at a faster rate than the MAX period above, and only send a limited number of them.
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue