From c462430faa39c68edfc28446260c86ec100e3424 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 25 Nov 2022 21:38:42 +0200 Subject: [PATCH] Use the correct inertial quantity for calculating velocity change --- examples/bassteroids/source/physics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bassteroids/source/physics.cpp b/examples/bassteroids/source/physics.cpp index 21c8bd4..612a3ec 100644 --- a/examples/bassteroids/source/physics.cpp +++ b/examples/bassteroids/source/physics.cpp @@ -194,7 +194,7 @@ void Physics::apply_impulses() float friction = min(reaction*friction_coeff, v_tan/inv_mass_sum); LinAl::Vector impulse = c.normal*reaction+tangent*friction; entity1.velocity += impulse*entity1.inverse_mass; - entity2.velocity -= impulse*entity2.inverse_momi; + entity2.velocity -= impulse*entity2.inverse_mass; entity1.angular_velocity += Geometry::Angle::from_radians(entity1.inverse_momi*(r1.x*impulse.y-r1.y*impulse.x)); entity2.angular_velocity -= Geometry::Angle::from_radians(entity2.inverse_momi*(r2.x*impulse.y-r2.y*impulse.x)); } -- 2.45.2