On 12/8/2010 2:42 PM, Paul Martz wrote:
> Hi all -- Does anyone know of a state tracking NodeVisitor, either in core 
> OSG or in an
> external project? I'd expect it to merge StateSets onto the top of stack as 
> it visits
> nodes, allowing an application to access a snapshot of current state by 
> querying the
> top-of-stack.
> (osg::State doesn't quite do what I want. It keeps StateSets on a stack, but 
> doesn't merge
> them during traversal; top-of-stack is simply the last StateSet encountered, 
> rather than a
> snapshot of state at that point in the scene graph. It doesn't give me access 
> to a single
> StateSet that I can query.)

  Not aware of one, but it wouldn't seem to be too hard to create. just create 
a second
stack, for the merged state. Whenever you push onto the State stack, push a new 
copy of
the prior existing state onto the MergedState stack, and then merge the current 
State in.
Whenever you pop the State stack, pop the MergedState stack too.

> Thanks for any info.
>    -Paul

-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
    "There is no Truth. There is only Perception. To Perceive is to Exist." - 
Xen
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to