Module Osg.Drawable


module Drawable: sig .. end
Pure virtual base class for drawable geometry. In OSG, everything that can be rendered is implemented as a class derived from Drawable. The Drawable class contains no drawing primitives, since these are provided by subclasses such as Osg.Geometry.

Notice that a Drawable is not a Osg.Node, and therefore it cannot be directly added to a scene graph. Instead, Drawables are attached to Osg.Geodes, which are scene graph nodes.

The OpenGL state that must be used when rendering a Drawable is represented by a Osg.State_set. Since a Drawable has a reference (osg::ref_ptr) to a State_set, State_sets can be shared between different Drawables. In fact, sharing State_sets is a good way to improve performance, since this allows OSG to reduce the number of expensive changes in the OpenGL state.

Finally, Drawables can also be shared between different Geodes, so that the same geometry (loaded to memory just once) can be used in different parts of the scene graph.


type t 
osg::Drawable holder.
val to_object : t -> Osg.Object.t
val get_parents : t -> Osg.Node.t array
val get_bound : t -> Osg.Bounding_box.t
val get_or_create_state_set : t -> Osg.State_set.t
val set_state_set : t -> Osg.State_set.t -> unit