neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator > Class Template Reference

#include <aabb_quadtree.hpp>

Public Types

typedef Collider collider_type
 
typedef Allocator allocator_type
 
typedef allocator_type::pointer pointer
 
typedef allocator_type::const_pointer const_pointer
 
typedef allocator_type::reference reference
 
typedef allocator_type::const_reference const_reference
 
typedef const void * const_iterator
 
typedef void * iterator
 

Public Member Functions

 aabb_quadtree (i_ecs &aEcs, const aabb_2d &aRootAabb=aabb_2d{ vec2{-4096.0, -4096.0}, vec2{4096.0, 4096.0} }, scalar aMinimumQuadrantSize=16.0, const allocator_type &aAllocator=allocator_type{})
 
scalar minimum_quadrant_size () const
 
void full_update ()
 
void dynamic_update ()
 
template<typename CollisionAction >
void collisions (CollisionAction aCollisionAction) const
 
template<typename ResultContainer >
void pick (const vec2 &aPoint, ResultContainer &aResult, std::function< bool(entity_id aMatch, const vec2 &aPoint)> aColliderPredicate=[](entity_id, const vec2 &) { return true;}) const
 
template<typename Visitor >
void visit_aabbs (const Visitor &aVisitor) const
 
void insert (reference aItem)
 
void remove (reference aItem)
 
uint32_t count () const
 
uint32_t depth () const
 
const node & root_node () const
 

Detailed Description

template<typename Collider, std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
class neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >

Definition at line 33 of file aabb_quadtree.hpp.

Member Typedef Documentation

◆ allocator_type

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
typedef Allocator neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::allocator_type

Definition at line 37 of file aabb_quadtree.hpp.

◆ collider_type

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
typedef Collider neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::collider_type

Definition at line 36 of file aabb_quadtree.hpp.

◆ const_iterator

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
typedef const void* neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::const_iterator

Definition at line 43 of file aabb_quadtree.hpp.

◆ const_pointer

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
typedef allocator_type::const_pointer neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::const_pointer

Definition at line 39 of file aabb_quadtree.hpp.

◆ const_reference

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
typedef allocator_type::const_reference neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::const_reference

Definition at line 41 of file aabb_quadtree.hpp.

◆ iterator

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
typedef void* neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::iterator

Definition at line 44 of file aabb_quadtree.hpp.

◆ pointer

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
typedef allocator_type::pointer neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::pointer

Definition at line 38 of file aabb_quadtree.hpp.

◆ reference

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
typedef allocator_type::reference neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::reference

Definition at line 40 of file aabb_quadtree.hpp.

Constructor & Destructor Documentation

◆ aabb_quadtree()

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::aabb_quadtree ( i_ecs aEcs,
const aabb_2d aRootAabb = aabb_2dvec2{-4096.0, -4096.0}, vec2{4096.0, 4096.0} },
scalar  aMinimumQuadrantSize = 16.0,
const allocator_type aAllocator = allocator_type{} 
)
inline

Definition at line 320 of file aabb_quadtree.hpp.

Member Function Documentation

◆ collisions()

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
template<typename CollisionAction >
void neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::collisions ( CollisionAction  aCollisionAction) const
inline

Definition at line 357 of file aabb_quadtree.hpp.

◆ count()

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
uint32_t neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::count ( ) const
inline

Definition at line 411 of file aabb_quadtree.hpp.

◆ depth()

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
uint32_t neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::depth ( ) const
inline

Definition at line 415 of file aabb_quadtree.hpp.

◆ dynamic_update()

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
void neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::dynamic_update ( )
inline

Definition at line 347 of file aabb_quadtree.hpp.

◆ full_update()

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
void neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::full_update ( )
inline

Definition at line 336 of file aabb_quadtree.hpp.

◆ insert()

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
void neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::insert ( reference  aItem)
inline

Definition at line 402 of file aabb_quadtree.hpp.

◆ minimum_quadrant_size()

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
scalar neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::minimum_quadrant_size ( ) const
inline

Definition at line 332 of file aabb_quadtree.hpp.

◆ pick()

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
template<typename ResultContainer >
void neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::pick ( const vec2 aPoint,
ResultContainer &  aResult,
std::function< bool(entity_id aMatch, const vec2 &aPoint)>  aColliderPredicate = [](entity_id, const vec2&) { return true; } 
) const
inline

Definition at line 387 of file aabb_quadtree.hpp.

◆ remove()

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
void neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::remove ( reference  aItem)
inline

Definition at line 406 of file aabb_quadtree.hpp.

◆ root_node()

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
const node & neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::root_node ( ) const
inline

Definition at line 420 of file aabb_quadtree.hpp.

◆ visit_aabbs()

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
template<typename Visitor >
void neogfx::game::aabb_quadtree< Collider, BucketSize, Allocator >::visit_aabbs ( const Visitor &  aVisitor) const
inline

Definition at line 397 of file aabb_quadtree.hpp.


The documentation for this class was generated from the following file: