aboutsummaryrefslogtreecommitdiff
path: root/CollisionContext.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-21 15:37:31 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-21 15:37:31 +0200
commite8601b35b601b0ee1486dfaa12385e71b7f2b300 (patch)
tree244fc97a12ee17e28e6fc407988508bfbc06d89a /CollisionContext.cpp
parentfe8f7273f0efdfe319a0d3e3b2fc2847992745af (diff)
WIP quadtree visualization scaffolding
Diffstat (limited to 'CollisionContext.cpp')
-rw-r--r--CollisionContext.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/CollisionContext.cpp b/CollisionContext.cpp
new file mode 100644
index 0000000..648b889
--- /dev/null
+++ b/CollisionContext.cpp
@@ -0,0 +1,23 @@
+#include <memory>
+
+#include "CollisionContext.h"
+#include "Museum.h"
+
+using namespace std;
+
+CollisionContext::CollisionContext(Museum & m) : museum(m) {}
+
+shared_ptr<QuadTree> CollisionContext::get_quadtree() {
+ return this->quadtree;
+}
+
+void CollisionContext::update() {
+ this->quadtree = std::make_shared<QuadTree>();
+ this->quadtree->boundary = {
+ .x = 0.0,
+ .y = 0.0,
+ .width = static_cast<float>(this->museum.canvas.data.columns),
+ .height = static_cast<float>(this->museum.canvas.data.rows),
+ };
+}
+