From 0205eef96bbdc59c4a52c8323f9a39c717543bec Mon Sep 17 00:00:00 2001 From: TwistedTwigleg Date: Fri, 28 Aug 2020 14:16:12 -0400 Subject: [PATCH] Fixed 2D physics regression that causes RigidBody2D nodes to spin uncontrollably when colliding --- servers/physics_2d/body_pair_2d_sw.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/servers/physics_2d/body_pair_2d_sw.cpp b/servers/physics_2d/body_pair_2d_sw.cpp index 59979594329..2021aab17c1 100644 --- a/servers/physics_2d/body_pair_2d_sw.cpp +++ b/servers/physics_2d/body_pair_2d_sw.cpp @@ -478,8 +478,8 @@ void BodyPair2DSW::solve(real_t p_step) { Vector2 jb = c.normal * (c.acc_bias_impulse - jbnOld); - A->apply_bias_impulse(c.rA, -jb); - B->apply_bias_impulse(c.rB, jb); + A->apply_bias_impulse(-jb, c.rA); + B->apply_bias_impulse(jb, c.rB); real_t jn = -(c.bounce + vn) * c.mass_normal; real_t jnOld = c.acc_normal_impulse;