Eye tracking bug fix and debug rendering improvements
Showing the changes to interface/src/Application.cpp (1 of 20 files). Show all
Unified · Split
| @@ -45,11 +45,13 @@ · 44 unmodified lines | |||
| 45 | #include <ResourceScriptingInterface.h> | 45 | #include <ResourceScriptingInterface.h> |
| 46 | #include <AccountManager.h> | 46 | #include <AccountManager.h> |
| 47 | #include <AddressManager.h> | 47 | #include <AddressManager.h> |
| 48 | #include <AnimDebugDraw.h> | ||
| 48 | #include <BuildInfo.h> | 49 | #include <BuildInfo.h> |
| 49 | #include <AssetClient.h> | 50 | #include <AssetClient.h> |
| 50 | #include <AutoUpdater.h> | 51 | #include <AutoUpdater.h> |
| 51 | #include <AudioInjectorManager.h> | 52 | #include <AudioInjectorManager.h> |
| 52 | #include <CursorManager.h> | 53 | #include <CursorManager.h> |
| 54 | #include <DebugDraw.h> | ||
| 53 | #include <DeferredLightingEffect.h> | 55 | #include <DeferredLightingEffect.h> |
| 54 | #include <display-plugins/DisplayPlugin.h> | 56 | #include <display-plugins/DisplayPlugin.h> |
| 55 | #include <EntityScriptingInterface.h> | 57 | #include <EntityScriptingInterface.h> |
| @@ -101,7 +103,7 @@ · 45 unmodified lines | |||
| 101 | #include <Preferences.h> | 103 | #include <Preferences.h> |
| 102 | #include <display-plugins/CompositorHelper.h> | 104 | #include <display-plugins/CompositorHelper.h> |
| 103 | 105 | ||
| 104 | #include "AnimDebugDraw.h" | 106 | |
| 105 | #include "AudioClient.h" | 107 | #include "AudioClient.h" |
| 106 | #include "audio/AudioScope.h" | 108 | #include "audio/AudioScope.h" |
| 107 | #include "avatar/AvatarManager.h" | 109 | #include "avatar/AvatarManager.h" |
| @@ -3038,9 +3040,9 @@ void Application::updateLOD() const { · 2930 unmodified lines | |||
| 3038 | } | 3040 | } |
| 3039 | } | 3041 | } |
| 3040 | 3042 | ||
| 3041 | void Application::pushPreRenderLambda(void* key, std::function<void()> func) { | 3043 | void Application::pushPostUpdateLambda(void* key, std::function<void()> func) { |
| 3042 | std::unique_lock<std::mutex> guard(_preRenderLambdasLock); | 3044 | std::unique_lock<std::mutex> guard(_postUpdateLambdasLock); |
| 3043 | _preRenderLambdas[key] = func; | 3045 | _postUpdateLambdas[key] = func; |
| 3044 | } | 3046 | } |
| 3045 | 3047 | ||
| 3046 | // Called during Application::update immediately before AvatarManager::updateMyAvatar, updating my data that is then sent to everyone. | 3048 | // Called during Application::update immediately before AvatarManager::updateMyAvatar, updating my data that is then sent to everyone. |
| @@ -3562,15 +3564,19 @@ void Application::update(float deltaTime) { · 515 unmodified lines | |||
| 3562 | } | 3564 | } |
| 3563 | } | 3565 | } |
| 3564 | 3566 | ||
| 3567 | avatarManager->postUpdate(deltaTime); | ||
| 3568 | |||
| 3565 | { | 3569 | { |
| 3566 | PROFILE_RANGE_EX("PreRenderLambdas", 0xffff0000, (uint64_t)0); | 3570 | PROFILE_RANGE_EX("PreRenderLambdas", 0xffff0000, (uint64_t)0); |
| 3567 | 3571 | ||
| 3568 | std::unique_lock<std::mutex> guard(_preRenderLambdasLock); | 3572 | std::unique_lock<std::mutex> guard(_postUpdateLambdasLock); |
| 3569 | for (auto& iter : _preRenderLambdas) { | 3573 | for (auto& iter : _postUpdateLambdas) { |
| 3570 | iter.second(); | 3574 | iter.second(); |
| 3571 | } | 3575 | } |
| 3572 | _preRenderLambdas.clear(); | 3576 | _postUpdateLambdas.clear(); |
| 3573 | } | 3577 | } |
| 3578 | |||
| 3579 | AnimDebugDraw::getInstance().update(); | ||
| 3574 | } | 3580 | } |
| 3575 | 3581 | ||
| 3576 | 3582 | ||
| @@ -3992,13 +3998,10 @@ namespace render { · 415 unmodified lines | |||
| 3992 | 3998 | ||
| 3993 | void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool selfAvatarOnly) { | 3999 | void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool selfAvatarOnly) { |
| 3994 | 4000 | ||
| 3995 | // FIXME: This preRender call is temporary until we create a separate render::scene for the mirror rendering. | 4001 | // FIXME: This preDisplayRender call is temporary until we create a separate render::scene for the mirror rendering. |
| 3996 | // Then we can move this logic into the Avatar::simulate call. | 4002 | // Then we can move this logic into the Avatar::simulate call. |
| 3997 | auto myAvatar = getMyAvatar(); | 4003 | auto myAvatar = getMyAvatar(); |
| 3998 | myAvatar->preRender(renderArgs); | 4004 | myAvatar->preDisplaySide(renderArgs); |
| 3999 | |||
| 4000 | // Update animation debug draw renderer | ||
| 4001 | AnimDebugDraw::getInstance().update(); | ||
| 4002 | 4005 | ||
| 4003 | activeRenderingThread = QThread::currentThread(); | 4006 | activeRenderingThread = QThread::currentThread(); |
| 4004 | PROFILE_RANGE(__FUNCTION__); | 4007 | PROFILE_RANGE(__FUNCTION__); |