Showing the changes to interface/src/Application.cpp (1 of 8 files). Show all
Unified · Split
| @@ -6282,11 +6282,13 @@ void Application::tryToEnablePhysics() { · 6281 unmodified lines | |||
| 6282 | // process octree stats packets are sent in between full sends of a scene (this isn't currently true). | 6282 | // process octree stats packets are sent in between full sends of a scene (this isn't currently true). |
| 6283 | // We keep physics disabled until we've received a full scene and everything near the avatar in that | 6283 | // We keep physics disabled until we've received a full scene and everything near the avatar in that |
| 6284 | // scene is ready to compute its collision shape. | 6284 | // 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); | ||
| 6286 | _octreeProcessor.resetSafeLanding(); | 6288 | _octreeProcessor.resetSafeLanding(); |
| 6287 | _physicsEnabled = true; | 6289 | _physicsEnabled = true; |
| 6288 | setIsInterstitialMode(false); | 6290 | setIsInterstitialMode(false); |
| 6289 | getMyAvatar()->updateMotionBehaviorFromMenu(); | 6291 | myAvatar->updateMotionBehaviorFromMenu(); |
| 6290 | } | 6292 | } |
| 6291 | } | 6293 | } |
| 6292 | } | 6294 | } |
| @@ -6577,7 +6579,7 @@ void Application::update(float deltaTime) { · 284 unmodified lines | |||
| 6577 | avatarManager->handleProcessedPhysicsTransaction(transaction); | 6579 | avatarManager->handleProcessedPhysicsTransaction(transaction); |
| 6578 | 6580 | ||
| 6579 | myAvatar->prepareForPhysicsSimulation(); | 6581 | myAvatar->prepareForPhysicsSimulation(); |
| 6580 | _physicsEngine->enableGlobalContactAddedCallback(myAvatar->isFlying()); | 6582 | myAvatar->getCharacterController()->preSimulation(); |
| 6581 | } | 6583 | } |
| 6582 | } | 6584 | } |
| 6583 | 6585 | ||
| @@ -6630,6 +6632,7 @@ void Application::update(float deltaTime) { · 46 unmodified lines | |||
| 6630 | 6632 | ||
| 6631 | { | 6633 | { |
| 6632 | PROFILE_RANGE(simulation_physics, "MyAvatar"); | 6634 | PROFILE_RANGE(simulation_physics, "MyAvatar"); |
| 6635 | myAvatar->getCharacterController()->postSimulation(); | ||
| 6633 | myAvatar->harvestResultsFromPhysicsSimulation(deltaTime); | 6636 | myAvatar->harvestResultsFromPhysicsSimulation(deltaTime); |
| 6634 | } | 6637 | } |
| 6635 | 6638 | ||