List of callbacks

There are several kinds of callbacks in the OSG scene graph and backend. Among them, the osg::NodeCallback class is an important implementer of update, event, and cull callbacks. It can be only attached to nodes. For drawables, we have osg::Drawable::UpdateCallback, osg::Drawable::EventCallback and osg::Drawable::CullCallback to achieve the same goal.

The osg::NodeCallback class has a virtual operator() method for users to override by customizing their own execution code. To make it work, we have to attach the callback object to a specific node in the scene graph with the setUpdateCallback() or addUpdateCallback() method. The operator() method will then be automatically called during the update traversal in every frame.

The following ...

Get OpenSceneGraph 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.