[osg-users] Find out if a node is "dirty"

Gianni Ambrosio g.ambrosio+osg at gmail.com
Wed Aug 5 06:37:52 PDT 2015


Hi Robert,


robertosfield wrote:
> 
> What do you need it for?
> 

I'm now working to switch my applocation from a continuous frame to an ON_DEMAND frame to reduce CPU consumption. Unfotunately even with vsync enabled my application takes one cpu core even if nothing changes in the scene. So, for the time being I implemented a "dirty falg" in my scene manager so that the viewer can check it and call frame() as needed. Then, looking at that _boundingSphereComputed flag I was thinking if it may be useful instead of implementing my own dirty flag. I found some "setters" (i.e. in PositionAttitudeTransform) calls dirtyBounds()  which is propagated to parents.
For sure in my specific case (i.e. one viewer and one scene) a "dirty flag" like that would be enough but may be in a more general case (i.e. scene shared to more than one Viewer) there must be something stored in each viewer also. I thought of a time stamp for example: time of modification to be compared to the time stamp of the frame() computed from each viewer. But I don't know if that would make sense.

Regards,
Gianni

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64630#64630








More information about the osg-users mailing list