From 94721f5ab8af9e7d91a4de58baf2c8d849ceab6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 10 May 2020 16:47:11 +0200 Subject: Revert "Renamed plane's d to distance" This reverts commit ec7b481170dcd6a7b4cf0e6c1221e204ff7945f3. This was wrong, `d` is not a distance but the `d` constant in the parametric equation `ax + by + cz = d` describing the plane. --- core/math/geometry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/math/geometry.cpp') diff --git a/core/math/geometry.cpp b/core/math/geometry.cpp index 95789f97ea..e556eb3b9c 100644 --- a/core/math/geometry.cpp +++ b/core/math/geometry.cpp @@ -781,7 +781,7 @@ Geometry::MeshData Geometry::build_convex_mesh(const Vector &p_planes) { if (Math::is_zero_approx(den)) continue; // Point too short. - real_t dist = -(clip.normal.dot(edge0_A) - clip.distance) / den; + real_t dist = -(clip.normal.dot(edge0_A) - clip.d) / den; Vector3 inters = edge0_A + rel * dist; new_vertices.push_back(inters); } @@ -1224,7 +1224,7 @@ Vector Geometry::compute_convex_mesh_points(const Plane *p_planes, int for (int n = 0; n < p_plane_count; n++) { if (n != i && n != j && n != k) { real_t dp = p_planes[n].normal.dot(convex_shape_point); - if (dp - p_planes[n].distance > CMP_EPSILON) { + if (dp - p_planes[n].d > CMP_EPSILON) { excluded = true; break; } -- cgit v1.2.3