From 05c4522e5ff424c65aab7cd36c7a15313630ac61 Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Sun, 25 Jul 2021 20:20:10 -0400 Subject: (mkosarek) Fix for wrong timestep --- 2d/rigidbody/rigidbody_1.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '2d/rigidbody/rigidbody_1.html') diff --git a/2d/rigidbody/rigidbody_1.html b/2d/rigidbody/rigidbody_1.html index b98d292..0d50904 100644 --- a/2d/rigidbody/rigidbody_1.html +++ b/2d/rigidbody/rigidbody_1.html @@ -200,7 +200,7 @@ // to calculate the fractional amount of force that was applied in this frame. float32 impulseDtSeconds = nextTimeAppliedSeconds - i.timeAppliedSeconds; Vector2 forceToApply = i.force * (impulseDtSeconds / i.timeOfApplicationSeconds); - force += forceToApply * impulseDtSeconds; + force += forceToApply; i.timeAppliedSeconds = nextTimeAppliedSeconds; } -- cgit v1.2.1