From 9f699f589ad1a97ad0bd3f26e57de5ceba1f724c Mon Sep 17 00:00:00 2001 From: Dragos Daian Date: Mon, 5 Aug 2024 17:37:50 +0200 Subject: [PATCH] Fix static body constant velocity to not cumulate (#183) --- src/bodies/rapier_body.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/bodies/rapier_body.rs b/src/bodies/rapier_body.rs index e2a13ca9..728f0b9b 100644 --- a/src/bodies/rapier_body.rs +++ b/src/bodies/rapier_body.rs @@ -1174,17 +1174,11 @@ impl RapierBody { space.body_add_to_state_query_list(self.base.get_rid()); if self.base.mode.ord() >= BodyMode::RIGID.ord() { if self.to_add_angular_velocity != ANGLE_ZERO { - self.set_angular_velocity( - self.get_angular_velocity(physics_engine) + self.to_add_angular_velocity, - physics_engine, - ); + self.set_angular_velocity(self.to_add_angular_velocity, physics_engine); self.to_add_angular_velocity = ANGLE_ZERO; } if self.to_add_linear_velocity != Vector::default() { - self.set_linear_velocity( - self.get_linear_velocity(physics_engine) + self.to_add_linear_velocity, - physics_engine, - ); + self.set_linear_velocity(self.to_add_linear_velocity, physics_engine); self.to_add_linear_velocity = Vector::default(); } }