remove pessimistic send of object updates

we have not yet seen the headache of packetloss and unreliable messages
This commit is contained in:
Andrew Meadows 2015-01-15 17:53:37 -08:00
parent 250fd98fee
commit 4c1cd991f4

View file

@ -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.