summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-05-16 23:16:43 +0200
committerGitHub <noreply@github.com>2018-05-16 23:16:43 +0200
commit97b1e8b5175478d1f09f72aa72f6d98b655f56a4 (patch)
treea1a8338ad45b40ca38da80892217e232f00458f0 /servers
parenta404ceb1284e1e366750cb678ab7f73f4cdc5ac3 (diff)
parentb68222e4e75d6cbe23c533f140733248df046c7e (diff)
Merge pull request #18868 from bruvzg/clang_6_workaround
Workaround for clang 6.0.0 / Xcode 9.3 release (-O3) build bug.
Diffstat (limited to 'servers')
-rw-r--r--servers/physics/collision_solver_sat.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/servers/physics/collision_solver_sat.cpp b/servers/physics/collision_solver_sat.cpp
index eefb0f0396..e587485fcb 100644
--- a/servers/physics/collision_solver_sat.cpp
+++ b/servers/physics/collision_solver_sat.cpp
@@ -341,26 +341,26 @@ public:
min_B -= (max_A - min_A) * 0.5;
max_B += (max_A - min_A) * 0.5;
- real_t dmin = min_B - (min_A + max_A) * 0.5;
- real_t dmax = max_B - (min_A + max_A) * 0.5;
+ min_B -= (min_A + max_A) * 0.5;
+ max_B -= (min_A + max_A) * 0.5;
- if (dmin > 0.0 || dmax < 0.0) {
+ if (min_B > 0.0 || max_B < 0.0) {
separator_axis = axis;
return false; // doesn't contain 0
}
//use the smallest depth
- dmin = Math::abs(dmin);
+ min_B = -min_B;
- if (dmax < dmin) {
- if (dmax < best_depth) {
- best_depth = dmax;
+ if (max_B < min_B) {
+ if (max_B < best_depth) {
+ best_depth = max_B;
best_axis = axis;
}
} else {
- if (dmin < best_depth) {
- best_depth = dmin;
+ if (min_B < best_depth) {
+ best_depth = min_B;
best_axis = -axis; // keep it as A axis
}
}