From b648722d3b26f12649bc33dcb88e48e539db4ffa Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 17 Jun 2015 15:13:41 +0200 Subject: [PATCH] Don't use the ParticleSystem for computing placeable bounds (Bug #2700) --- apps/openmw/mwrender/vismask.hpp | 5 ++++- apps/openmw/mwworld/worldimp.cpp | 2 ++ components/resource/scenemanager.cpp | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwrender/vismask.hpp b/apps/openmw/mwrender/vismask.hpp index b794ac24a9..38fcfe6487 100644 --- a/apps/openmw/mwrender/vismask.hpp +++ b/apps/openmw/mwrender/vismask.hpp @@ -22,8 +22,11 @@ namespace MWRender Mask_Scene = (1<<8), Mask_GUI = (1<<9), + // Set on a Geode + Mask_ParticleSystem = (1<<10), + // Set on cameras within the main scene graph - Mask_RenderToTexture = (1<<10) + Mask_RenderToTexture = (1<<11) // reserved: (1<<16) for SceneUtil::Mask_Lit }; diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 0d6a8ef47c..6b43ae74f3 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -37,6 +37,7 @@ #include "../mwrender/animation.hpp" #include "../mwrender/renderingmanager.hpp" #include "../mwrender/camera.hpp" +#include "../mwrender/vismask.hpp" #include "../mwscript/interpretercontext.hpp" #include "../mwscript/globalscripts.hpp" @@ -1862,6 +1863,7 @@ namespace MWWorld { // Adjust position so the location we wanted ends up in the middle of the object bounding box osg::ComputeBoundsVisitor computeBounds; + computeBounds.setTraversalMask(~MWRender::Mask_ParticleSystem); dropped.getRefData().getBaseNode()->accept(computeBounds); osg::BoundingBox bounds = computeBounds.getBoundingBox(); if (bounds.valid()) diff --git a/components/resource/scenemanager.cpp b/components/resource/scenemanager.cpp index de4e2bd1c5..6f38c41c4a 100644 --- a/components/resource/scenemanager.cpp +++ b/components/resource/scenemanager.cpp @@ -47,6 +47,7 @@ namespace if (geode->getNumParents() && geode->getParent(0)->getNumParents()) transformInitialParticles(partsys, geode->getParent(0)->getParent(0)); } + geode->setNodeMask((1<<10)); //MWRender::Mask_ParticleSystem } } }