StaticQuadtree.cpp 362 B

12345678910111213141516
  1. #include "StaticQuadtree.h"
  2. #include <cassert>
  3. using namespace ltbl;
  4. void StaticQuadtree::add(QuadtreeOccupant* oc) {
  5. assert(created());
  6. setQuadtree(oc);
  7. // If the occupant fits in the root node
  8. if (rectContains(_pRootNode->getRegion(), oc->getAABB()))
  9. _pRootNode->add(oc);
  10. else
  11. _outsideRoot.insert(oc);
  12. }