On Tue, Mar 18, 2008 at 4:55 PM, Mathias Fröhlich <[EMAIL PROTECTED]> wrote: > Move the inheritance mask from CullSettings to the camera. As you can see > from > your own suggestions abive the other users of the inheritance mask and > CullSettings will just need a copy from its 'parent' settings.
SceneView inherits from CullSettings as well osg::Camera, and the InheritinceMask is used as well. It's also require for backwards compatibility. CullSetting inheritance also is related to CullSettings variables, so the appropriate place is CullSettings. The only thing you gain by putting setInheritanceMask into osg::Camera is more visibility, but... you break encapsulation with it. Personally I find such a solution a poor OO choice. > Initialize this mask in the camera to inherit all. This is what the previous > implementation that ignored the mask completely did. You would preserve > backwards compatibility with existing code with this. It does inherit all settings right now, and this is what has broken things, so the fix to CullVisitor::apply(Camera&) is what has broken backwards compatibility. The status quo doesn't maintain backwards compatibility. > The reader of the code would better understand what happens and you could > implement what you told me for the first cut how it *should* work instead of > something you need to dig for in the sources. I'm afraid I don't follow you. The current implementation does as things as it should, save for fact that honouring the InheriinaceMask is what has broken backwards compatibility. > Well, I did not see that this past change brakes in the shadow thing, when I > offered you codework for that old suggestion, but I saw that it will probably > cause problems that would be better solved right. Also I expect every usage > of a Camera being used in the wrong way since the inheritance mask has never > worked in any way before our past change. The inheritanace mask did actually work correctly for the Viewer Camera's and SceneView, its only the in scene graph Camera's that were broken before and hence why the inheritance mask didn't work correctly in this case. > I also think that a Camera that now makes use of the mask that was previously > ignored will break much more of the compatibility than moving the mask to > where it is used. The mask hasn't moved one bit for a long time. It's only CullVistor::apply(Camera&) that has changed, and the inheritance of in scene graph cameras with it. Moving setInhertianceMask from CullSettings to osg::Camera doesn't solve any technical problems, and its certainly not clearer in terms of encapsulation. > Also it is better to get a 'heads up there has something changed' from the > compiler than just some subtle errors ... > > Still offering time to implement that ... I'm not sure what you could do on the front of breaking the build for old usage. While it'd be nice to let the compiler tell the user something is up, I think its impractical - one would be making changes not because they are needed but because they can give you a warning. If anything then a runtime warning might be possible. Robert. Robert. _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org