Class AABBTree

class AABBTree

Public Functions

AABBTree() = default
~AABBTree()
void init(int capacity, float minMargin = 0.0f)

Initializes the tree with a given capacity and minimum margin for fattening AABBs.

Parameters:
  • capacity – initial number of nodes to allocate; will grow as needed.

  • minMargin – absolute floor for the fattening margin; leave at 0 for static trees.

void destroy()
NodeProxy createNode(const AABB &bounds, void *data)
bool moveNode(NodeProxy node, const AABB &aabb, const fm_vec3_t &displacement)
void removeLeaf(NodeProxy leaf, bool freeIt)
inline void *getNodeData(NodeProxy node) const
inline const AABB *getNodeBounds(NodeProxy node) const
inline bool isLeaf(NodeProxy node) const
int queryBounds(const AABB &queryBox, NodeProxy *results, int maxResults) const
int queryPoint(const fm_vec3_t &point, NodeProxy *results, int maxResults) const
int queryRay(const Raycast &ray, NodeProxy *results, int maxResults) const

Public Members

NodeProxy root = {NULL_NODE}

Public Static Functions

static inline int32_t makeNodePairKey(NodeProxy id_a, NodeProxy id_b)