You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-25 15:37:42 +00:00
committed by
Hein-Pieter van Braam
parent
5c6c88ef15
commit
d3c4f91c9c
@@ -341,26 +341,28 @@ public:
|
|||||||
min_B -= (max_A - min_A) * 0.5;
|
min_B -= (max_A - min_A) * 0.5;
|
||||||
max_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;
|
min_B -= (min_A + max_A) * 0.5;
|
||||||
real_t dmax = max_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;
|
separator_axis = axis;
|
||||||
return false; // doesn't contain 0
|
return false; // doesn't contain 0
|
||||||
}
|
}
|
||||||
|
|
||||||
//use the smallest depth
|
//use the smallest depth
|
||||||
|
|
||||||
dmin = Math::abs(dmin);
|
if (min_B < 0.0) {
|
||||||
|
min_B = -min_B;
|
||||||
|
}
|
||||||
|
|
||||||
if (dmax < dmin) {
|
if (max_B < min_B) {
|
||||||
if (dmax < best_depth) {
|
if (max_B < best_depth) {
|
||||||
best_depth = dmax;
|
best_depth = max_B;
|
||||||
best_axis = axis;
|
best_axis = axis;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (dmin < best_depth) {
|
if (min_B < best_depth) {
|
||||||
best_depth = dmin;
|
best_depth = min_B;
|
||||||
best_axis = -axis; // keep it as A axis
|
best_axis = -axis; // keep it as A axis
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user