Base Drawables

To simplify implementation there are two base Drawables that can be used as parent classes for derivation: osg::Drawable and osg::MaterialDrawable.

Drawable

The simple Drawable is the root class of all renderable NodeCores. It contains the Statistics element descriptors that can be used to collect information about renderable geometry.

Ext: Use a Drawable pointer whenever you need to keep something that can be rendered, but don't need access to the Material.

Dev: Not sure the name is right, because I don't know if and how I would render something that doesn't have a material. Maybe if we get multi-material nodes later? It keeps the inheritance hierarchy cleaner anyway.

MaterialDrawable

The MaterialDrawable contains a pointer to a osg::Material that is used to render the node. It is abstract, but the base for most renderable classes.

Ext: It also contains a simple framework for extending the system in the sense of adding node cores that render OpenGL geometry. The drawPrimitives method needs to call the necessary OpenGL commands. Register the MaterialDrawables action methods in the initMethod and that's it, see OSGSlicer.cpp or the Cubes example for an example.


Generated on Mon Mar 17 12:02:52 2008 for OpenSG by  doxygen 1.5.5