Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all
Unified · Split
| @@ -2589,6 +2589,9 @@ void Application::update(float deltaTime) { · 2588 unmodified lines | |||
| 2589 | updateLOD(); | 2589 | updateLOD(); |
| 2590 | updateMouseRay(); // check what's under the mouse and update the mouse voxel | 2590 | updateMouseRay(); // check what's under the mouse and update the mouse voxel |
| 2591 | 2591 | ||
| 2592 | // update the avatar with a fresh HMD pose | ||
| 2593 | _myAvatar->updateFromHMDSensorMatrix(getHMDSensorPose()); | ||
| 2594 | |||
| 2592 | { | 2595 | { |
| 2593 | PerformanceTimer perfTimer("devices"); | 2596 | PerformanceTimer perfTimer("devices"); |
| 2594 | DeviceTracker::updateAll(); | 2597 | DeviceTracker::updateAll(); |
| @@ -2693,7 +2696,6 @@ void Application::update(float deltaTime) { · 98 unmodified lines | |||
| 2693 | _entitySimulation.applyActionChanges(); | 2696 | _entitySimulation.applyActionChanges(); |
| 2694 | _entitySimulation.unlock(); | 2697 | _entitySimulation.unlock(); |
| 2695 | 2698 | ||
| 2696 | |||
| 2697 | AvatarManager* avatarManager = DependencyManager::get<AvatarManager>().data(); | 2699 | AvatarManager* avatarManager = DependencyManager::get<AvatarManager>().data(); |
| 2698 | _physicsEngine.deleteObjects(avatarManager->getObjectsToDelete()); | 2700 | _physicsEngine.deleteObjects(avatarManager->getObjectsToDelete()); |
| 2699 | _physicsEngine.addObjects(avatarManager->getObjectsToAdd()); | 2701 | _physicsEngine.addObjects(avatarManager->getObjectsToAdd()); |
| @@ -2703,9 +2705,6 @@ void Application::update(float deltaTime) { · 3 unmodified lines | |||
| 2703 | _physicsEngine.stepSimulation(); | 2705 | _physicsEngine.stepSimulation(); |
| 2704 | _entities.getTree()->unlock(); | 2706 | _entities.getTree()->unlock(); |
| 2705 | 2707 | ||
| 2706 | // update the avatar with the current HMD pose | ||
| 2707 | _myAvatar->setHMDSensorMatrix(getHMDSensorPose()); | ||
| 2708 | |||
| 2709 | if (_physicsEngine.hasOutgoingChanges()) { | 2708 | if (_physicsEngine.hasOutgoingChanges()) { |
| 2710 | _entities.getTree()->lockForWrite(); | 2709 | _entities.getTree()->lockForWrite(); |
| 2711 | _entitySimulation.lock(); | 2710 | _entitySimulation.lock(); |
| @@ -2803,6 +2802,9 @@ void Application::update(float deltaTime) { · 91 unmodified lines | |||
| 2803 | QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), "sendDownstreamAudioStatsPacket", Qt::QueuedConnection); | 2802 | QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), "sendDownstreamAudioStatsPacket", Qt::QueuedConnection); |
| 2804 | } | 2803 | } |
| 2805 | } | 2804 | } |
| 2805 | |||
| 2806 | // update sensorToWorldMatrix for rendering camera. | ||
| 2807 | _myAvatar->updateSensorToWorldMatrix(); | ||
| 2806 | } | 2808 | } |
| 2807 | 2809 | ||
| 2808 | void Application::setPalmData(Hand* hand, UserInputMapper::PoseValue pose, int index) { | 2810 | void Application::setPalmData(Hand* hand, UserInputMapper::PoseValue pose, int index) { |