summaryrefslogtreecommitdiff
path: root/2d/rigidbody/rigidbody_3
diff options
context:
space:
mode:
Diffstat (limited to '2d/rigidbody/rigidbody_3')
-rwxr-xr-x2d/rigidbody/rigidbody_3/dist/output.wasmbin49458 -> 49653 bytes
-rw-r--r--2d/rigidbody/rigidbody_3/main.cpp2
2 files changed, 1 insertions, 1 deletions
diff --git a/2d/rigidbody/rigidbody_3/dist/output.wasm b/2d/rigidbody/rigidbody_3/dist/output.wasm
index b89435a..0a8a974 100755
--- a/2d/rigidbody/rigidbody_3/dist/output.wasm
+++ b/2d/rigidbody/rigidbody_3/dist/output.wasm
Binary files differ
diff --git a/2d/rigidbody/rigidbody_3/main.cpp b/2d/rigidbody/rigidbody_3/main.cpp
index e34f444..2a0af24 100644
--- a/2d/rigidbody/rigidbody_3/main.cpp
+++ b/2d/rigidbody/rigidbody_3/main.cpp
@@ -72,7 +72,7 @@ struct Rigidbody {
float32 impulseDtSeconds = nextTimeAppliedSeconds - i.timeAppliedSeconds;
Vector2 forceToApply = i.force * (impulseDtSeconds / i.timeOfApplicationSeconds);
- force += forceToApply * impulseDtSeconds;
+ force += forceToApply;
torque += i.pointOfApplication.getPerp().dot(forceToApply);
i.timeAppliedSeconds = nextTimeAppliedSeconds;