From b748691ea7aab8bd12ed76e81f9e9b4539e7d2f7 Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Thu, 14 Nov 2024 19:07:07 +0100 Subject: fixed bugs in collision system --- src/crepe/system/CollisionSystem.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/crepe') diff --git a/src/crepe/system/CollisionSystem.cpp b/src/crepe/system/CollisionSystem.cpp index 0d056a5..a3c59e3 100644 --- a/src/crepe/system/CollisionSystem.cpp +++ b/src/crepe/system/CollisionSystem.cpp @@ -70,7 +70,7 @@ std::vector> CollisionSystem::check_collisions(const std::ve for (size_t j = 0; j < circlecolliders.size(); ++j) { // Skip self collision - int game_object_id_2 = boxcolliders[j].get().game_object_id; + int game_object_id_2 = circlecolliders[j].get().game_object_id; if (game_object_id_1 == game_object_id_2) continue; // Fetch components for the second collider (circle) @@ -87,13 +87,13 @@ std::vector> CollisionSystem::check_collisions(const std::ve for (size_t i = 0; i < circlecolliders.size(); ++i) { // Fetch components for the first circle collider - int game_object_id_1 = boxcolliders[i].get().game_object_id; + int game_object_id_1 = circlecolliders[i].get().game_object_id; Transform & transform1 = mgr.get_components_by_id(circlecolliders[i].get().game_object_id).front().get(); Rigidbody & rigidbody1 = mgr.get_components_by_id(circlecolliders[i].get().game_object_id).front().get(); for (size_t j = i + 1; j < circlecolliders.size(); ++j) { // Skip self collision - int game_object_id_2 = boxcolliders[j].get().game_object_id; + int game_object_id_2 = circlecolliders[j].get().game_object_id; if (game_object_id_1 == game_object_id_2) continue; // Fetch components for the second circle collider -- cgit v1.2.3