We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
Simple QuadTree written in C++ with SFML demo
QuadTree *quadTree =new QuadTree({ x, y, width, height },8,4);
// Inserts an object into the quadtreeint data =5;Collidable obj = Collidable({ x, y, width, height }, data);quadTree->insert(&obj);
// Removes an object from the quadtreequadTree->remove(&obj);
// Updates an object within the quadtree// Useful for objects that moveobj.bound.x =123.456;obj.bound.y =654.321;quadTree->update(&obj);
// Getting objects within a particular boundaryRect box = { x, y, width, height };std::vector<Collidable*> foundObjects = quadTree->getObjectsInBound(box);
std::cout << quadTree->totalChildren() << "\n";std::cout << quadTree->totalObjects() << "\n";
quadTree->clear();
int stuff =123;Collidable obj = Collidable({0,0,10,20}, stuff);std::cout << std::any_cast<int>(obj.data) <<'\n';