TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
DynTreeImpl Struct Reference

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
*, 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)
 
template<typename RayCallback >
void intersectRay (const G3D::Ray &ray, RayCallback &intersectCallback, float &max_dist, const G3D::Vector3 &end)
 
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]
 

Member Typedef Documentation

Constructor & Destructor Documentation

DynTreeImpl::DynTreeImpl ( )
inline
68  :
69  rebalance_timer(CHECK_TREE_PERIOD),
71  {
72  }
TimeTrackerSmall rebalance_timer
Definition: DynamicTree.cpp:106
int unbalanced_times
Definition: DynamicTree.cpp:107

Member Function Documentation

void DynTreeImpl::balance ( )
inline
87  {
88  base::balance();
89  unbalanced_times = 0;
90  }
void balance()
Definition: RegularGrid.h:65
int unbalanced_times
Definition: DynamicTree.cpp:107

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void DynTreeImpl::insert ( const Model mdl)
inline
75  {
76  base::insert(mdl);
78  }
void insert(const T &value)
Definition: RegularGrid.h:49
int unbalanced_times
Definition: DynamicTree.cpp:107

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void DynTreeImpl::remove ( const Model mdl)
inline
81  {
82  base::remove(mdl);
84  }
void remove(const T &value)
Definition: RegularGrid.h:58
int unbalanced_times
Definition: DynamicTree.cpp:107

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void DynTreeImpl::update ( uint32  difftime)
inline
93  {
94  if (!size())
95  return;
96 
97  rebalance_timer.Update(difftime);
98  if (rebalance_timer.Passed())
99  {
100  rebalance_timer.Reset(CHECK_TREE_PERIOD);
101  if (unbalanced_times > 0)
102  balance();
103  }
104  }
void balance()
Definition: DynamicTree.cpp:86
void Update(int32 diff)
Definition: Timer.h:143
void Reset(uint32 interval)
Definition: Timer.h:153
TimeTrackerSmall rebalance_timer
Definition: DynamicTree.cpp:106
int size() const
Definition: RegularGrid.h:74
int unbalanced_times
Definition: DynamicTree.cpp:107
bool Passed() const
Definition: Timer.h:148

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

TimeTrackerSmall DynTreeImpl::rebalance_timer
int DynTreeImpl::unbalanced_times

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