adjust how the decision to send action changes over the wire is made

This commit is contained in:
Seth Alves 2015-11-12 16:27:54 -08:00
parent d7be1699a7
commit 6f83f32ecc
2 changed files with 17 additions and 27 deletions

View file

@ -87,7 +87,6 @@ void EntityMotionState::updateServerPhysicsVariables(const QUuid& sessionID) {
} }
_serverActionData = _entity->getActionData(); _serverActionData = _entity->getActionData();
if (!_serverShouldSuppressLocationEdits) {
_serverPosition = _entity->getPosition(); _serverPosition = _entity->getPosition();
_serverRotation = _entity->getRotation(); _serverRotation = _entity->getRotation();
_serverVelocity = _entity->getVelocity(); _serverVelocity = _entity->getVelocity();
@ -95,9 +94,6 @@ void EntityMotionState::updateServerPhysicsVariables(const QUuid& sessionID) {
_serverAcceleration = _entity->getAcceleration(); _serverAcceleration = _entity->getAcceleration();
} }
_serverShouldSuppressLocationEdits = _entity->shouldSuppressLocationEdits();
}
// virtual // virtual
bool EntityMotionState::handleEasyChanges(uint32_t flags, PhysicsEngine* engine) { bool EntityMotionState::handleEasyChanges(uint32_t flags, PhysicsEngine* engine) {
assert(entityTreeIsLocked()); assert(entityTreeIsLocked());
@ -262,7 +258,6 @@ bool EntityMotionState::remoteSimulationOutOfSync(uint32_t simulationStep) {
_serverAngularVelocity = bulletToGLM(_body->getAngularVelocity()); _serverAngularVelocity = bulletToGLM(_body->getAngularVelocity());
_lastStep = simulationStep; _lastStep = simulationStep;
_serverActionData = _entity->getActionData(); _serverActionData = _entity->getActionData();
_serverShouldSuppressLocationEdits = _entity->shouldSuppressLocationEdits();
_sentInactive = true; _sentInactive = true;
return false; return false;
} }
@ -448,24 +443,20 @@ void EntityMotionState::sendUpdate(OctreeEditPacketSender* packetSender, const Q
EntityItemProperties properties; EntityItemProperties properties;
// explicitly set the properties that changed so that they will be packed
if (!_serverShouldSuppressLocationEdits) {
// remember properties for local server prediction // remember properties for local server prediction
_serverPosition = _entity->getPosition(); _serverPosition = _entity->getPosition();
_serverRotation = _entity->getRotation(); _serverRotation = _entity->getRotation();
_serverVelocity = _entity->getVelocity(); _serverVelocity = _entity->getVelocity();
_serverAcceleration = _entity->getAcceleration(); _serverAcceleration = _entity->getAcceleration();
_serverAngularVelocity = _entity->getAngularVelocity(); _serverAngularVelocity = _entity->getAngularVelocity();
_serverActionData = _entity->getActionData();
// explicitly set the properties that changed so that they will be packed
properties.setPosition(_serverPosition); properties.setPosition(_serverPosition);
properties.setRotation(_serverRotation); properties.setRotation(_serverRotation);
properties.setVelocity(_serverVelocity); properties.setVelocity(_serverVelocity);
properties.setAcceleration(_serverAcceleration); properties.setAcceleration(_serverAcceleration);
properties.setAngularVelocity(_serverAngularVelocity); properties.setAngularVelocity(_serverAngularVelocity);
}
_serverShouldSuppressLocationEdits = _entity->shouldSuppressLocationEdits();
_serverActionData = _entity->getActionData();
properties.setActionData(_serverActionData); properties.setActionData(_serverActionData);
// set the LastEdited of the properties but NOT the entity itself // set the LastEdited of the properties but NOT the entity itself

View file

@ -110,7 +110,6 @@ protected:
glm::vec3 _serverGravity; glm::vec3 _serverGravity;
glm::vec3 _serverAcceleration; glm::vec3 _serverAcceleration;
QByteArray _serverActionData; QByteArray _serverActionData;
bool _serverShouldSuppressLocationEdits = false;
uint32_t _lastMeasureStep; uint32_t _lastMeasureStep;
glm::vec3 _lastVelocity; glm::vec3 _lastVelocity;