Hi Paul,

dirtyBound() is something that can be called multiple times, but will
only set a flag so is quite cheap.  The computeBounds() will just be
called on demand and therefore should only be called once per frame.
computeBounds() is the place where I would stick my changes, its
virtual for a good reason.

Robert.

On 7/3/07, Paul Martz <[EMAIL PROTECTED]> wrote:


Hi Robert -- Would you object strongly to making dirtyBound() a virtual
function?

In my custom node, I need to catch when the bounding box changes and make
some modifications to the scene graph as a result.

Currently, I'm overriding computeBounds() to do this. But because
computeBounds() is const, I have to cast away const in order to perform
non-const operations like modifying scene graph data. It turns out this
doesn't work anyway, because thread collisions occur in multithread
situations.

Dirtying the bounding box seems to be an inherently non-const operation. Yet
there doesn't appear to be a way for code to act on that change in a
non-const way. Changing the declaration of dirtyBound() to virtual would
allow custom Nodes to take non-const action on the bounding box change.

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
303 859 9466

_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to