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
245245
246246 float dx2 = glm::distance2(position, _serverPosition);
247247
248− const float MAX_POSITION_ERROR_SQUARED = 0.001f; // 0.001 m^2 ~~> 0.03 m
248+ const float MAX_POSITION_ERROR_SQUARED = 0.000004f; // Sqrt() - corresponds to 2 millimeters
249249 if (dx2 > MAX_POSITION_ERROR_SQUARED) {
250250
251251 #ifdef WANT_DEBUG
@@ -270,7 +270,7 @@ bool EntityMotionState::remoteSimulationOutOfSync(uint32_t simulationStep) { · 18 unmodified lines
270270 _serverRotation = glm::normalize(computeBulletRotationStep(_serverAngularVelocity, PHYSICS_ENGINE_FIXED_SUBSTEP) * _serverRotation);
271271 }
272272 }
273− const float MIN_ROTATION_DOT = 0.99f; // 0.99 dot threshold coresponds to about 16 degrees of slop
273+ const float MIN_ROTATION_DOT = 0.99999f; // This corresponds to about 0.5 degrees of rotation
274274 glm::quat actualRotation = bulletToGLM(worldTrans.getRotation());
275275
276276 #ifdef WANT_DEBUG