| 1 |
From cd898904b72a300011fbb24d578620bafa08ef2c Mon Sep 17 00:00:00 2001 |
| 2 |
From: Gamemechanic <[email protected]> |
| 3 |
Date: Mon, 4 Sep 2023 16:53:41 +0200 |
| 4 |
Subject: [PATCH 12/36] Minor refactor in RecastMesh.cpp (#661) |
| 5 |
|
| 6 |
--- |
| 7 |
Recast/Source/RecastMesh.cpp | 13 +++++++------ |
| 8 |
1 file changed, 7 insertions(+), 6 deletions(-) |
| 9 |
|
| 10 |
diff --git a/Recast/Source/RecastMesh.cpp b/Recast/Source/RecastMesh.cpp |
| 11 |
index 390088c..c9eb60a 100644 |
| 12 |
--- a/Recast/Source/RecastMesh.cpp |
| 13 |
+++ b/Recast/Source/RecastMesh.cpp |
| 14 |
@@ -216,8 +216,8 @@ static bool between(const int* a, const int* b, const int* c) |
| 15 |
// If ab not vertical, check betweenness on x; else on y. |
| 16 |
if (a[0] != b[0]) |
| 17 |
return ((a[0] <= c[0]) && (c[0] <= b[0])) || ((a[0] >= c[0]) && (c[0] >= b[0])); |
| 18 |
- else |
| 19 |
- return ((a[2] <= c[2]) && (c[2] <= b[2])) || ((a[2] >= c[2]) && (c[2] >= b[2])); |
| 20 |
+ |
| 21 |
+ return ((a[2] <= c[2]) && (c[2] <= b[2])) || ((a[2] >= c[2]) && (c[2] >= b[2])); |
| 22 |
} |
| 23 |
|
| 24 |
// Returns true iff segments ab and cd intersect, properly or improperly. |
| 25 |
@@ -225,11 +225,12 @@ static bool intersect(const int* a, const int* b, const int* c, const int* d) |
| 26 |
{ |
| 27 |
if (intersectProp(a, b, c, d)) |
| 28 |
return true; |
| 29 |
- else if (between(a, b, c) || between(a, b, d) || |
| 30 |
- between(c, d, a) || between(c, d, b)) |
| 31 |
+ |
| 32 |
+ if (between(a, b, c) || between(a, b, d) || |
| 33 |
+ between(c, d, a) || between(c, d, b)) |
| 34 |
return true; |
| 35 |
- else |
| 36 |
- return false; |
| 37 |
+ |
| 38 |
+ return false; |
| 39 |
} |
| 40 |
|
| 41 |
static bool vequal(const int* a, const int* b) |
| 42 |
-- |
| 43 |
2.43.0 |
| 44 |
|