summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-08-16 20:41:35 +0200
committerGitHub <noreply@github.com>2021-08-16 20:41:35 +0200
commit84b11fbaa674b6e2341de534e93a981378a307ad (patch)
treeb8220660d1bfc524a15b2f332cd9e84dadd49a10
parentd5a30431b9a5960887055315dd9720869017d330 (diff)
parent4e6e25eae70e16e1c777fb40075465ffc5f2b9ee (diff)
Merge pull request #51748 from LoipesMas/master
Epsilon check for angular velocity in Body3DSW
-rw-r--r--servers/physics_3d/body_3d_sw.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/servers/physics_3d/body_3d_sw.cpp b/servers/physics_3d/body_3d_sw.cpp
index ea6064cb4c..0c4079332d 100644
--- a/servers/physics_3d/body_3d_sw.cpp
+++ b/servers/physics_3d/body_3d_sw.cpp
@@ -578,7 +578,7 @@ void Body3DSW::integrate_velocities(real_t p_step) {
real_t ang_vel = total_angular_velocity.length();
Transform3D 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);