|Version 1 (modified by martin, 6 years ago)|
A NodeVisitor is a kind of function which automatically traverses a scenegraph, calling a function for each node in the tree. Usually this function will perform some operation on at least one node, such as:
- change the texture applied;
- make the node visible/invisible;
- update a matrix etc.
Classic visitors are:
- the Cull Visitor which collects all the visible nodes (all nodes where some part of the subgraph might be visible) from the tree ready for the draw phase. It also sorts the nodes by state for efficient drawing.
- the update visitor which can be used to modify the scenegraph on every frame (eg update orientation of components of an entity).