module Drawable: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 assig
..end
Osg.Geometry
.
Notice that a Drawable is not a Osg.Node
, and therefore it cannot be
directly added to a scene graph. Instead, Drawable
s are attached to
Osg.Geode
s, 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_set
s can be shared between
different Drawable
s. In fact, sharing State_set
s is a good
way to improve performance, since this allows OSG to reduce the number of
expensive changes in the OpenGL state.
Finally, Drawable
s can also be shared between different
Geode
s, so that the same geometry (loaded to memory just once) can
be used in different parts of the scene graph.
type
t
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