-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathaoi.h
31 lines (24 loc) · 1020 Bytes
/
aoi.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef __AOI_SCENE_H__
#define __AOI_SCENE_H__
#include "point.h"
#include "impl/quadtree.h"
namespace aoi
{
class Object : public Point
{
public:
Object() : Point(), mNode(nullptr), mQueryNext(nullptr), mItemNext(nullptr) {}
Object(float x, float y) : Point(x, y), mNode(nullptr), mQueryNext(nullptr), mItemNext(nullptr) {}
virtual ~Object() {}
inline Object* Next() { return mQueryNext; }
private:
void* mNode;
Object* mQueryNext;
void* mItemNext;
template<typename TItem, unsigned NodeCapacity, unsigned LevelLimit, typename TAlloc> friend class impl::QuadTree;
template<typename TItem, unsigned NodeCapacity, unsigned LevelLimit> friend class impl::QuadTreeNode;
};
template<typename TItem, unsigned NodeCapacity, unsigned LevelLimit = 10, typename TAlloc = impl::AlignedMem<impl::QuadTreeNode<TItem, NodeCapacity, LevelLimit>>>
using Scene = impl::QuadTree<TItem, NodeCapacity, LevelLimit, TAlloc>;
}
#endif