From 45585b78fb49c925bd523c4065ff8d5eb3c166c0 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 28 Jan 2013 14:30:21 +0000 Subject: [PATCH] From Laurens Voerman, "I have implemented and tested (on windows only) your suggestion for resetCullingMask(), it's far less intrusive than my previous submission. attached are the changes to current svn (28 Jan 2013 / rev :13312). " --- include/osg/CullStack | 10 +++++++++- include/osg/CullingSet | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/osg/CullStack b/include/osg/CullStack index fbb9bf375..c59ec9787 100644 --- a/include/osg/CullStack +++ b/include/osg/CullStack @@ -109,7 +109,15 @@ class OSG_EXPORT CullStack : public osg::CullSettings inline bool isCulled(const osg::Node& node) { - return node.isCullingActive() && getCurrentCullingSet().isCulled(node.getBound()); + if (node.isCullingActive()) + { + return getCurrentCullingSet().isCulled(node.getBound()); + } + else + { + getCurrentCullingSet().resetCullingMask(); + return false; + } } inline void pushCurrentMask() diff --git a/include/osg/CullingSet b/include/osg/CullingSet index 7847f0801..a22b99c35 100644 --- a/include/osg/CullingSet +++ b/include/osg/CullingSet @@ -326,6 +326,11 @@ class OSG_EXPORT CullingSet : public Referenced #endif } + inline void resetCullingMask() + { + _frustum.setResultMask(_frustum.getCurrentMask()); + } + void disableAndPushOccludersCurrentMask(NodePath& nodePath); void popOccludersCurrentMask(NodePath& nodePath);