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
48594859 // we haven't yet enabled physics. we wait until we think we have all the collision information
48604860 // for nearby entities before starting bullet up.
48614861 quint64 now = usecTimestampNow();
4862− bool timeout = false;
48634862 const int PHYSICS_CHECK_TIMEOUT = 2 * USECS_PER_SECOND;
4864− if (_lastPhysicsCheckTime > 0 && now - _lastPhysicsCheckTime > PHYSICS_CHECK_TIMEOUT) {
4865− timeout = true;
4866− }
48674863
4868− if (timeout || _fullSceneReceivedCounter > _fullSceneCounterAtLastPhysicsCheck) {
4864+ if (now - _lastPhysicsCheckTime > PHYSICS_CHECK_TIMEOUT || _fullSceneReceivedCounter > _fullSceneCounterAtLastPhysicsCheck) {
48694865 // we've received a new full-scene octree stats packet, or it's been long enough to try again anyway
48704866 _lastPhysicsCheckTime = now;
48714867 _fullSceneCounterAtLastPhysicsCheck = _fullSceneReceivedCounter;