summaryrefslogtreecommitdiffstats
path: root/core/math/plane.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-06-14 18:49:38 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-06-14 18:49:38 +0200
commiteeb7f48203872b20bf0c588333ac851fa3fdca73 (patch)
tree431c7cad0738d660793e0f4a703c7fe56dd24621 /core/math/plane.cpp
parent01453ab7f3e6940ecd611d63d675a484b2f55cb4 (diff)
parent77b8e0fcb7cfcdabed7e7217caedf69c049c7a3e (diff)
downloadredot-engine-eeb7f48203872b20bf0c588333ac851fa3fdca73.tar.gz
Merge pull request #77236 from kleonc/world_boundary_2d_allow_negative_distance
Allow setting negative `WorldBoundaryShape2D.distance` through the editor
Diffstat (limited to 'core/math/plane.cpp')
-rw-r--r--core/math/plane.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/core/math/plane.cpp b/core/math/plane.cpp
index 99694d7871..6b9bcea081 100644
--- a/core/math/plane.cpp
+++ b/core/math/plane.cpp
@@ -98,13 +98,11 @@ bool Plane::intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3
Vector3 segment = p_dir;
real_t den = normal.dot(segment);
- //printf("den is %i\n",den);
if (Math::is_zero_approx(den)) {
return false;
}
real_t dist = (normal.dot(p_from) - d) / den;
- //printf("dist is %i\n",dist);
if (dist > (real_t)CMP_EPSILON) { //this is a ray, before the emitting pos (p_from) doesn't exist
@@ -121,13 +119,11 @@ bool Plane::intersects_segment(const Vector3 &p_begin, const Vector3 &p_end, Vec
Vector3 segment = p_begin - p_end;
real_t den = normal.dot(segment);
- //printf("den is %i\n",den);
if (Math::is_zero_approx(den)) {
return false;
}
real_t dist = (normal.dot(p_begin) - d) / den;
- //printf("dist is %i\n",dist);
if (dist < (real_t)-CMP_EPSILON || dist > (1.0f + (real_t)CMP_EPSILON)) {
return false;