diff options
author | Matthew Kosarek <mattkae@protonmail.com> | 2021-07-25 20:20:10 -0400 |
---|---|---|
committer | Matthew Kosarek <mattkae@protonmail.com> | 2021-07-25 20:20:10 -0400 |
commit | 05c4522e5ff424c65aab7cd36c7a15313630ac61 (patch) | |
tree | 4b1f5310029728d46fe3464a500400a2e89fbf13 /2d/rigidbody/rigidbody_3 | |
parent | 26d073d768c1a0560fa4358246acd1e308eff7b6 (diff) |
(mkosarek) Fix for wrong timestep
Diffstat (limited to '2d/rigidbody/rigidbody_3')
-rwxr-xr-x | 2d/rigidbody/rigidbody_3/dist/output.wasm | bin | 49458 -> 49653 bytes | |||
-rw-r--r-- | 2d/rigidbody/rigidbody_3/main.cpp | 2 |
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 Binary files differindex b89435a..0a8a974 100755 --- a/2d/rigidbody/rigidbody_3/dist/output.wasm +++ b/2d/rigidbody/rigidbody_3/dist/output.wasm 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; |