Don't use multiple parental node paths.

move
scrawl 9 years ago
parent 22e717161a
commit 1c24cba46a

@ -167,7 +167,6 @@ CSVRender::Object::Object (CSMWorld::Data& data, osg::Group* parentNode,
mBaseNode->addCullCallback(new SceneUtil::LightListCallback); mBaseNode->addCullCallback(new SceneUtil::LightListCallback);
mOutline = new osgFX::Scribe; mOutline = new osgFX::Scribe;
mOutline->addChild(mBaseNode);
mBaseNode->setUserData(new ObjectTag(this)); mBaseNode->setUserData(new ObjectTag(this));
@ -202,10 +201,14 @@ void CSVRender::Object::setSelected(bool selected)
{ {
mSelected = selected; mSelected = selected;
mOutline->removeChild(mBaseNode);
mRootNode->removeChild(mOutline); mRootNode->removeChild(mOutline);
mRootNode->removeChild(mBaseNode); mRootNode->removeChild(mBaseNode);
if (selected) if (selected)
{
mOutline->addChild(mBaseNode);
mRootNode->addChild(mOutline); mRootNode->addChild(mOutline);
}
else else
mRootNode->addChild(mBaseNode); mRootNode->addChild(mBaseNode);
} }

Loading…
Cancel
Save