diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2024-12-19 20:27:39 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2024-12-19 20:27:39 +0100 |
commit | 3894948275e10b6a0e3614ba0da90b9ea8d6cd4e (patch) | |
tree | 8c2513cb9bcf955238bc5b9af6bbfbda7dcc525d /src | |
parent | 34d36c27549d54592051083aea6675dbaa9bb1fa (diff) |
make format
Diffstat (limited to 'src')
-rw-r--r-- | src/crepe/api/Vector2.hpp | 2 | ||||
-rw-r--r-- | src/crepe/system/CollisionSystem.cpp | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/crepe/api/Vector2.hpp b/src/crepe/api/Vector2.hpp index a470595..e195760 100644 --- a/src/crepe/api/Vector2.hpp +++ b/src/crepe/api/Vector2.hpp @@ -165,7 +165,7 @@ Vector2<T> Vector2<T>::perpendicular() const { template <class T> bool Vector2<T>::is_nan() const { - return std::isnan(x) && std::isnan(y); + return std::isnan(x) && std::isnan(y); } } // namespace crepe diff --git a/src/crepe/system/CollisionSystem.cpp b/src/crepe/system/CollisionSystem.cpp index 0bceac7..e4396b9 100644 --- a/src/crepe/system/CollisionSystem.cpp +++ b/src/crepe/system/CollisionSystem.cpp @@ -168,7 +168,7 @@ bool CollisionSystem::detect_collision(CollisionInternal & self, CollisionIntern // Get resolution vector from box-box collision detection resolution = this->get_box_box_detection(BOX1, BOX2); // If no collision (NaN values), return false - if(resolution.is_nan()) return false; + if (resolution.is_nan()) return false; break; } case CollisionInternalType::BOX_CIRCLE: { @@ -184,7 +184,7 @@ bool CollisionSystem::detect_collision(CollisionInternal & self, CollisionIntern // Get resolution vector from box-circle collision detection resolution = this->get_box_circle_detection(BOX1, CIRCLE2); // If no collision (NaN values), return false - if(resolution.is_nan()) return false; + if (resolution.is_nan()) return false; // Invert the resolution vector for proper collision response resolution = -resolution; break; @@ -202,7 +202,7 @@ bool CollisionSystem::detect_collision(CollisionInternal & self, CollisionIntern // Get resolution vector from circle-circle collision detection resolution = this->get_circle_circle_detection(CIRCLE1, CIRCLE2); // If no collision (NaN values), return false - if(resolution.is_nan()) return false; + if (resolution.is_nan()) return false; break; } case CollisionInternalType::CIRCLE_BOX: { @@ -218,7 +218,7 @@ bool CollisionSystem::detect_collision(CollisionInternal & self, CollisionIntern // Get resolution vector from box-circle collision detection (order swapped) resolution = this->get_box_circle_detection(BOX2, CIRCLE1); // If no collision (NaN values), return false - if(resolution.is_nan()) return false; + if (resolution.is_nan()) return false; break; } case CollisionInternalType::NONE: @@ -239,7 +239,8 @@ bool CollisionSystem::detect_collision(CollisionInternal & self, CollisionIntern return true; } -vec2 CollisionSystem::get_box_box_detection(const BoxColliderInternal & box1, const BoxColliderInternal & box2) const { +vec2 CollisionSystem::get_box_box_detection(const BoxColliderInternal & box1, + const BoxColliderInternal & box2) const { vec2 resolution{NAN, NAN}; // Get current positions of colliders vec2 pos1 = AbsolutePosition::get_position(box1.transform, box1.collider.offset); @@ -370,7 +371,8 @@ vec2 CollisionSystem::get_circle_circle_detection( return resolution; } // No collision - return vec2{NAN, NAN};; + return vec2{NAN, NAN}; + ; } CollisionSystem::Direction |