summaryrefslogtreecommitdiff
path: root/editor/node_3d_editor_gizmos.cpp
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2021-07-16 13:19:55 -0400
committerAaron Franke <arnfranke@yahoo.com>2021-07-21 00:32:37 -0400
commit78b0a7da0398dc8c6447b1439a6d07059311c028 (patch)
tree662e06b568e52c1942a95e0dcff5eff72ede0009 /editor/node_3d_editor_gizmos.cpp
parente248d2629ab9cb1dcfa91af5202af4f17754e44f (diff)
Use is_equal_approx in more places
Diffstat (limited to 'editor/node_3d_editor_gizmos.cpp')
-rw-r--r--editor/node_3d_editor_gizmos.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/node_3d_editor_gizmos.cpp b/editor/node_3d_editor_gizmos.cpp
index 2e85e19732..74fb38b66b 100644
--- a/editor/node_3d_editor_gizmos.cpp
+++ b/editor/node_3d_editor_gizmos.cpp
@@ -562,7 +562,7 @@ bool EditorNode3DGizmo::intersect_ray(Camera3D *p_camera, const Point2 &p_point,
if (selectable_icon_size > 0.0f) {
Transform3D t = spatial_node->get_global_transform();
Vector3 camera_position = p_camera->get_camera_transform().origin;
- if (camera_position.distance_squared_to(t.origin) > 0.01) {
+ if (!camera_position.is_equal_approx(t.origin)) {
t.set_look_at(t.origin, camera_position);
}
@@ -578,7 +578,7 @@ bool EditorNode3DGizmo::intersect_ray(Camera3D *p_camera, const Point2 &p_point,
Transform3D orig_camera_transform = p_camera->get_camera_transform();
- if (orig_camera_transform.origin.distance_squared_to(t.origin) > 0.01 &&
+ if (!orig_camera_transform.origin.is_equal_approx(t.origin) &&
ABS(orig_camera_transform.basis.get_axis(Vector3::AXIS_Z).dot(Vector3(0, 1, 0))) < 0.99) {
p_camera->look_at(t.origin);
}