TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::CenterComparator Class Reference

#include <KDTree.h>

Public Member Functions

 CenterComparator (Vector3::Axis a)
 
int operator() (Handle *A, const Handle *B) const
 

Public Attributes

Vector3::Axis sortAxis
 

Detailed Description

template<class T, class BoundsFunc = BoundsTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
class G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::CenterComparator

Compares centers

Constructor & Destructor Documentation

template<class T , class BoundsFunc = BoundsTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::CenterComparator::CenterComparator ( Vector3::Axis  a)
inline
264 : sortAxis(a) {}
Vector3::Axis sortAxis
Definition: KDTree.h:262

Member Function Documentation

template<class T , class BoundsFunc = BoundsTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
int G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::CenterComparator::operator() ( Handle A,
const Handle B 
) const
inline
266  {
267  float a = A->center[sortAxis];
268  float b = B->center[sortAxis];
269 
270  if (a < b) {
271  return 1;
272  } else if (a > b) {
273  return -1;
274  } else {
275  return 0;
276  }
277  }
Vector3::Axis sortAxis
Definition: KDTree.h:262

Member Data Documentation

template<class T , class BoundsFunc = BoundsTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
Vector3::Axis G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::CenterComparator::sortAxis

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