Class AABBtree

Class Documentation

class acme::AABBtree

Axis-aligned bouding box tree class container.

Axis-aligned bouding box AABB tree.

Public Types

typedef std::shared_ptr<AABBtree> ptr

Shared ointer to AABB tree object.

typedef std::vector<ptr> vecptr

Vector of pointers to AABB tree objects.

Public Functions

~AABBtree(void)

AABB tree class destructor.

AABBtree(void)

AABB tree class constructor.

void clear(void)

Clear AABB tree data.

bool isEmpty(void) const

Check if AABB tree is empty.

void build(aabb::vecptr const &boxes)

Build AABB tree given a list of boxes.

Parameters

boxes – List of boxes

void print(out_stream &stream, integer level = integer(0)) const

Print AABB tree data.

Parameters
  • stream – Output stream

  • level – Level to print

template<typename collisionFunction>
inline bool collision(AABBtree const &tree, collisionFunction function, bool swap_tree = false) const

Check if two AABB tree collide.

Parameters
  • tree – AABB tree used to check collision

  • function – Function to check if the contents of two aabb collide

  • swap_tree – If true exchange the tree in computation

void intersection(AABBtree const &tree, aabb::vecpairptr &intersectionList, bool swap_tree = false) const

Compute all the intersection candidates of AABB trees.

Parameters
  • tree – AABB tree used to check collision

  • intersectionList – List of pair aabb that overlaps

  • swap_tree – If true exchange the tree in computation