Oriented bounding box tree node class used for bounding volume hierarchies. More...
#include <spTreeNodeOBB.hpp>
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 TreeNode * | findLeaf (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 |
OBBTreeNode * | insertBoundingBox (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. |
Oriented bounding box tree node class used for bounding volume hierarchies.
sp::scene::OBBTreeNode::OBBTreeNode | ( | OBBTreeNode * | Parent = 0 , |
|
const dim::obbox3df & | Box = dim::obbox3df() | |||
) |
sp::scene::OBBTreeNode::~OBBTreeNode | ( | ) |
const TreeNode * sp::scene::OBBTreeNode::findLeaf | ( | const dim::vector3df & | Point | ) | const [virtual] |
Searches for a leaf TreeNode object that contains the specified point.
Point,: | Specifies the point where the node is you are searching for. |
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.
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.
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.
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.
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.