From fab0fccc0aaa18e915bcd08e81e5a04177e435cd Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Mon, 21 Oct 2024 19:06:58 +0200 Subject: fix quad tree collision checker --- NaiveCollisionChecker.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 NaiveCollisionChecker.cpp (limited to 'NaiveCollisionChecker.cpp') 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); + } + } +} + -- cgit v1.2.3