diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/lightmap_gi.cpp | 2 | ||||
-rw-r--r-- | scene/3d/voxelizer.cpp | 6 | ||||
-rw-r--r-- | scene/animation/animation_blend_space_2d.cpp | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/scene/3d/lightmap_gi.cpp b/scene/3d/lightmap_gi.cpp index 66e3535fc4..3ffb3c0393 100644 --- a/scene/3d/lightmap_gi.cpp +++ b/scene/3d/lightmap_gi.cpp @@ -599,7 +599,7 @@ void LightmapGI::_gen_new_positions_from_octree(const GenProbesOctree *p_cell, f const Vector3 *pp = probe_positions.ptr(); bool exists = false; for (int j = 0; j < ppcount; j++) { - if (pp[j].distance_to(real_pos) < CMP_EPSILON) { + if (pp[j].is_equal_approx(real_pos)) { exists = true; break; } diff --git a/scene/3d/voxelizer.cpp b/scene/3d/voxelizer.cpp index 12f055c01d..f1b9708f91 100644 --- a/scene/3d/voxelizer.cpp +++ b/scene/3d/voxelizer.cpp @@ -36,17 +36,17 @@ #include <stdlib.h> static _FORCE_INLINE_ void get_uv_and_normal(const Vector3 &p_pos, const Vector3 *p_vtx, const Vector2 *p_uv, const Vector3 *p_normal, Vector2 &r_uv, Vector3 &r_normal) { - if (p_pos.distance_squared_to(p_vtx[0]) < CMP_EPSILON2) { + if (p_pos.is_equal_approx(p_vtx[0])) { r_uv = p_uv[0]; r_normal = p_normal[0]; return; } - if (p_pos.distance_squared_to(p_vtx[1]) < CMP_EPSILON2) { + if (p_pos.is_equal_approx(p_vtx[1])) { r_uv = p_uv[1]; r_normal = p_normal[1]; return; } - if (p_pos.distance_squared_to(p_vtx[2]) < CMP_EPSILON2) { + if (p_pos.is_equal_approx(p_vtx[2])) { r_uv = p_uv[2]; r_normal = p_normal[2]; return; diff --git a/scene/animation/animation_blend_space_2d.cpp b/scene/animation/animation_blend_space_2d.cpp index 6878cbaa12..d88a9badf4 100644 --- a/scene/animation/animation_blend_space_2d.cpp +++ b/scene/animation/animation_blend_space_2d.cpp @@ -387,19 +387,19 @@ Vector2 AnimationNodeBlendSpace2D::get_closest_point(const Vector2 &p_point) { } void AnimationNodeBlendSpace2D::_blend_triangle(const Vector2 &p_pos, const Vector2 *p_points, float *r_weights) { - if (p_pos.distance_squared_to(p_points[0]) < CMP_EPSILON2) { + if (p_pos.is_equal_approx(p_points[0])) { r_weights[0] = 1; r_weights[1] = 0; r_weights[2] = 0; return; } - if (p_pos.distance_squared_to(p_points[1]) < CMP_EPSILON2) { + if (p_pos.is_equal_approx(p_points[1])) { r_weights[0] = 0; r_weights[1] = 1; r_weights[2] = 0; return; } - if (p_pos.distance_squared_to(p_points[2]) < CMP_EPSILON2) { + if (p_pos.is_equal_approx(p_points[2])) { r_weights[0] = 0; r_weights[1] = 0; r_weights[2] = 1; |