A node in the dynamic tree. More...
#include <playrho/d2/DynamicTree.hpp>
Public Member Functions | |
constexpr | TreeNode (const Contactable &value, const AABB &aabb, Size other=DynamicTree::InvalidSize) noexcept |
Initializing constructor. | |
constexpr | TreeNode (const DynamicTreeBranchData &value, const AABB &aabb, Height height, Size other=DynamicTree::InvalidSize) noexcept |
Initializing constructor. More... | |
constexpr | TreeNode (const TreeNode &other)=default |
Copy constructor. | |
constexpr | TreeNode (Size other=DynamicTree::InvalidSize) noexcept |
Initializing constructor. | |
constexpr | TreeNode (TreeNode &&other)=default |
Move constructor. | |
constexpr DynamicTreeBranchData | AsBranch () const noexcept |
Gets the node as a "branch" value. More... | |
constexpr Contactable | AsLeaf () const noexcept |
Gets the node as a "leaf" value. More... | |
constexpr void | Assign (const Contactable &v) noexcept |
Gets the node as a "leaf" value. More... | |
constexpr void | Assign (const DynamicTreeBranchData &v, const AABB &bb, Height h) noexcept |
Assigns the node as a "branch" value. More... | |
constexpr void | Assign (const DynamicTreeUnusedData &v) noexcept |
Gets the node as an "unused" value. More... | |
constexpr DynamicTreeUnusedData | AsUnused () const noexcept |
Gets the node as an "unused" value. More... | |
constexpr AABB | GetAABB () const noexcept |
Gets the node's AABB. More... | |
constexpr Height | GetHeight () const noexcept |
Gets the node "height". | |
constexpr Size | GetOther () const noexcept |
Gets the node's "other" index. | |
TreeNode & | operator= (const TreeNode &other)=default |
Copy assignment operator. | |
constexpr void | SetAABB (const AABB &value) noexcept |
Sets the node's AABB. More... | |
constexpr void | SetOther (Size other) noexcept |
Sets the node's "other" index to the given value. | |
Related Functions | |
(Note that these are not member functions.) | |
constexpr AABB | GetAABB (const DynamicTree::TreeNode &node) noexcept |
Gets the AABB of the given dynamic tree node. More... | |
constexpr DynamicTree::Size | GetNext (const DynamicTree::TreeNode &node) noexcept |
Gets the next index of the given node. More... | |
constexpr bool | IsBranch (const DynamicTree::TreeNode &node) noexcept |
Is branch. More... | |
constexpr bool | IsBranch (const DynamicTree::TreeNode &node) noexcept |
Is branch. More... | |
constexpr bool | IsLeaf (const DynamicTree::TreeNode &node) noexcept |
Is leaf. More... | |
constexpr bool | IsLeaf (const DynamicTree::TreeNode &node) noexcept |
Whether or not this node is a leaf node. More... | |
constexpr bool | IsUnused (const DynamicTree::TreeNode &node) noexcept |
Is unused. More... | |
constexpr bool | IsUnused (const DynamicTree::TreeNode &node) noexcept |
Whether this node is free (or allocated). | |
A node in the dynamic tree.
|
inlineconstexprnoexcept |
Initializing constructor.
height
is a value such that IsBranch(height)
is true. value.child1
nor value.child2
is equal to InvalidSize
.
|
inlineconstexprnoexcept |
Gets the node as a "branch" value.
IsBranch(GetHeight())
is true.
|
inlineconstexprnoexcept |
Gets the node as a "leaf" value.
IsLeaf(GetHeight())
is true.
|
inlineconstexprnoexcept |
Gets the node as a "leaf" value.
IsLeaf(GetHeight())
is true.
|
inlineconstexprnoexcept |
Assigns the node as a "branch" value.
IsBranch(GetHeight())
is true. v.child1
nor v.child2
is equal to InvalidSize
.
|
inlineconstexprnoexcept |
Gets the node as an "unused" value.
IsUnused(GetHeight())
is true.
|
inlineconstexprnoexcept |
Gets the node as an "unused" value.
IsUnused(GetHeight())
is true.
|
inlineconstexprnoexcept |
Gets the node's AABB.
IsUnused(GetHeight())
is false. Referenced by playrho::d2::DynamicTree::RebuildBottomUp().
|
inlineconstexprnoexcept |
Sets the node's AABB.
IsUnused(GetHeight())
is false. Referenced by playrho::d2::DynamicTree::UpdateLeaf().
|
related |
Gets the AABB of the given dynamic tree node.
node
must be a used node. I.e. IsUnused(node)
must be false.
|
related |
Gets the next index of the given node.
IsUnused(node)
is true.
|
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 Assign(), AsUnused(), GetAABB(), and SetAABB().