[osg-submissions] Add slave camera
Robert Osfield
robert.osfield at gmail.com
Sat Oct 6 07:31:16 PDT 2007
HI Filip,
I've done a review of your changes and feel that perhaps a better
solution would be to add a virtual getSceneData method into osg::View
and then use this in the addSlave methods and not subclass them.
Robert.
On 10/5/07, Robert Osfield <robert.osfield at gmail.com> wrote:
> HI Filip,
>
> I haven't reviewed your changes yet but overriding a method makes be
> think that this change will break binary compatibility so is probably
> a good candidate for 2.3.x rather than the 2.2.x branch.
>
> For 2.2.x one should be able to call
>
> viewer.assignSceneDataToCameras();
>
> If you are assigning cameras after the setSceneData().
>
> Robert.
>
> On 10/5/07, filip.holm at kongsberg.com <filip.holm at kongsberg.com> wrote:
> > Robert,
> >
> > This fixes problem with scene data not being attached to slave camera if viewer already has scene data assigned to it. Which was the actual reason I could not see scene data in the CompositeViewer example I posted on the osg-users a couple of days ago.
> >
> > Consider the following example.
> > .....
> > osgViewer viewer;
> > viewer.setSceneData(pSomeSceneData);
> > viewer.addSlaveCamera(pSomeSlaveCamera,true); //Expecting pSomeSlaveCamera to be assigned the masters scene data
> > viewer.run();
> > .....
> >
> > Note:
> > If you're wondering why I have overridden the convenience method addSlaveCamera(Camera*,bool);
> > It's because of C++ is using hide by name rather than hide by signature. I had not realized this limitation before, so it took me some time to figure out the best approach.
> >
> > Thanks for this great open source project.
> >
> > Filip
> >
> > _______________________________________________
> > osg-submissions mailing list
> > osg-submissions at lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
> >
> >
> >
>
More information about the osg-submissions
mailing list