diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2024-11-14 19:07:07 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2024-11-14 19:07:07 +0100 |
commit | b748691ea7aab8bd12ed76e81f9e9b4539e7d2f7 (patch) | |
tree | add1f69cc517c1a8763171604deeaa48bafe74f6 /src/crepe/system | |
parent | 15c4cf103c4da7808b7173581ead22ab7190632d (diff) |
fixed bugs in collision system
Diffstat (limited to 'src/crepe/system')
-rw-r--r-- | src/crepe/system/CollisionSystem.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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<std::pair<int, int>> 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<std::pair<int, int>> 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<Transform>(circlecolliders[i].get().game_object_id).front().get(); Rigidbody & rigidbody1 = mgr.get_components_by_id<Rigidbody>(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 |