AzeorthCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
DynTreeImpl Struct Reference
Inheritance diagram for DynTreeImpl:
RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >

Public Types

typedef GameObjectModel Model
 
typedef ParentTree base
 
- Public Types inherited from RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >
enum  { CELL_NUMBER = 64 }
 
typedef G3D::Table< const T *, NodeArray< Node > > MemberTable
 

Public Member Functions

 DynTreeImpl ()
 
void insert (const Model &mdl)
 
void remove (const Model &mdl)
 
void balance ()
 
void update (uint32 difftime)
 
- Public Member Functions inherited from RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >
 RegularGrid2D ()
 
 ~RegularGrid2D ()
 
void insert (const T &value)
 
void remove (const T &value)
 
void balance ()
 
bool contains (const T &value) const
 
int size () const
 
Node & getGridFor (float fx, float fy)
 
Node & getGrid (int x, int y)
 
template<typename RayCallback >
void intersectRay (const G3D::Ray &ray, RayCallback &intersectCallback, float max_dist, bool stopAtFirstHit)
 
template<typename RayCallback >
void intersectRay (const G3D::Ray &ray, RayCallback &intersectCallback, float &max_dist, const G3D::Vector3 &end, bool stopAtFirstHit)
 
template<typename IsectCallback >
void intersectPoint (const G3D::Vector3 &point, IsectCallback &intersectCallback)
 
template<typename RayCallback >
void intersectZAllignedRay (const G3D::Ray &ray, RayCallback &intersectCallback, float &max_dist)
 

Public Attributes

TimeTrackerSmall rebalance_timer
 
int unbalanced_times
 
- Public Attributes inherited from RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >
MemberTable memberTable
 
Node * nodes [CELL_NUMBER][CELL_NUMBER]
 

Detailed Description

Member Typedef Documentation

◆ base

◆ Model

Constructor & Destructor Documentation

◆ DynTreeImpl()

DynTreeImpl::DynTreeImpl ( )
inline
64 :
67 {
68 }
int CHECK_TREE_PERIOD
Definition: DynamicTree.cpp:38
TimeTrackerSmall rebalance_timer
Definition: DynamicTree.cpp:106
int unbalanced_times
Definition: DynamicTree.cpp:107

Member Function Documentation

◆ balance()

void DynTreeImpl::balance ( )
inline
83 {
86 }
void balance()
Definition: RegularGrid.h:133

References RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >::balance(), and unbalanced_times.

Referenced by DynamicMapTree::balance(), and update().

◆ insert()

void DynTreeImpl::insert ( const Model mdl)
inline
71 {
72 base::insert(mdl);
74 }
void insert(const T &value)
Definition: RegularGrid.h:74

References RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >::insert(), and unbalanced_times.

Referenced by DynamicMapTree::insert().

◆ remove()

void DynTreeImpl::remove ( const Model mdl)
inline
77 {
78 base::remove(mdl);
80 }
void remove(const T &value)
Definition: RegularGrid.h:114

References RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >::remove(), and unbalanced_times.

Referenced by DynamicMapTree::remove().

◆ update()

void DynTreeImpl::update ( uint32  difftime)
inline
89 {
90 if (!size())
91 {
92 return;
93 }
94
95 rebalance_timer.Update(difftime);
97 {
99 if (unbalanced_times > 0)
100 {
101 balance();
102 }
103 }
104 }
void balance()
Definition: DynamicTree.cpp:82
int size() const
Definition: RegularGrid.h:144
void Update(int32 diff)
Definition: Timer.h:239
void Reset(int32 interval)
Definition: Timer.h:249
bool Passed() const
Definition: Timer.h:244

References balance(), anonymous_namespace{DynamicTree.cpp}::CHECK_TREE_PERIOD, TimeTrackerSmall::Passed(), rebalance_timer, TimeTrackerSmall::Reset(), RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >::size(), unbalanced_times, and TimeTrackerSmall::Update().

Referenced by DynamicMapTree::update().

Member Data Documentation

◆ rebalance_timer

TimeTrackerSmall DynTreeImpl::rebalance_timer

Referenced by update().

◆ unbalanced_times

int DynTreeImpl::unbalanced_times

Referenced by balance(), insert(), remove(), and update().