A node in the dynamic tree. More...
#include <DynamicTree.hpp>
Public Member Functions | |
| constexpr | TreeNode (const TreeNode &other)=default |
| Copy constructor. | |
| constexpr | TreeNode (TreeNode &&other)=default |
| Move constructor. | |
| constexpr | TreeNode (Size other=DynamicTree::GetInvalidSize()) noexcept |
| Initializing constructor. | |
| constexpr | TreeNode (const LeafData &value, AABB aabb, Size other=DynamicTree::GetInvalidSize()) noexcept |
| Initializing constructor. | |
| constexpr | TreeNode (const BranchData &value, AABB aabb, Height height, Size other=DynamicTree::GetInvalidSize()) noexcept |
| Initializing constructor. | |
| TreeNode & | operator= (const TreeNode &other)=default |
| Copy assignment operator. | |
| constexpr Height | GetHeight () const noexcept |
| Gets the node "height". | |
| constexpr Size | GetOther () const noexcept |
| Gets the node's "other" index. | |
| constexpr void | SetOther (Size other) noexcept |
| Sets the node's "other" index to the given value. | |
| constexpr AABB | GetAABB () const noexcept |
| Gets the node's AABB. More... | |
| constexpr void | SetAABB (AABB value) noexcept |
| Sets the node's AABB. More... | |
| constexpr UnusedData | AsUnused () const noexcept |
| Gets the node as an "unused" value. More... | |
| constexpr LeafData | AsLeaf () const noexcept |
| Gets the node as a "leaf" value. More... | |
| constexpr BranchData | AsBranch () const noexcept |
| Gets the node as a "branch" value. More... | |
| constexpr void | Assign (const UnusedData &v) noexcept |
| Gets the node as an "unused" value. | |
| constexpr void | Assign (const LeafData &v) noexcept |
| Gets the node as a "leaf" value. | |
| constexpr void | Assign (const BranchData &v, const AABB &bb, Height h) noexcept |
| Assigns the node as a "branch" value. | |
Private Attributes | |
| AABB | m_aabb |
| AABB. More... | |
| VariantData | m_variant {UnusedData{}} |
| Variant data for the node. | |
| Height | m_height = GetInvalidHeight() |
| Height. More... | |
| Size | m_other = DynamicTree::GetInvalidSize() |
| Index to "other" node. More... | |
Related Functions | |
(Note that these are not member functions.) | |
| constexpr bool | IsUnused (const DynamicTree::TreeNode &node) noexcept |
| Is unused. More... | |
| constexpr bool | IsLeaf (const DynamicTree::TreeNode &node) noexcept |
| Is leaf. More... | |
| constexpr bool | IsBranch (const DynamicTree::TreeNode &node) noexcept |
| Is branch. More... | |
| constexpr bool | IsUnused (const DynamicTree::TreeNode &node) noexcept |
| Whether this node is free (or allocated). | |
| constexpr bool | IsLeaf (const DynamicTree::TreeNode &node) noexcept |
| Whether or not this node is a leaf node. More... | |
| constexpr bool | IsBranch (const DynamicTree::TreeNode &node) noexcept |
| Is branch. More... | |
| constexpr AABB | GetAABB (const DynamicTree::TreeNode &node) noexcept |
| Gets the AABB of the given dynamic tree node. | |
| constexpr DynamicTree::Size | GetNext (const DynamicTree::TreeNode &node) noexcept |
| Gets the next index of the given node. More... | |
A node in the dynamic tree.
|
inlineconstexprnoexcept |
Gets the node as a "branch" value.
|
inlineconstexprnoexcept |
Gets the node as a "leaf" value.
|
inlineconstexprnoexcept |
Gets the node as an "unused" value.
|
inlineconstexprnoexcept |
Gets the node's AABB.
Referenced by playrho::d2::DynamicTree::RebuildBottomUp().
|
inlineconstexprnoexcept |
Sets the node's AABB.
Referenced by playrho::d2::DynamicTree::UpdateLeaf().
|
related |
Gets the next index of the given node.
|
related |
Is branch.
Determines whether the given dynamic tree node is a branch node. Branch nodes have 2 indices to child nodes.
Referenced by AsBranch(), and Assign().
|
related |
Is branch.
Determines whether the given node is a "branch" node.
|
related |
|
related |
Whether or not this node is a leaf node.
true if this is a leaf node, false otherwise.
|
related |
Is unused.
Determines whether the given dynamic tree node is an unused node.
Referenced by AsUnused(), GetAABB(), and SetAABB().
|
private |
|
private |
Height.
"Height" for tree balancing.
DynamicTree::GetInvalidHeight() if free (unallocated) node, else branch node. Referenced by AsBranch(), AsLeaf(), Assign(), AsUnused(), GetAABB(), GetHeight(), and SetAABB().
|
private |
Index to "other" node.
Referenced by GetOther(), and SetOther().