DynamicTree.hpp File Reference
#include <PlayRho/Collision/AABB.hpp>
#include <PlayRho/Common/Settings.hpp>
#include <functional>
#include <type_traits>
#include <utility>

Go to the source code of this file.

Classes

class  playrho::d2::DynamicTree
 A dynamic AABB tree broad-phase. More...
 
struct  playrho::d2::DynamicTree::UnusedData
 Unused data of a tree node. More...
 
struct  playrho::d2::DynamicTree::BranchData
 Branch data of a tree node. More...
 
struct  playrho::d2::DynamicTree::LeafData
 Leaf data of a tree node. More...
 
union  playrho::d2::DynamicTree::VariantData
 Variant data. More...
 
class  playrho::d2::DynamicTree::TreeNode
 A node in the dynamic tree. More...
 

Namespaces

 playrho
 
 playrho::d2
 

Typedefs

using playrho::d2::DynamicTreeSizeCB = std::function< DynamicTreeOpcode(DynamicTree::Size)>
 Query callback type. More...
 
using playrho::d2::QueryFixtureCallback = std::function< bool(Fixture *fixture, ChildCounter child)>
 Query AABB for fixtures callback function type. More...
 

Enumerations

enum  playrho::d2::DynamicTreeOpcode { playrho::d2::DynamicTreeOpcode::End, playrho::d2::DynamicTreeOpcode::Continue }
 Opcodes for dynamic tree callbacks. More...
 

Functions

PLAYRHO_CONSTEXPR bool playrho::d2::operator== (const DynamicTree::LeafData &lhs, const DynamicTree::LeafData &rhs) noexcept
 Equality operator. More...
 
PLAYRHO_CONSTEXPR bool playrho::d2::operator!= (const DynamicTree::LeafData &lhs, const DynamicTree::LeafData &rhs) noexcept
 Inequality operator. More...
 
PLAYRHO_CONSTEXPR bool playrho::d2::IsUnused (const DynamicTree::TreeNode &node) noexcept
 Is unused. More...
 
PLAYRHO_CONSTEXPR bool playrho::d2::IsLeaf (const DynamicTree::TreeNode &node) noexcept
 Is leaf. More...
 
PLAYRHO_CONSTEXPR bool playrho::d2::IsBranch (const DynamicTree::TreeNode &node) noexcept
 Is branch. More...
 
PLAYRHO_CONSTEXPR DynamicTree::BranchData playrho::d2::ReplaceChild (DynamicTree::BranchData bd, DynamicTree::Size oldChild, DynamicTree::Size newChild)
 Replaces the old child with the new child. More...
 
PLAYRHO_CONSTEXPR AABB playrho::d2::GetAABB (const DynamicTree::TreeNode &node) noexcept
 Gets the AABB of the given dynamic tree node. More...
 
PLAYRHO_CONSTEXPR DynamicTree::Size playrho::d2::GetNext (const DynamicTree::TreeNode &node) noexcept
 Gets the next index of the given node. More...
 
DynamicTree::Height playrho::d2::GetHeight (const DynamicTree &tree) noexcept
 Gets the height of the binary tree. More...
 
AABB playrho::d2::GetAABB (const DynamicTree &tree) noexcept
 Gets the AABB for the given dynamic tree. More...
 
bool playrho::d2::TestOverlap (const DynamicTree &tree, DynamicTree::Size leafIdA, DynamicTree::Size leafIdB) noexcept
 Tests for overlap of the elements identified in the given dynamic tree. More...
 
Length playrho::d2::ComputeTotalPerimeter (const DynamicTree &tree) noexcept
 Gets the sum of the perimeters of nodes. More...
 
Real playrho::d2::ComputePerimeterRatio (const DynamicTree &tree) noexcept
 Gets the ratio of the sum of the perimeters of nodes to the root perimeter. More...
 
DynamicTree::Height playrho::d2::ComputeHeight (const DynamicTree &tree, DynamicTree::Size index) noexcept
 Computes the height of the tree from a given node. More...
 
DynamicTree::Height playrho::d2::ComputeHeight (const DynamicTree &tree) noexcept
 Computes the height of the given dynamic tree. More...
 
bool playrho::d2::ValidateStructure (const DynamicTree &tree, DynamicTree::Size index) noexcept
 Validates the structure of the given tree from the given index. More...
 
bool playrho::d2::ValidateMetrics (const DynamicTree &tree, DynamicTree::Size index) noexcept
 Validates the metrics of the given tree from the given index. More...
 
DynamicTree::Height playrho::d2::GetMaxImbalance (const DynamicTree &tree) noexcept
 Gets the maximum imbalance. More...
 
void playrho::d2::Query (const DynamicTree &tree, const AABB &aabb, const DynamicTreeSizeCB &callback)
 Query the given dynamic tree and find nodes overlapping the given AABB. More...
 
void playrho::d2::Query (const DynamicTree &tree, const AABB &aabb, QueryFixtureCallback callback)
 Queries the world for all fixtures that potentially overlap the provided AABB. More...
 
std::size_t playrho::d2::size (const DynamicTree &tree) noexcept
 Gets the "size" of the given tree. More...
 

Detailed Description

Declaration of the DynamicTree class.

Definition in file DynamicTree.hpp.