From: Mikko Rasa Date: Fri, 25 Nov 2022 19:38:42 +0000 (+0200) Subject: Use the correct inertial quantity for calculating velocity change X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=c462430faa39c68edfc28446260c86ec100e3424;p=libs%2Fgame.git Use the correct inertial quantity for calculating velocity change --- 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)); }