diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-10 16:47:11 +0200 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-10 16:47:11 +0200 |
| commit | 94721f5ab8af9e7d91a4de58baf2c8d849ceab6e (patch) | |
| tree | 92fb34d709310b76de1c2d45cfe2aad8db7a523a /core/math/geometry.cpp | |
| parent | 6ab92464bc6356f3342c3efd1fc1bb1a5e4467d5 (diff) | |
| download | redot-engine-94721f5ab8af9e7d91a4de58baf2c8d849ceab6e.tar.gz | |
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.
Diffstat (limited to 'core/math/geometry.cpp')
| -rw-r--r-- | core/math/geometry.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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<Plane> &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<Vector3> 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; } |
