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

#include <KDTree.h>

Public Member Functions

 BoundsComparator (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 >::BoundsComparator

Compares bounds for strict >, <, or overlap

Constructor & Destructor Documentation

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

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 >::BoundsComparator::operator() ( Handle A,
const Handle B 
) const
inline
288  {
289  const AABox& a = A->bounds;
290  const AABox& b = B->bounds;
291 
292  if (a.high()[sortAxis] < b.low()[sortAxis]) {
293  return 1;
294  } else if (a.low()[sortAxis] > b.high()[sortAxis]) {
295  return -1;
296  } else {
297  return 0;
298  }
299  }
Vector3::Axis sortAxis
Definition: KDTree.h:284

+ 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 >::BoundsComparator::sortAxis

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