summaryrefslogtreecommitdiffstats
path: root/core/math/convex_hull.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-12-06 14:01:45 +0100
committerGitHub <noreply@github.com>2021-12-06 14:01:45 +0100
commit5baf20e638a7a5ca140208f961c0b65a61c33734 (patch)
treea7596e98ea273c11e27a0422df036dd2dfd42df3 /core/math/convex_hull.cpp
parent608c9f820349ca13f017ea406c790d90729da837 (diff)
parent24f57886d087d78eb8dcf7be28d790cddadf2c99 (diff)
downloadredot-engine-5baf20e638a7a5ca140208f961c0b65a61c33734.tar.gz
Merge pull request #34005 from aaronfranke/minmax
Diffstat (limited to 'core/math/convex_hull.cpp')
-rw-r--r--core/math/convex_hull.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/math/convex_hull.cpp b/core/math/convex_hull.cpp
index 2956e0cf09..6f551319df 100644
--- a/core/math/convex_hull.cpp
+++ b/core/math/convex_hull.cpp
@@ -606,9 +606,9 @@ private:
PagedAllocator<Face> face_pool;
LocalVector<Vertex *> original_vertices;
int32_t merge_stamp = 0;
- int32_t min_axis = 0;
- int32_t med_axis = 0;
- int32_t max_axis = 0;
+ Vector3::Axis min_axis = Vector3::Axis::AXIS_X;
+ Vector3::Axis med_axis = Vector3::Axis::AXIS_X;
+ Vector3::Axis max_axis = Vector3::Axis::AXIS_X;
int32_t used_edge_pairs = 0;
int32_t max_used_edge_pairs = 0;
@@ -1585,12 +1585,12 @@ void ConvexHullInternal::compute(const Vector3 *p_coords, int32_t p_count) {
}
Vector3 s = aabb.size;
- max_axis = s.max_axis();
- min_axis = s.min_axis();
+ max_axis = s.max_axis_index();
+ min_axis = s.min_axis_index();
if (min_axis == max_axis) {
- min_axis = (max_axis + 1) % 3;
+ min_axis = Vector3::Axis((max_axis + 1) % 3);
}
- med_axis = 3 - max_axis - min_axis;
+ med_axis = Vector3::Axis(3 - max_axis - min_axis);
s /= real_t(10216);
if (((med_axis + 1) % 3) != max_axis) {