Added --test-NodeMask option to test crash when a parent of osgmanipulator::AntiSquish node has a NodeMask set to 0x0.

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14842 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2015-04-17 13:22:07 +00:00
parent 3a2380932f
commit a583b306c5

View File

@ -35,6 +35,7 @@
#include <osgManipulator/TranslateAxisDragger>
#include <osgManipulator/TranslatePlaneDragger>
#include <osgManipulator/RotateCylinderDragger>
#include <osgManipulator/AntiSquish>
#include <osg/ShapeDrawable>
#include <osg/MatrixTransform>
@ -169,8 +170,6 @@ osgManipulator::Dragger* createDragger(const std::string& name)
dragger = d;
}
return dragger;
}
@ -374,6 +373,7 @@ osg::Node* createDemoScene(bool fixedSizeInScreen) {
return root;
}
//
int main( int argc, char **argv )
{
@ -407,6 +407,28 @@ int main( int argc, char **argv )
// get details on keyboard and mouse bindings used by the viewer.
viewer.getUsage(*arguments.getApplicationUsage());
if (arguments.read("--test-NodeMask"))
{
const osg::ref_ptr<osg::Group> group = new osg::Group();
group->setNodeMask(0);
const osg::ref_ptr<osgManipulator::AntiSquish> antiSquish = new osgManipulator::AntiSquish();
group->addChild(antiSquish);
const osg::ref_ptr<osg::Node> node = new osg::Node();
node->setInitialBound(osg::BoundingSphere(osg::Vec3(0.0, 0.0, 0.0), 1.0));
antiSquish->addChild(node);
group->getBound();
return 1;
}
// if user request help write it out to cout.
bool helpAll = arguments.read("--help-all");
unsigned int helpType = ((helpAll || arguments.read("-h") || arguments.read("--help"))? osg::ApplicationUsage::COMMAND_LINE_OPTION : 0 ) |