Quad tree node class used for terrain patches and optimization purposes. More...
#include <spTreeNodeQuad.hpp>
Public Member Functions | |
QuadTreeNode (TreeNode *Parent=0) | |
~QuadTreeNode () | |
bool | isLeaf () const |
Returns true if this is a leaf node. In this case it has no children. | |
void | addChildren () |
Creates the children if it currently has none. | |
void | removeChildren () |
Deletes the children if it currently has some. | |
void | findTreeNodes (std::list< const QuadTreeNode * > &TreeNodeList, const dim::point2df &Pos) const |
void | findTreeNodes (std::list< const QuadTreeNode * > &TreeNodeList, const dim::point2df &Pos, const dim::size2df &Radius) const |
QuadTreeNode * | getChild (u32 Index) const |
Quad tree node class used for terrain patches and optimization purposes.
sp::scene::QuadTreeNode::QuadTreeNode | ( | TreeNode * | Parent = 0 |
) |
sp::scene::QuadTreeNode::~QuadTreeNode | ( | ) |
void sp::scene::QuadTreeNode::addChildren | ( | ) | [virtual] |
Creates the children if it currently has none.
Reimplemented from sp::scene::TreeNode.
void sp::scene::QuadTreeNode::findTreeNodes | ( | std::list< const QuadTreeNode * > & | TreeNodeList, | |
const dim::point2df & | Pos | |||
) | const |
Searchs each quad node where the specified position is inside. Only those quad nodes are searched which have no children.
TreeNodeList,: | Resulting list with all found QuadTreeNode objects. This must be a reference and no function's return value because it will be called recursive for each next tree node child. |
void sp::scene::QuadTreeNode::findTreeNodes | ( | std::list< const QuadTreeNode * > & | TreeNodeList, | |
const dim::point2df & | Pos, | |||
const dim::size2df & | Radius | |||
) | const |
Does the same like the first "findTreeNodes" function but considers the radius which occurs that sometimes more than one tree node can be found.
QuadTreeNode* sp::scene::QuadTreeNode::getChild | ( | u32 | Index | ) | const [inline] |
bool sp::scene::QuadTreeNode::isLeaf | ( | ) | const [virtual] |
Returns true if this is a leaf node. In this case it has no children.
Implements sp::scene::TreeNode.
void sp::scene::QuadTreeNode::removeChildren | ( | ) | [virtual] |
Deletes the children if it currently has some.
Reimplemented from sp::scene::TreeNode.