From c990f7984ec0bfa7c784d5d89fb1fc64e9cadef5 Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Sat, 14 Jan 2023 04:39:40 +0100 Subject: C#: Remove `includeBorders` parameter from `Rect2i.Intersects` and `AABB.Intersects` --- .../mono/glue/GodotSharp/GodotSharp/Core/AABB.cs | 49 ++++++---------------- .../mono/glue/GodotSharp/GodotSharp/Core/Rect2i.cs | 37 ++++------------ 2 files changed, 22 insertions(+), 64 deletions(-) (limited to 'modules/mono/glue') diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/AABB.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/AABB.cs index 13a21ae8bc..0e46b63b59 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/AABB.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/AABB.cs @@ -437,48 +437,25 @@ namespace Godot /// /// Returns if the overlaps with /// (i.e. they have at least one point in common). - /// - /// If is , - /// they will also be considered overlapping if their borders touch, - /// even without intersection. /// /// The other to check for intersections with. - /// Whether or not to consider borders. /// /// A for whether or not they are intersecting. /// - public readonly bool Intersects(AABB with, bool includeBorders = false) + public readonly bool Intersects(AABB with) { - if (includeBorders) - { - if (_position.x > with._position.x + with._size.x) - return false; - if (_position.x + _size.x < with._position.x) - return false; - if (_position.y > with._position.y + with._size.y) - return false; - if (_position.y + _size.y < with._position.y) - return false; - if (_position.z > with._position.z + with._size.z) - return false; - if (_position.z + _size.z < with._position.z) - return false; - } - else - { - if (_position.x >= with._position.x + with._size.x) - return false; - if (_position.x + _size.x <= with._position.x) - return false; - if (_position.y >= with._position.y + with._size.y) - return false; - if (_position.y + _size.y <= with._position.y) - return false; - if (_position.z >= with._position.z + with._size.z) - return false; - if (_position.z + _size.z <= with._position.z) - return false; - } + if (_position.x >= with._position.x + with._size.x) + return false; + if (_position.x + _size.x <= with._position.x) + return false; + if (_position.y >= with._position.y + with._size.y) + return false; + if (_position.y + _size.y <= with._position.y) + return false; + if (_position.z >= with._position.z + with._size.z) + return false; + if (_position.z + _size.z <= with._position.z) + return false; return true; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2i.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2i.cs index faee81a98a..cf8939a859 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2i.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2i.cs @@ -275,38 +275,19 @@ namespace Godot /// /// Returns if the overlaps with /// (i.e. they have at least one point in common). - /// - /// If is , - /// they will also be considered overlapping if their borders touch, - /// even without intersection. /// /// The other to check for intersections with. - /// Whether or not to consider borders. /// A for whether or not they are intersecting. - public readonly bool Intersects(Rect2i b, bool includeBorders = false) + public readonly bool Intersects(Rect2i b) { - if (includeBorders) - { - if (_position.x > b._position.x + b._size.x) - return false; - if (_position.x + _size.x < b._position.x) - return false; - if (_position.y > b._position.y + b._size.y) - return false; - if (_position.y + _size.y < b._position.y) - return false; - } - else - { - if (_position.x >= b._position.x + b._size.x) - return false; - if (_position.x + _size.x <= b._position.x) - return false; - if (_position.y >= b._position.y + b._size.y) - return false; - if (_position.y + _size.y <= b._position.y) - return false; - } + if (_position.x >= b._position.x + b._size.x) + return false; + if (_position.x + _size.x <= b._position.x) + return false; + if (_position.y >= b._position.y + b._size.y) + return false; + if (_position.y + _size.y <= b._position.y) + return false; return true; } -- cgit v1.2.3