Public Member Functions

sp::scene::OcTreeNode Class Reference

Oct tree (or rather OcTree) node class used for collision detection and intersection optimization. More...

#include <spTreeNodeOct.hpp>

Inheritance diagram for sp::scene::OcTreeNode:
sp::scene::TreeNode sp::BaseObject

List of all members.

Public Member Functions

 OcTreeNode (TreeNode *Parent=0)
 ~OcTreeNode ()
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 createTree (Mesh *Model, s8 ForksCount=DEF_TREENODE_FORKSCOUNT)
void createTree (const std::list< SceneNode * > &NodeList, s8 ForksCount=DEF_TREENODE_FORKSCOUNT)
void findTreeNodes (std::list< const OcTreeNode * > &TreeNodeList, const dim::vector3df &Pos) const
void findTreeNodes (std::list< const OcTreeNode * > &TreeNodeList, const dim::vector3df &Pos, const dim::vector3df &Radius) const
void findTreeNodes (std::list< const OcTreeNode * > &TreeNodeList, const dim::line3df &Ray) const
OcTreeNodegetChild (u32 Index) const
 Returns pointer the the specified OcTreeNode child object (index must be in a range of [0, 7]).

Detailed Description

Oct tree (or rather OcTree) node class used for collision detection and intersection optimization.


Constructor & Destructor Documentation

sp::scene::OcTreeNode::OcTreeNode ( TreeNode Parent = 0  ) 
sp::scene::OcTreeNode::~OcTreeNode (  ) 

Member Function Documentation

void sp::scene::OcTreeNode::addChildren (  )  [virtual]

Creates the children if it currently has none.

Reimplemented from sp::scene::TreeNode.

void sp::scene::OcTreeNode::createTree ( Mesh Model,
s8  ForksCount = DEF_TREENODE_FORKSCOUNT 
)

Creates a complete tree for a Mesh object with the specified count of forks. By this creation the tree nodes' user data will be "std::list<STreeNodeTriangleData>*".

Parameters:
Model,: Pointer to the Mesh object for which the tree is to be created.
ForksCount,: Count of forks the tree shall has. If the count is 0 only one OcTreeNode object will be created. This would be pointless for optimization purposes. By default the count amounts 3. It can not be greater than 8 because this will occurs a tree with 8^8 (16.777.216) tree nodes!
Deprecated:
Since 3.2
void sp::scene::OcTreeNode::createTree ( const std::list< SceneNode * > &  NodeList,
s8  ForksCount = DEF_TREENODE_FORKSCOUNT 
)

Creates a complete tree for the Node objects with the specified count of forks. By this creation the tree nodes' user data will be "std::list<SceneNode*>*". This function does not effect the Node objects but it will result a tree hierarchy where the Node objects are sorted by their position.

Parameters:
NodeList,: List of all Node objects which shall be placed into a tree hierarchy.
ForksCount,: Count of forks the tree shall has.
Deprecated:
Since 3.2
void sp::scene::OcTreeNode::findTreeNodes ( std::list< const OcTreeNode * > &  TreeNodeList,
const dim::vector3df Pos,
const dim::vector3df 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.

Deprecated:
Since 3.2
void sp::scene::OcTreeNode::findTreeNodes ( std::list< const OcTreeNode * > &  TreeNodeList,
const dim::line3df Ray 
) const

Searchs each oct node where the specified line intersects with. Only those oct nodes are searched which have no children. This function is used for mesh picking.

Parameters:
TreeNodeList,: Resulting list with all found OcTreeNode objects.
Ray,: Intersection ray (or rather line).
Deprecated:
Since 3.2
void sp::scene::OcTreeNode::findTreeNodes ( std::list< const OcTreeNode * > &  TreeNodeList,
const dim::vector3df Pos 
) const

Searchs each oct node where the specified position is inside. Only those oct nodes are searched which have no children.

Parameters:
TreeNodeList,: Resulting list with all found OcTreeNode objects. This must be a reference and no function's return value because it will be called recursive for each next tree node child.
Deprecated:
Since 3.2
OcTreeNode* sp::scene::OcTreeNode::getChild ( u32  Index  )  const [inline]

Returns pointer the the specified OcTreeNode child object (index must be in a range of [0, 7]).

bool sp::scene::OcTreeNode::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::OcTreeNode::removeChildren (  )  [virtual]

Deletes the children if it currently has some.

Reimplemented from sp::scene::TreeNode.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines