History

fix timeout for physics check

SamGondelman committed 9 years ago

Commit cbf82a61 parent b85a5502 files · +2 −6Browse files

Showing the changes to interface/src/Application.cpp (1 of 2 files). Show all

Unified · Split

interface/src/Application.cpp+1−5
@@ -4859,13 +4859,9 @@ void Application::update(float deltaTime) { · 4858 unmodified lines
4859 // we haven't yet enabled physics. we wait until we think we have all the collision information4859 // we haven't yet enabled physics. we wait until we think we have all the collision information
4860 // for nearby entities before starting bullet up.4860 // for nearby entities before starting bullet up.
4861 quint64 now = usecTimestampNow();4861 quint64 now = usecTimestampNow();
4862 bool timeout = false;
4863 const int PHYSICS_CHECK_TIMEOUT = 2 * USECS_PER_SECOND;4862 const int PHYSICS_CHECK_TIMEOUT = 2 * USECS_PER_SECOND;
4864 if (_lastPhysicsCheckTime > 0 && now - _lastPhysicsCheckTime > PHYSICS_CHECK_TIMEOUT) {
4865 timeout = true;
4866 }
4867 4863
4868 if (timeout || _fullSceneReceivedCounter > _fullSceneCounterAtLastPhysicsCheck) {4864 if (now - _lastPhysicsCheckTime > PHYSICS_CHECK_TIMEOUT || _fullSceneReceivedCounter > _fullSceneCounterAtLastPhysicsCheck) {
4869 // we've received a new full-scene octree stats packet, or it's been long enough to try again anyway4865 // we've received a new full-scene octree stats packet, or it's been long enough to try again anyway
4870 _lastPhysicsCheckTime = now;4866 _lastPhysicsCheckTime = now;
4871 _fullSceneCounterAtLastPhysicsCheck = _fullSceneReceivedCounter;4867 _fullSceneCounterAtLastPhysicsCheck = _fullSceneReceivedCounter;