forked from teamnwah/openmw-tes3coop
OpenCS: apply visibility flags to osg node
This commit is contained in:
parent
5fb8877746
commit
1edccdbe55
4 changed files with 12 additions and 3 deletions
|
@ -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…
Reference in a new issue