History

improved isStuck detection and MyAvatar::safeLanding() trigger

Andrew Meadows committed 7 years ago

Commit 32400a61 parent 9382fb88 files · +311 −189Browse files

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

Unified · Split

interface/src/Application.cpp+6−3
@@ -6282,11 +6282,13 @@ void Application::tryToEnablePhysics() { · 6281 unmodified lines
62826282 // process octree stats packets are sent in between full sends of a scene (this isn't currently true).
62836283 // We keep physics disabled until we've received a full scene and everything near the avatar in that
62846284 // scene is ready to compute its collision shape.
6285− if (getMyAvatar()->isReadyForPhysics()) {
6285+ auto myAvatar = getMyAvatar();
6286+ if (myAvatar->isReadyForPhysics()) {
6287+ myAvatar->getCharacterController()->setPhysicsEngine(_physicsEngine);
62866288 _octreeProcessor.resetSafeLanding();
62876289 _physicsEnabled = true;
62886290 setIsInterstitialMode(false);
6289− getMyAvatar()->updateMotionBehaviorFromMenu();
6291+ myAvatar->updateMotionBehaviorFromMenu();
62906292 }
62916293 }
62926294 }
@@ -6577,7 +6579,7 @@ void Application::update(float deltaTime) { · 284 unmodified lines
65776579 avatarManager->handleProcessedPhysicsTransaction(transaction);
65786580
65796581 myAvatar->prepareForPhysicsSimulation();
6580− _physicsEngine->enableGlobalContactAddedCallback(myAvatar->isFlying());
6582+ myAvatar->getCharacterController()->preSimulation();
65816583 }
65826584 }
65836585
@@ -6630,6 +6632,7 @@ void Application::update(float deltaTime) { · 46 unmodified lines
66306632
66316633 {
66326634 PROFILE_RANGE(simulation_physics, "MyAvatar");
6635+ myAvatar->getCharacterController()->postSimulation();
66336636 myAvatar->harvestResultsFromPhysicsSimulation(deltaTime);
66346637 }
66356638