Showing the changes to interface/src/Application.cpp (1 of 16 files). Show all
Unified · Split
| @@ -159,6 +159,7 @@ · 158 unmodified lines | ||
| 159 | 159 | #include "avatar/AvatarManager.h" |
| 160 | 160 | #include "avatar/MyHead.h" |
| 161 | 161 | #include "avatar/AvatarPackager.h" |
| 162 | +#include "avatar/MyCharacterController.h" | |
| 162 | 163 | #include "CrashRecoveryHandler.h" |
| 163 | 164 | #include "CrashHandler.h" |
| 164 | 165 | #include "devices/DdeFaceTracker.h" |
| @@ -2635,7 +2636,14 @@ Application::~Application() { · 2470 unmodified lines | ||
| 2635 | 2636 | avatarManager->handleProcessedPhysicsTransaction(transaction); |
| 2636 | 2637 | |
| 2637 | 2638 | avatarManager->deleteAllAvatars(); |
| 2639 | + | |
| 2640 | + auto myCharacterController = getMyAvatar()->getCharacterController(); | |
| 2641 | + myCharacterController->clearDetailedMotionStates(); | |
| 2638 | 2642 | |
| 2643 | + myCharacterController->buildPhysicsTransaction(transaction); | |
| 2644 | + _physicsEngine->processTransaction(transaction); | |
| 2645 | + myCharacterController->handleProcessedPhysicsTransaction(transaction); | |
| 2646 | + | |
| 2639 | 2647 | _physicsEngine->setCharacterController(nullptr); |
| 2640 | 2648 | |
| 2641 | 2649 | // the _shapeManager should have zero references |
| @@ -6123,7 +6131,9 @@ void Application::update(float deltaTime) { · 3481 unmodified lines | ||
| 6123 | 6131 | avatarManager->buildPhysicsTransaction(transaction); |
| 6124 | 6132 | _physicsEngine->processTransaction(transaction); |
| 6125 | 6133 | avatarManager->handleProcessedPhysicsTransaction(transaction); |
| 6126 | − | |
| 6134 | + myAvatar->getCharacterController()->buildPhysicsTransaction(transaction); | |
| 6135 | + _physicsEngine->processTransaction(transaction); | |
| 6136 | + myAvatar->getCharacterController()->handleProcessedPhysicsTransaction(transaction); | |
| 6127 | 6137 | myAvatar->prepareForPhysicsSimulation(); |
| 6128 | 6138 | _physicsEngine->forEachDynamic([&](EntityDynamicPointer dynamic) { |
| 6129 | 6139 | dynamic->prepareForPhysicsSimulation(); |