From 32965aa0ab134426a50a6923857ae471f36548a0 Mon Sep 17 00:00:00 2001 From: LoipesMas <46327403+LoipesMas@users.noreply.github.com> Date: Mon, 16 Aug 2021 20:11:46 +0200 Subject: [PATCH] Epsilon check for angular velocity in BodySW --- servers/physics/body_sw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp index 99da0fe0622..e6ecd4b66e0 100644 --- a/servers/physics/body_sw.cpp +++ b/servers/physics/body_sw.cpp @@ -614,7 +614,7 @@ void BodySW::integrate_velocities(real_t p_step) { real_t ang_vel = total_angular_velocity.length(); Transform transform = get_transform(); - if (ang_vel != 0.0) { + if (!Math::is_zero_approx(ang_vel)) { Vector3 ang_vel_axis = total_angular_velocity / ang_vel; Basis rot(ang_vel_axis, ang_vel * p_step); Basis identity3(1, 0, 0, 0, 1, 0, 0, 0, 1);