OpenCS: apply visibility flags to osg node

c++11
scrawl 10 years ago
parent 5fb8877746
commit 1edccdbe55

@ -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;

@ -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

@ -37,6 +37,8 @@ namespace CSVRender
void flagAsModified();
void setVisibilityMask(int mask);
protected:
osg::ref_ptr<osgViewer::View> mView;

@ -348,7 +348,7 @@ void CSVRender::WorldspaceWidget::debugProfileAboutToBeRemoved (const QModelInde
void CSVRender::WorldspaceWidget::elementSelectionChanged()
{
//setVisibilityMask (getVisibilityMask());
setVisibilityMask (getVisibilityMask());
flagAsModified();
updateOverlay();
}

Loading…
Cancel
Save