A SERVICE OF

logo

84
Chapter 7: Traversing the Scene Graph
The action-specic responses taken by a node are implemented in the following node
functions:
draw()for csDrawAction
isect()for csIsectAction
compile()for csCompileAction
sound()for csSoundAction
When an action operates on one node after another, the action is said to be traversing the
scene graph.
Action Types
In Cosmo 3D, there are four kinds of actions:
csDrawActionRenders a scene graph.
csIsectActionSelects objects intersecting a ray.
csCompileActionCompiles a subgraph.
csSoundActionPlays spatialized (3D) sounds in a scene graph.
All of the actions are derived from csAction.
For more information about
csIsectAction, see Using csIsectAction on page 140.
csCompileAction, see Compiling Part of a Scene Graph on page 164.
csAction
csAction is a virtual class from which all actions are derived. An action is an operation
that is performed on some or all of the nodes in a scene graph, for example, a
csDrawAction, when applied to the root node, renders a scene graph.
csAction contains the following method:
virtual void apply(csNode *node) = 0;