diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-21 19:06:58 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-21 19:06:58 +0200 |
commit | fab0fccc0aaa18e915bcd08e81e5a04177e435cd (patch) | |
tree | 0e8e51ff61c88b60d1f845bc9fde20ea5ba7099b /CollisionChecker.cpp | |
parent | 10ce9f45b9551dc103272c2b2374db1c1e3b8bcb (diff) |
fix quad tree collision checker
Diffstat (limited to 'CollisionChecker.cpp')
-rw-r--r-- | CollisionChecker.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/CollisionChecker.cpp b/CollisionChecker.cpp new file mode 100644 index 0000000..b8bcbd5 --- /dev/null +++ b/CollisionChecker.cpp @@ -0,0 +1,14 @@ +#include "CollisionChecker.h" +#include "Museum.h" + +CollisionChecker::CollisionChecker(Museum & m) : museum(m) { } + +void CollisionChecker::compare(Artist & a, Artist & b) { + if (a.data.x + 0.5 < b.data.x) return; + if (a.data.y + 0.5 < b.data.y) return; + if (a.data.x > b.data.x + 0.5) return; + if (a.data.y > b.data.y + 0.5) return; + + a.colliding = b.colliding = true; +} + |