Hi Paul,

Why do I have multiple SceneViews?

There are always two SceneViews if you're using multithreading - they're used on alternating frames as you've seen. Just set your CullVisitor for both, or a separate instance of your CullVisitor for each instance.

Whenever I've had to change something on SceneView instances, I had to do it on both instances. I expect if your CullVisitor has some local state, you'd have to use two separate instances, one for each SceneView, so that threading works correctly and doesn't try to modify data that's being read in another thread.

I need my own CullVisitor because I've defined my own node type that needs 
special cull handling.

You could just override the traverse() method of your node type, that's how I normally do it. It keeps changes local to the overridden node class instead of propagating changes to other parts of the app.

  void traverse(osg::NodeVisitor& nv)
  {
      if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR)
      {
          osgUtil::CullVisitor* cv =
               dynamic_cast<osgUtil::CullVisitor*>(&nv);

          // ...
      }
      osg::Node::traverse(nv);  // call base class version.
      // (replace Node by whatever the base class of your overridden
      //  node type is)
  }

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to