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

#include <aabb_octree.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_octree (i_ecs &iEcs, const aabb &aRootAabb=aabb{ vec3{-4096.0, -4096.0, -4096.0}, vec3{4096.0, 4096.0, 4096.0} }, scalar aMinimumOctantSize=16.0, const allocator_type &aAllocator=allocator_type{})
 
scalar minimum_octant_size () const
 
void full_update ()
 
void dynamic_update ()
 
template<typename CollisionAction >
void collisions (CollisionAction aCollisionAction) const
 
template<typename ResultContainer >
void pick (const vec3 &aPoint, ResultContainer &aResult, std::function< bool(entity_id aMatch, const vec3 &aPoint)> aColliderPredicate=[](entity_id, const vec3 &) { return true;}) 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_octree< Collider, BucketSize, Allocator >

Definition at line 33 of file aabb_octree.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_octree< Collider, BucketSize, Allocator >::allocator_type

Definition at line 37 of file aabb_octree.hpp.

◆ collider_type

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

Definition at line 36 of file aabb_octree.hpp.

◆ const_iterator

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

Definition at line 43 of file aabb_octree.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_octree< Collider, BucketSize, Allocator >::const_pointer

Definition at line 39 of file aabb_octree.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_octree< Collider, BucketSize, Allocator >::const_reference

Definition at line 41 of file aabb_octree.hpp.

◆ iterator

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

Definition at line 44 of file aabb_octree.hpp.

◆ pointer

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

Definition at line 38 of file aabb_octree.hpp.

◆ reference

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

Definition at line 40 of file aabb_octree.hpp.

Constructor & Destructor Documentation

◆ aabb_octree()

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
neogfx::game::aabb_octree< Collider, BucketSize, Allocator >::aabb_octree ( i_ecs iEcs,
const aabb aRootAabb = aabbvec3{-4096.0, -4096.0, -4096.0}, vec3{4096.0, 4096.0, 4096.0} },
scalar  aMinimumOctantSize = 16.0,
const allocator_type aAllocator = allocator_type{} 
)
inline

Definition at line 435 of file aabb_octree.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_octree< Collider, BucketSize, Allocator >::collisions ( CollisionAction  aCollisionAction) const
inline

Definition at line 472 of file aabb_octree.hpp.

◆ count()

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

Definition at line 536 of file aabb_octree.hpp.

◆ depth()

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

Definition at line 540 of file aabb_octree.hpp.

◆ dynamic_update()

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

Definition at line 462 of file aabb_octree.hpp.

◆ full_update()

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

Definition at line 451 of file aabb_octree.hpp.

◆ insert()

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

Definition at line 527 of file aabb_octree.hpp.

◆ minimum_octant_size()

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

Definition at line 447 of file aabb_octree.hpp.

◆ pick() [1/2]

template<typename Collider , std::size_t BucketSize = 16, typename Allocator = boost::fast_pool_allocator<Collider>>
template<typename ResultContainer >
void neogfx::game::aabb_octree< 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 512 of file aabb_octree.hpp.

◆ pick() [2/2]

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

Definition at line 502 of file aabb_octree.hpp.

◆ remove()

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

Definition at line 531 of file aabb_octree.hpp.

◆ root_node()

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

Definition at line 545 of file aabb_octree.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_octree< Collider, BucketSize, Allocator >::visit_aabbs ( const Visitor &  aVisitor) const
inline

Definition at line 522 of file aabb_octree.hpp.


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