History

Reduce error tolerances for ballistic prediction that trigger updating the server

Philip Rosedale committed 11 years ago

Commit 61a21961 parent b008b812 files · +5 −3Browse files

Showing the changes to libraries/physics/src/EntityMotionState.cpp (1 of 2 files). Show all

Unified · Split

libraries/physics/src/EntityMotionState.cpp+2−2
@@ -245,7 +245,7 @@ bool EntityMotionState::remoteSimulationOutOfSync(uint32_t simulationStep) { · 244 unmodified lines
245 245
246 float dx2 = glm::distance2(position, _serverPosition);246 float dx2 = glm::distance2(position, _serverPosition);
247 247
248 const float MAX_POSITION_ERROR_SQUARED = 0.001f; // 0.001 m^2 ~~> 0.03 m248 const float MAX_POSITION_ERROR_SQUARED = 0.000004f; // Sqrt() - corresponds to 2 millimeters
249 if (dx2 > MAX_POSITION_ERROR_SQUARED) {249 if (dx2 > MAX_POSITION_ERROR_SQUARED) {
250 250
251 #ifdef WANT_DEBUG251 #ifdef WANT_DEBUG
@@ -270,7 +270,7 @@ bool EntityMotionState::remoteSimulationOutOfSync(uint32_t simulationStep) { · 18 unmodified lines
270 _serverRotation = glm::normalize(computeBulletRotationStep(_serverAngularVelocity, PHYSICS_ENGINE_FIXED_SUBSTEP) * _serverRotation);270 _serverRotation = glm::normalize(computeBulletRotationStep(_serverAngularVelocity, PHYSICS_ENGINE_FIXED_SUBSTEP) * _serverRotation);
271 }271 }
272 }272 }
273 const float MIN_ROTATION_DOT = 0.99f; // 0.99 dot threshold coresponds to about 16 degrees of slop273 const float MIN_ROTATION_DOT = 0.99999f; // This corresponds to about 0.5 degrees of rotation
274 glm::quat actualRotation = bulletToGLM(worldTrans.getRotation());274 glm::quat actualRotation = bulletToGLM(worldTrans.getRotation());
275 275
276 #ifdef WANT_DEBUG276 #ifdef WANT_DEBUG