diff --git a/apps/opencs/view/render/object.cpp b/apps/opencs/view/render/object.cpp index 50c227d49..f8e91e463 100644 --- a/apps/opencs/view/render/object.cpp +++ b/apps/opencs/view/render/object.cpp @@ -71,8 +71,6 @@ void CSVRender::Object::update() // TODO: use error marker mesh std::cerr << e.what() << std::endl; } - - //mObject->setVisibilityFlags (Element_Reference); } } @@ -110,6 +108,9 @@ CSVRender::Object::Object (const CSMWorld::Data& data, osg::Group* parentNode, mBaseNode = new osg::PositionAttitudeTransform; parentNode->addChild(mBaseNode); + // 0x1 reserved for separating cull and update visitors + mBaseNode->setNodeMask(Element_Reference<<1); + if (referenceable) { mReferenceableId = id; diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index 98ddf67c3..16ad2e68a 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -84,6 +84,12 @@ void SceneWidget::flagAsModified() mView->requestRedraw(); } +void SceneWidget::setVisibilityMask(int mask) +{ + // 0x1 reserved for separating cull and update visitors + mView->getCamera()->setCullMask(mask<<1); +} + CompositeViewer::CompositeViewer() { #if QT_VERSION >= 0x050000 diff --git a/apps/opencs/view/render/scenewidget.hpp b/apps/opencs/view/render/scenewidget.hpp index adb10b10a..04025340d 100644 --- a/apps/opencs/view/render/scenewidget.hpp +++ b/apps/opencs/view/render/scenewidget.hpp @@ -37,6 +37,8 @@ namespace CSVRender void flagAsModified(); + void setVisibilityMask(int mask); + protected: osg::ref_ptr mView; diff --git a/apps/opencs/view/render/worldspacewidget.cpp b/apps/opencs/view/render/worldspacewidget.cpp index f5068bb47..1026aab58 100644 --- a/apps/opencs/view/render/worldspacewidget.cpp +++ b/apps/opencs/view/render/worldspacewidget.cpp @@ -348,7 +348,7 @@ void CSVRender::WorldspaceWidget::debugProfileAboutToBeRemoved (const QModelInde void CSVRender::WorldspaceWidget::elementSelectionChanged() { - //setVisibilityMask (getVisibilityMask()); + setVisibilityMask (getVisibilityMask()); flagAsModified(); updateOverlay(); }