TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
BIHWrap< T, BoundsFunc >::MDLCallback< RayCallback > Struct Template Reference

Public Member Functions

 MDLCallback (RayCallback &callback, const T *const *objects_array, uint32 objects_size)
 
bool operator() (const G3D::Ray &ray, uint32 idx, float &maxDist, bool)
 Intersect ray. More...
 
void operator() (const G3D::Vector3 &p, uint32 idx)
 Intersect point. More...
 

Public Attributes

const T *constobjects
 
RayCallback & _callback
 
uint32 objects_size
 

Constructor & Destructor Documentation

template<class T , class BoundsFunc = BoundsTrait<T>>
template<class RayCallback >
BIHWrap< T, BoundsFunc >::MDLCallback< RayCallback >::MDLCallback ( RayCallback &  callback,
const T *const objects_array,
uint32  objects_size 
)
inline
38 : objects(objects_array), _callback(callback), objects_size(objects_size) { }
const T *const * objects
Definition: BoundingIntervalHierarchyWrapper.h:34
RayCallback & _callback
Definition: BoundingIntervalHierarchyWrapper.h:35
uint32 objects_size
Definition: BoundingIntervalHierarchyWrapper.h:36

Member Function Documentation

template<class T , class BoundsFunc = BoundsTrait<T>>
template<class RayCallback >
bool BIHWrap< T, BoundsFunc >::MDLCallback< RayCallback >::operator() ( const G3D::Ray ray,
uint32  idx,
float &  maxDist,
bool   
)
inline

Intersect ray.

42  {
43  if (idx >= objects_size)
44  return false;
45  if (const T* obj = objects[idx])
46  return _callback(ray, *obj, maxDist/*, stopAtFirst*/);
47  return false;
48  }
const T *const * objects
Definition: BoundingIntervalHierarchyWrapper.h:34
RayCallback & _callback
Definition: BoundingIntervalHierarchyWrapper.h:35
uint32 objects_size
Definition: BoundingIntervalHierarchyWrapper.h:36
template<class T , class BoundsFunc = BoundsTrait<T>>
template<class RayCallback >
void BIHWrap< T, BoundsFunc >::MDLCallback< RayCallback >::operator() ( const G3D::Vector3 p,
uint32  idx 
)
inline

Intersect point.

52  {
53  if (idx >= objects_size)
54  return;
55  if (const T* obj = objects[idx])
56  _callback(p, *obj);
57  }
const T *const * objects
Definition: BoundingIntervalHierarchyWrapper.h:34
RayCallback & _callback
Definition: BoundingIntervalHierarchyWrapper.h:35
uint32 objects_size
Definition: BoundingIntervalHierarchyWrapper.h:36

Member Data Documentation

template<class T , class BoundsFunc = BoundsTrait<T>>
template<class RayCallback >
RayCallback& BIHWrap< T, BoundsFunc >::MDLCallback< RayCallback >::_callback
template<class T , class BoundsFunc = BoundsTrait<T>>
template<class RayCallback >
const T* const* BIHWrap< T, BoundsFunc >::MDLCallback< RayCallback >::objects
template<class T , class BoundsFunc = BoundsTrait<T>>
template<class RayCallback >
uint32 BIHWrap< T, BoundsFunc >::MDLCallback< RayCallback >::objects_size

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