diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-21 15:37:31 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-21 15:37:31 +0200 |
commit | e8601b35b601b0ee1486dfaa12385e71b7f2b300 (patch) | |
tree | 244fc97a12ee17e28e6fc407988508bfbc06d89a /CollisionContext.cpp | |
parent | fe8f7273f0efdfe319a0d3e3b2fc2847992745af (diff) |
WIP quadtree visualization scaffolding
Diffstat (limited to 'CollisionContext.cpp')
-rw-r--r-- | CollisionContext.cpp | 23 |
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), + }; +} + |