Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
The ActorTree class implements a generic tree whose nodes contain Actor[s]. More...
#include <ActorTree.hpp>
Public Member Functions | |
| virtual const char * | className () |
| Returns the name of the class. | |
| ActorTree () | |
| virtual int | childrenCount () const |
| Returns the number of child nodes of an ActorTreeAbstract node. | |
| virtual ActorTreeAbstract * | child (int i) |
| Returns the i-th child node of an ActorTreeAbstract node. | |
| virtual const ActorTreeAbstract * | child (int i) const |
| Returns the i-th child node of an ActorTreeAbstract node. | |
| void | addChild (ActorTreeAbstract *node) |
| void | setChild (int i, ActorTreeAbstract *node) |
| void | eraseChild (int i, int count=1) |
| void | eraseAllChildren () |
Public Attributes | |
| std::vector< ref < ActorTreeAbstract > > | mChildren |
The ActorTree class implements a generic tree whose nodes contain Actor[s].
Each node of the tree can have any number of children.
Use this class when you want to have direct control over how the Actor[s] are grouped together or to implement specific space partitioning schemes like BSP trees, Quadtrees, Octrees etc. For example you can use the ActorTree class to build a quadtree by assigning 4 children per node and filling them appropriately. Of course you can also use an ActorTree to group a set of Actor[s] based on any other principle. For example animated Actor[s] are usually kept in separate "flat" trees (for example all in a single node) as the computational cost of rebuilding every frame the BSP tree, Quadtree, Octree etc. might be to high.
Note that for performance reasons the ActorKdTree class derives from the ActorTreeAbstract and implements a space partitioning scheme (based on a binary tree) where the splitting planes are in turn choosen so that they are aligned to the world space x, y and z axes.
| vl::ActorTree::ActorTree | ( | ) | [inline] |
| virtual const char* vl::ActorTree::className | ( | ) | [inline, virtual] |
Returns the name of the class.
Reimplemented from vl::ActorTreeAbstract.
| virtual int vl::ActorTree::childrenCount | ( | ) | const [inline, virtual] |
Returns the number of child nodes of an ActorTreeAbstract node.
Implements vl::ActorTreeAbstract.
| virtual ActorTreeAbstract* vl::ActorTree::child | ( | int | i ) | [inline, virtual] |
Returns the i-th child node of an ActorTreeAbstract node.
Implements vl::ActorTreeAbstract.
| virtual const ActorTreeAbstract* vl::ActorTree::child | ( | int | i ) | const [inline, virtual] |
Returns the i-th child node of an ActorTreeAbstract node.
Implements vl::ActorTreeAbstract.
| void ActorTree::addChild | ( | ActorTreeAbstract * | node ) |
| void ActorTree::setChild | ( | int | i, |
| ActorTreeAbstract * | node | ||
| ) |
| void ActorTree::eraseChild | ( | int | i, |
| int | count = 1 |
||
| ) |
| void ActorTree::eraseAllChildren | ( | ) |
| std::vector< ref<ActorTreeAbstract> > vl::ActorTree::mChildren |