diff options
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), + }; +} + |