|
///回调
class UpdateCallBack : public osg::NodeCallback
{
public:
UpdateCallBack(osg::Group *root)
{
}
virtual void operator()(osg::Node *node,osg::NodeVisitor *nv)
{
osg::Group *root = dynamic_cast<osg::Group *>(node);
//root->setDataVariance(osg::Object:YNAMIC);
if(root)
{
root->removeChild(root);
}
traverse(node,nv);
}
};
///mRootInit
mRoot = new osg::Group;
mRoot.get()->setUpdateCallback(new UpdateCallBack(mRoot.get()));
mRoot->setDataVariance(osg::Object::DYNAMIC);
////Btn下调用
go->mRoot->removeChild(go->mRoot.get()->getChild(2)); |
|