Public Member Functions

sp::scene::OBBTreeNode Class Reference

Oriented bounding box tree node class used for bounding volume hierarchies. More...

#include <spTreeNodeOBB.hpp>

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

List of all members.

Public Member Functions

 OBBTreeNode (OBBTreeNode *Parent=0, const dim::obbox3df &Box=dim::obbox3df())
 ~OBBTreeNode ()
bool isLeaf () const
 Returns true if this is a leaf node. In this case it has no children.
const TreeNodefindLeaf (const dim::vector3df &Point) const
void findLeafList (std::list< const TreeNode * > &TreeNodeList, const dim::vector3df &Point, f32 Radius) const
void findLeafList (std::list< const TreeNode * > &TreeNodeList, const dim::line3df &Line) const
void findLeafList (std::list< const TreeNode * > &TreeNodeList, const dim::line3df &Line, f32 Radius) const
OBBTreeNodeinsertBoundingBox (const dim::obbox3df &Box)
bool insertBoundingBox (OBBTreeNode *Node)
 Inserts the given OBB tree node into this node.
void setBox (const dim::obbox3df &Box)
 Returns the oriented-bounding box.
void update (bool UpdateChildren=true)
 Updates the hierarchy of this node.
const std::list< TreeNode * > & getChildren () const
 Returns the children list.
dim::obbox3df getBox () const
 Returns the bounding box of the OBB tree node.

Detailed Description

Oriented bounding box tree node class used for bounding volume hierarchies.


Constructor & Destructor Documentation

sp::scene::OBBTreeNode::OBBTreeNode ( OBBTreeNode Parent = 0,
const dim::obbox3df Box = dim::obbox3df() 
)
sp::scene::OBBTreeNode::~OBBTreeNode (  ) 

Member Function Documentation

const TreeNode * sp::scene::OBBTreeNode::findLeaf ( const dim::vector3df Point  )  const [virtual]

Searches for a leaf TreeNode object that contains the specified point.

Parameters:
Point,: Specifies the point where the node is you are searching for.
Returns:
Pointer to the TreeNode object which has been found. If no tree node has been found the return value is null.

Reimplemented from sp::scene::TreeNode.

void sp::scene::OBBTreeNode::findLeafList ( std::list< const TreeNode * > &  TreeNodeList,
const dim::line3df Line 
) const [virtual]

Searches all leaf TreeNode objects which the specified line intersects.

Parameters:
TreeNodeList,: Specifies the list where the result will be stored.
Line,: Specifies the line which is to be used for intersection tests. When you want to transform the whole tree transform the line inverse instead.

Reimplemented from sp::scene::TreeNode.

void sp::scene::OBBTreeNode::findLeafList ( std::list< const TreeNode * > &  TreeNodeList,
const dim::line3df Line,
f32  Radius 
) const [virtual]

Searches all leaf TreeNode objects which the specified volumetric line intersects.

Parameters:
TreeNodeList,: Specifies the list where the result will be stored.
Line,: Specifies the line which is to be used for intersection tests.
Radius,: Specifise the line's radius (or rather size).

Reimplemented from sp::scene::TreeNode.

void sp::scene::OBBTreeNode::findLeafList ( std::list< const TreeNode * > &  TreeNodeList,
const dim::vector3df Point,
f32  Radius 
) const [virtual]

Searches all leaf TreeNode objects that contains the specified ellipsoid.

Parameters:
TreeNodeList,: Specifies the list where the result will be stored.
Point,: Specifies the ellipsoid's point.
Radius,: Specifies the ellipsoid's volumetric radius.

Reimplemented from sp::scene::TreeNode.

dim::obbox3df sp::scene::OBBTreeNode::getBox (  )  const [inline]

Returns the bounding box of the OBB tree node.

const std::list<TreeNode*>& sp::scene::OBBTreeNode::getChildren (  )  const [inline]

Returns the children list.

bool sp::scene::OBBTreeNode::insertBoundingBox ( OBBTreeNode Node  ) 

Inserts the given OBB tree node into this node.

OBBTreeNode * sp::scene::OBBTreeNode::insertBoundingBox ( const dim::obbox3df Box  ) 

Inserts the specified bounding box into the tree. If this box is fully inside the given box, the new tree node will become the new parent node.

Returns:
Pointer to the new OBBTreeNode object if the new box could be inserted.
Note:
The best way to insert new boxes is to do that at the root node.
bool sp::scene::OBBTreeNode::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::OBBTreeNode::setBox ( const dim::obbox3df Box  ) 

Returns the oriented-bounding box.

void sp::scene::OBBTreeNode::update ( bool  UpdateChildren = true  ) 

Updates the hierarchy of this node.


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