PlayRho  2.0.0
An interactive physics engine & library.
DynamicTree.hpp File Reference

Declaration of the DynamicTree class. More...

#include <cassert>
#include <cstddef>
#include <functional>
#include <playrho/d2/AABB.hpp>
#include <playrho/d2/DynamicTreeData.hpp>
#include <playrho/ShapeID.hpp>
#include <playrho/Settings.hpp>
#include <playrho/Vector2.hpp>
#include <playrho/BodyID.hpp>
Include dependency graph for DynamicTree.hpp:
This graph shows which files directly or indirectly include this file:

Classes

class  playrho::d2::DynamicTree
 A dynamic AABB tree broad-phase. 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.
 
using playrho::d2::QueryShapeCallback = std::function< bool(BodyID body, ShapeID shape, ChildCounter child)>
 Query AABB for fixtures callback function type. More...
 

Enumerations

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

Functions

DynamicTree::Height playrho::d2::ComputeHeight (const DynamicTree &tree) noexcept
 Computes the height of the given dynamic tree.
 
DynamicTree::Height playrho::d2::ComputeHeight (const DynamicTree &tree, DynamicTree::Size index) noexcept
 Computes the height of the tree from a given node. 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...
 
Length playrho::d2::ComputeTotalPerimeter (const DynamicTree &tree) noexcept
 Gets the sum of the perimeters of nodes. More...
 
auto playrho::d2::FindIndex (const DynamicTree &tree, const Contactable &c) noexcept -> DynamicTree::Size
 Finds index of node matching given contactble using a linear search. More...
 
AABB playrho::d2::GetAABB (const DynamicTree &tree) noexcept
 Gets the AABB for the given dynamic tree. More...
 
constexpr AABB playrho::d2::GetAABB (const DynamicTree::TreeNode &node) noexcept
 Gets the AABB of the given dynamic tree node. More...
 
DynamicTree::Height playrho::d2::GetHeight (const DynamicTree &tree) noexcept
 Gets the height of the binary tree. More...
 
DynamicTree::Height playrho::d2::GetMaxImbalance (const DynamicTree &tree) noexcept
 Gets the maximum imbalance. More...
 
constexpr DynamicTree::Size playrho::d2::GetNext (const DynamicTree::TreeNode &node) noexcept
 Gets the next index of the given node. More...
 
constexpr bool playrho::d2::IsBranch (const DynamicTree::TreeNode &node) noexcept
 Is branch. More...
 
constexpr bool playrho::d2::IsLeaf (const DynamicTree::TreeNode &node) noexcept
 Is leaf. More...
 
constexpr bool playrho::d2::IsUnused (const DynamicTree::TreeNode &node) noexcept
 Is unused. 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, QueryShapeCallback callback)
 Queries the world for all fixtures that potentially overlap the provided AABB. More...
 
constexpr DynamicTreeBranchData playrho::d2::ReplaceChild (DynamicTreeBranchData bd, DynamicTree::Size oldChild, DynamicTree::Size newChild)
 Replaces the old child with the new child. More...
 
std::size_t playrho::d2::size (const DynamicTree &tree) noexcept
 Gets the "size" of the given 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.
 
bool playrho::d2::ValidateMetrics (const DynamicTree &tree, DynamicTree::Size index) noexcept
 Validates the metrics of the given tree from the given index. More...
 
bool playrho::d2::ValidateStructure (const DynamicTree &tree, DynamicTree::Size index) noexcept
 Validates the structure of the given tree from the given index. More...
 

Detailed Description

Declaration of the DynamicTree class.