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

#include <KDTree.h>

Public Member Functions

 Comparator (Vector3::Axis a, float l)
 
int operator() (Handle *ignore, const Handle *handle) const
 

Public Attributes

Vector3::Axis sortAxis
 
float sortLocation
 

Detailed Description

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

Compares bounds to the sort location

Constructor & Destructor Documentation

template<class T , class BoundsFunc = BoundsTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Comparator::Comparator ( Vector3::Axis  a,
float  l 
)
inline
309 : sortAxis(a), sortLocation(l) {}
Vector3::Axis sortAxis
Definition: KDTree.h:306
float sortLocation
Definition: KDTree.h:307

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 >::Comparator::operator() ( Handle ignore,
const Handle handle 
) const
inline
311  {
312  (void)ignore;
313  const AABox& box = handle->bounds;
314  debugAssert(ignore == NULL);
315 
316  if (box.high()[sortAxis] < sortLocation) {
317  // Box is strictly below the sort location
318  return -1;
319  } else if (box.low()[sortAxis] > sortLocation) {
320  // Box is strictly above the sort location
321  return 1;
322  } else {
323  // Box overlaps the sort location
324  return 0;
325  }
326  }
arena_t NULL
Definition: jemalloc_internal.h:624
Vector3::Axis sortAxis
Definition: KDTree.h:306
#define debugAssert(exp)
Definition: debugAssert.h:160
float sortLocation
Definition: KDTree.h:307

+ Here is the call graph for this function:

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 >::Comparator::sortAxis
template<class T , class BoundsFunc = BoundsTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
float G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Comparator::sortLocation

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