From 181ccb7934d02082cda3212497b2161215e37b9f Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Fri, 4 Jun 2021 13:02:27 +0200 Subject: [PATCH] Using views for the collision system --- sources/System/Collision/CollisionSystem.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sources/System/Collision/CollisionSystem.cpp b/sources/System/Collision/CollisionSystem.cpp index 7561b984..de4ef82b 100644 --- a/sources/System/Collision/CollisionSystem.cpp +++ b/sources/System/Collision/CollisionSystem.cpp @@ -32,12 +32,9 @@ namespace BBM position += entity.getComponent().getVelocity(); Vector3f minA = Vector3f::min(position, position + col.bound); Vector3f maxA = Vector3f::max(position, position + col.bound); - for (auto &other : _wal.scene->getEntities()) { + for (WAL::Entity &other : _wal.scene->view().entities) { if (&other == &entity) continue; - if (!other.hasComponent() || - !other.hasComponent()) - continue; auto colB = other.getComponent(); auto posB = other.getComponent().position; Vector3f minB = Vector3f::min(posB, posB + colB.bound);