aboutsummaryrefslogtreecommitdiff
path: root/CollisionContext.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-21 19:06:58 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-21 19:06:58 +0200
commitfab0fccc0aaa18e915bcd08e81e5a04177e435cd (patch)
tree0e8e51ff61c88b60d1f845bc9fde20ea5ba7099b /CollisionContext.cpp
parent10ce9f45b9551dc103272c2b2374db1c1e3b8bcb (diff)
fix quad tree collision checker
Diffstat (limited to 'CollisionContext.cpp')
-rw-r--r--CollisionContext.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/CollisionContext.cpp b/CollisionContext.cpp
index e7550e5..ec608b5 100644
--- a/CollisionContext.cpp
+++ b/CollisionContext.cpp
@@ -2,16 +2,20 @@
#include "CollisionContext.h"
#include "Museum.h"
+#include "NaiveCollisionChecker.h"
+#include "QuadTreeCollisionChecker.h"
using namespace std;
CollisionContext::CollisionContext(Museum & m) : museum(m) {}
-shared_ptr<QuadTree> CollisionContext::get_quadtree() {
- return this->quadtree;
+shared_ptr<CollisionChecker> CollisionContext::get_checker() {
+ return this->checker;
}
void CollisionContext::update() {
- this->quadtree = std::make_shared<QuadTree>(this->museum);
+ this->checker = std::make_shared<QuadTreeCollisionChecker>(this->museum);
+ // this->checker = std::make_shared<NaiveCollisionChecker>(this->museum);
+ this->checker->check();
}