Hi, On Sun, 2008-05-04 at 18:14 +0200, Christoph Schäfer wrote: > Hi all, > > I've started to fix the tutorials that come with the OSG2 trunk. Most > changes are due introduction of the RefPtrs and can be done relatively > easy. There are two questions though. > > 19LocalLights.cpp: > There is a render action setting LocalLights. From what I understand > reading the tutorial on Trac this is obolete because the part of the > scene that should be lit is defindes by it's children. So the following > part of code should be removed - am I right? > -----------------><8--------------------- > // enable local lights. > RenderAction *ract = (RenderAction *) _mgr->getRenderAction(); > ract->setLocalLights(true); > -----------------><8---------------------
yes. With chunk overrides available in 2.x all lights are local and only illuminate their children so this line is no longer needed. > 28SortLastClusterClient.cpp > This one is kind of interesting. Probably this problem exists because > some part of the OSG2 not yet has been ported to the RefPtr thing > completely? not quite. This one is a little bit more complicated. RefPtrs are mainly for external use. Internally we handle the ref counting through the fields, but without storing RefPtrs explicitly. So most of the interfaces still work with standard C pointers and will stay this way. In some places we added TransitPtrs for convenience (e.g. setCore, addChild) but generally they stayed the same. Because passing the transit ptr has some side effects (the passed ptr becomes NULL) one has to be a little careful here. > Looking at the following snippet: > -----------------><8--------------------- > case 'L': > //mwin->setComposer(PipelineComposer::create()); > PipelineComposerTransitPtr pPC = > PipelineComposer::create(); > mwin->setComposer(pPC.getRaw()); > break; > case 'B': > -----------------><8--------------------- > "mwin->setComposer(PipelineComposer::create());" gives a compiler error > because "PipelineComposer::create()" returns the type > PipelineComposerTransitPtr, but "setComposer()" wants to get > PipelineComposerPtr (now this is where it came to my mind that this > function is not yet updated?). You bumped into one of the main problems (and where I got most complains for) with the current transit ptr implementation. foo.setBar(Bar::create()); does not work anymore. The common way around it is either foo.setBar(BarUnrecPtr(Bar::create())); or BarUnrecPtr pBar = Bar::create(); foo.setBar(pBar); > Anyway, what I tried can be seen in the > next two lines. "pPC.getRaw()" should return the needed type > PipelineComposerPtr but doesn't seem to be availible if OSG2 has been > build using enable_unittests=false. Unfortunatly, enable_unittests=true > won't compile for me. What to do here? the raw access is a debug interface and is currently not meant for public use. So please just ignore them for now. kind regards, gerrit ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
