AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
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 stopAtFirstHit)
 Intersect ray. More...
 
void operator() (const G3D::Vector3 &p, uint32 idx)
 Intersect point. More...
 

Public Attributes

const T *const * objects
 
RayCallback & _callback
 
uint32 objects_size
 

Detailed Description

template<class T, class BoundsFunc = BoundsTrait<T>>
template<class RayCallback>
struct BIHWrap< T, BoundsFunc >::MDLCallback< RayCallback >

Constructor & Destructor Documentation

◆ MDLCallback()

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
36: objects(objects_array), _callback(callback), objects_size(objects_size) { }
const T *const * objects
Definition: BoundingIntervalHierarchyWrapper.h:32
RayCallback & _callback
Definition: BoundingIntervalHierarchyWrapper.h:33
uint32 objects_size
Definition: BoundingIntervalHierarchyWrapper.h:34

Member Function Documentation

◆ operator()() [1/2]

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  stopAtFirstHit 
)
inline

Intersect ray.

40 {
41 if (idx >= objects_size)
42 {
43 return false;
44 }
45 if (const T* obj = objects[idx])
46 {
47 return _callback(ray, *obj, maxDist, stopAtFirstHit);
48 }
49 return false;
50 }

References BIHWrap< T, BoundsFunc >::MDLCallback< RayCallback >::_callback, BIHWrap< T, BoundsFunc >::MDLCallback< RayCallback >::objects, and BIHWrap< T, BoundsFunc >::MDLCallback< RayCallback >::objects_size.

◆ operator()() [2/2]

template<class T , class BoundsFunc = BoundsTrait<T>>
template<class RayCallback >
void BIHWrap< T, BoundsFunc >::MDLCallback< RayCallback >::operator() ( const G3D::Vector3 &  p,
uint32  idx 
)
inline

Member Data Documentation

◆ _callback

template<class T , class BoundsFunc = BoundsTrait<T>>
template<class RayCallback >
RayCallback& BIHWrap< T, BoundsFunc >::MDLCallback< RayCallback >::_callback

◆ objects

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

◆ objects_size

template<class T , class BoundsFunc = BoundsTrait<T>>
template<class RayCallback >
uint32 BIHWrap< T, BoundsFunc >::MDLCallback< RayCallback >::objects_size