From 7b52091a82ab8d23d3673c305344c2351f8bdae9 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Mon, 26 Feb 2018 20:36:43 +0000 Subject: [PATCH] Make the debug hud enableable --- components/sceneutil/mwshadowtechnique.cpp | 10 ++++++++++ components/sceneutil/mwshadowtechnique.hpp | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/components/sceneutil/mwshadowtechnique.cpp b/components/sceneutil/mwshadowtechnique.cpp index e99d9d692..dc64204a3 100644 --- a/components/sceneutil/mwshadowtechnique.cpp +++ b/components/sceneutil/mwshadowtechnique.cpp @@ -755,6 +755,16 @@ void MWShadowTechnique::enableShadows() _enableShadows = false; } +void SceneUtil::MWShadowTechnique::enableDebugHUD() +{ + _debugHud = new DebugHUD(getShadowedScene()->getShadowSettings()->getNumShadowMapsPerLight()); +} + +void SceneUtil::MWShadowTechnique::disableDebugHUD() +{ + _debugHud = nullptr; +} + MWShadowTechnique::ViewDependentData* MWShadowTechnique::createViewDependentData(osgUtil::CullVisitor* /*cv*/) { return new ViewDependentData(this); diff --git a/components/sceneutil/mwshadowtechnique.hpp b/components/sceneutil/mwshadowtechnique.hpp index 7494b02be..cd5a71f92 100644 --- a/components/sceneutil/mwshadowtechnique.hpp +++ b/components/sceneutil/mwshadowtechnique.hpp @@ -65,6 +65,10 @@ namespace SceneUtil { virtual void disableShadows(); + virtual void enableDebugHUD(); + + virtual void disableDebugHUD(); + class ComputeLightSpaceBounds : public osg::NodeVisitor, public osg::CullStack { public: