thank you for getting back robet, i agree that i didnt present all the code,
however its mostly standard from the examples.
one thing i ought to mention is that i am using osg with wxWidgets. I tried to
go back and look at the code and i found that even if i just add a new camera
it screws with the state set. In the handler function code below i print the
pointer before and after add slave. first time i get an address, second time
its null
Code:
osgViewer::Viewer *viewer = cloudglobals::rootFrame->osg_viewer;
switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::PUSH):
{
osg::StateSet *stateSet = viewer->getCamera()->getOrCreateStateSet();
osg::Point *pointState =
(osg::Point*)stateSet->getAttribute(osg::StateAttribute::POINT);
cout{{"# "{{pointState{{" "; // this is NOT NULL (how to add angular brkts for
cout?)
viewer->addSlave(new osg::Camera, false); // add slave camera to viewer
stateSet = viewer->getCamera()->getOrCreateStateSet();
pointState = (osg::Point*)stateSet->getAttribute(osg::StateAttribute::POINT);
cout{{pointState{{endl;
}
}
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=38610#38610
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org