Hi,

I've tried the following and it seems to solve my problem :


Code:
void IntersectionVisitor::apply(osg::Group& group)
{
    if (!enter(group)) return;

    osg::Viewport* pViewport = NULL;
    if (group.getStateSet() != NULL)
    {
        pViewport = 
dynamic_cast<osg::Viewport*>(group.getStateSet()->getAttribute(osg::StateAttribute::VIEWPORT));
    }

    if (pViewport != NULL)
    {
        pushWindowMatrix(pViewport);
        push_clone();
            traverse(group);
        pop_clone();
        popWindowMatrix();
    }
    else
    {
        traverse(group);
    }

    leave();
}




This modification was just a test, but I wonder if this should not be in every 
"apply" method of IntersectionVisitor, maybe with these modifications :
- take care of the override value (do not push window matrix if the attribute 
is overriden)
- push the window matrix and the intersector clone BEFORE the "enter" test to 
ensure the "enter" test is done with correct coordinates frame

Or am I wrong with that and I've missed something ?

Thanks.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=55809#55809





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to