History

Merge pull request #7846 from hyperlogic/tony/improved-avatar-debug-draw

Eye tracking bug fix and debug rendering improvements

Anthony Thibault committed 10 years ago

Commit 8fecb512 parents d656f61 80a349c20 files · +161 −218Browse files

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

Unified · Split

interface/src/Application.cpp+15−12
@@ -45,11 +45,13 @@ · 44 unmodified lines
4545 #include <ResourceScriptingInterface.h>
4646 #include <AccountManager.h>
4747 #include <AddressManager.h>
48+#include <AnimDebugDraw.h>
4849 #include <BuildInfo.h>
4950 #include <AssetClient.h>
5051 #include <AutoUpdater.h>
5152 #include <AudioInjectorManager.h>
5253 #include <CursorManager.h>
54+#include <DebugDraw.h>
5355 #include <DeferredLightingEffect.h>
5456 #include <display-plugins/DisplayPlugin.h>
5557 #include <EntityScriptingInterface.h>
@@ -101,7 +103,7 @@ · 45 unmodified lines
101103 #include <Preferences.h>
102104 #include <display-plugins/CompositorHelper.h>
103105
104−#include "AnimDebugDraw.h"
106+
105107 #include "AudioClient.h"
106108 #include "audio/AudioScope.h"
107109 #include "avatar/AvatarManager.h"
@@ -3038,9 +3040,9 @@ void Application::updateLOD() const { · 2930 unmodified lines
30383040 }
30393041 }
30403042
3041−void Application::pushPreRenderLambda(void* key, std::function<void()> func) {
3042− std::unique_lock<std::mutex> guard(_preRenderLambdasLock);
3043− _preRenderLambdas[key] = func;
3043+void Application::pushPostUpdateLambda(void* key, std::function<void()> func) {
3044+ std::unique_lock<std::mutex> guard(_postUpdateLambdasLock);
3045+ _postUpdateLambdas[key] = func;
30443046 }
30453047
30463048 // 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
35623564 }
35633565 }
35643566
3567+ avatarManager->postUpdate(deltaTime);
3568+
35653569 {
35663570 PROFILE_RANGE_EX("PreRenderLambdas", 0xffff0000, (uint64_t)0);
35673571
3568− std::unique_lock<std::mutex> guard(_preRenderLambdasLock);
3569− for (auto& iter : _preRenderLambdas) {
3572+ std::unique_lock<std::mutex> guard(_postUpdateLambdasLock);
3573+ for (auto& iter : _postUpdateLambdas) {
35703574 iter.second();
35713575 }
3572− _preRenderLambdas.clear();
3576+ _postUpdateLambdas.clear();
35733577 }
3578+
3579+ AnimDebugDraw::getInstance().update();
35743580 }
35753581
35763582
@@ -3992,13 +3998,10 @@ namespace render { · 415 unmodified lines
39923998
39933999 void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool selfAvatarOnly) {
39944000
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.
39964002 // Then we can move this logic into the Avatar::simulate call.
39974003 auto myAvatar = getMyAvatar();
3998− myAvatar->preRender(renderArgs);
3999−
4000− // Update animation debug draw renderer
4001− AnimDebugDraw::getInstance().update();
4004+ myAvatar->preDisplaySide(renderArgs);
40024005
40034006 activeRenderingThread = QThread::currentThread();
40044007 PROFILE_RANGE(__FUNCTION__);