aboutsummaryrefslogtreecommitdiff
path: root/NaiveCollisionChecker.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 /NaiveCollisionChecker.cpp
parent10ce9f45b9551dc103272c2b2374db1c1e3b8bcb (diff)
fix quad tree collision checker
Diffstat (limited to 'NaiveCollisionChecker.cpp')
-rw-r--r--NaiveCollisionChecker.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/NaiveCollisionChecker.cpp b/NaiveCollisionChecker.cpp
new file mode 100644
index 0000000..db277ab
--- /dev/null
+++ b/NaiveCollisionChecker.cpp
@@ -0,0 +1,19 @@
+#include "NaiveCollisionChecker.h"
+#include "Museum.h"
+#include "People.h"
+#include "Artist.h"
+
+void NaiveCollisionChecker::check() {
+ auto artists = this->museum.people.get_artists();
+ for (Artist * artist : artists) artist->colliding = false;
+ auto begin = artists.begin();
+ auto end = artists.end();
+ for (auto it1 = begin; it1 != end; ++it1) {
+ auto it2 = it1;
+ ++it2;
+ for (; it2 != end; ++it2) {
+ this->compare(**it1, **it2);
+ }
+ }
+}
+