diff --git a/examples/osgsimulation/osgsimulation.cpp b/examples/osgsimulation/osgsimulation.cpp index 901dbe522..68e0deeed 100644 --- a/examples/osgsimulation/osgsimulation.cpp +++ b/examples/osgsimulation/osgsimulation.cpp @@ -250,6 +250,9 @@ int main(int argc, char **argv) return 1; } } + + bool useOverlay = true; + while (arguments.read("--no-overlay") || arguments.read("-n")) useOverlay = false; osgSim::OverlayNode::OverlayTechnique technique = osgSim::OverlayNode::OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY; while (arguments.read("--object")) technique = osgSim::OverlayNode::OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY; @@ -257,6 +260,7 @@ int main(int argc, char **argv) while (arguments.read("--persp") || arguments.read("--perspective")) technique = osgSim::OverlayNode::VIEW_DEPENDENT_WITH_PERSPECTIVE_OVERLAY; + // if user request help write it out to cout. if (arguments.read("-h") || arguments.read("--help")) { @@ -288,11 +292,9 @@ int main(int argc, char **argv) if (csn) { - bool insertOverlayNode = true; osg::ref_ptr overlayNode; - if (insertOverlayNode) + if (useOverlay) { - overlayNode = new osgSim::OverlayNode(technique); // insert the OverlayNode between the coordinate system node and its children.