28 template<
class T,
class BoundsFunc = BoundsTrait<T> >
31 template<
class RayCallback>
38 MDLCallback(RayCallback& callback,
const T*
const* objects_array,
uint32 objects_size ) : objects(objects_array), _callback(callback), objects_size(objects_size) { }
43 if (idx >= objects_size)
45 if (
const T* obj = objects[idx])
53 if (idx >= objects_size)
55 if (
const T* obj = objects[idx])
74 m_objects_to_push.
insert(&obj);
77 void remove(
const T& obj)
83 m_objects[Idx] =
NULL;
85 m_objects_to_push.
remove(&obj);
90 if (unbalanced_times == 0)
99 m_tree.
build(m_objects, BoundsFunc::getBounds2);
102 template<
typename RayCallback>
110 template<
typename IsectCallback>
Definition: BoundingIntervalHierarchyWrapper.h:32
ObjArray m_objects
Definition: BoundingIntervalHierarchyWrapper.h:63
bool remove(const T &member)
Definition: Set.h:72
void intersectPoint(const G3D::Vector3 &point, IsectCallback &intersectCallback)
Definition: BoundingIntervalHierarchyWrapper.h:111
void fastClear()
Definition: Array.h:419
bool getRemove(const Key &key, Key &removedKey, Value &removedValue)
Definition: Table.h:660
void intersectRay(const G3D::Ray &ray, RayCallback &intersectCallback, float &maxDist)
Definition: BoundingIntervalHierarchyWrapper.h:103
int unbalanced_times
Definition: BoundingIntervalHierarchyWrapper.h:66
T * getCArray()
Definition: Array.h:256
const T *const * objects
Definition: BoundingIntervalHierarchyWrapper.h:34
arena_t NULL
Definition: jemalloc_internal.h:624
void insert(const T &obj)
Definition: BoundingIntervalHierarchyWrapper.h:71
G3D::Set< const T * > m_objects_to_push
Definition: BoundingIntervalHierarchyWrapper.h:65
Definition: BoundingIntervalHierarchyWrapper.h:29
BIH m_tree
Definition: BoundingIntervalHierarchyWrapper.h:62
RayCallback & _callback
Definition: BoundingIntervalHierarchyWrapper.h:35
bool insert(const T &member)
Definition: Set.h:62
uint32_t uint32
Definition: Define.h:150
bool operator()(const G3D::Ray &ray, uint32 idx, float &maxDist, bool)
Intersect ray.
Definition: BoundingIntervalHierarchyWrapper.h:41
uint32 objects_size
Definition: BoundingIntervalHierarchyWrapper.h:36
int size() const
Definition: Array.h:430
G3D::Table< const T *, uint32 > m_obj2Idx
Definition: BoundingIntervalHierarchyWrapper.h:64
Array< Key > getKeys() const
Definition: Table.h:907
Array< T > getMembers() const
Definition: Set.h:93
void intersectPoint(const G3D::Vector3 &p, IsectCallback &intersectCallback) const
Definition: BoundingIntervalHierarchy.h:260
BIHWrap()
Definition: BoundingIntervalHierarchyWrapper.h:69
void build(const PrimArray &primitives, BoundsFunc &getBounds, uint32 leafSize=3, bool printStats=false)
Definition: BoundingIntervalHierarchy.h:84
MDLCallback(RayCallback &callback, const T *const *objects_array, uint32 objects_size)
Definition: BoundingIntervalHierarchyWrapper.h:38
Definition: BoundingIntervalHierarchy.h:70
void balance()
Definition: BoundingIntervalHierarchyWrapper.h:88
void intersectRay(const G3D::Ray &r, RayCallback &intersectCallback, float &maxDist, bool stopAtFirst=false) const
Definition: BoundingIntervalHierarchy.h:121
G3D::Array< const T * > ObjArray
Definition: BoundingIntervalHierarchyWrapper.h:60