Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #266 #267

Merged
merged 2 commits into from
Dec 20, 2023
Merged

Fix #266 #267

merged 2 commits into from
Dec 20, 2023

Conversation

zOadT
Copy link
Collaborator

@zOadT zOadT commented Dec 17, 2023

This PR is split in 2 commits:

  • The first one is the actual change needed for World step error #266
  • The second one is about me getting too paranoid because of World step error #266. So feel free to discard it. Wanted to at least suggest it but in hindsight it seems unnecessary.

Note: #255 also often made use of the (mathematically correct) assumption that (A - B) . C == A . C - B . C. Technically this also changes the order of additions, but I guess this is probably fine.

Copy link
Collaborator

@shakiba shakiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

Just try it in the benchmark to make sure it doesn’t have unexpected impact on performance

@zOadT
Copy link
Collaborator Author

zOadT commented Dec 20, 2023

Good point! Ran 3x PR commit consecutively, 3x master commit consecutively and repeated this 3 times. Everything seems fine 👍

    fix: use combine operator order from box2d
Running Benchmarks:
 ✓ planck.js (current)

Results:
| Name                | avg ms/frame |           5th %ile |         95th %ile  | Ratio |
| ------------------- | ------------ | ------------------ | -----------------  | ----- |
| planck.js (current) |        12.94 | 11.798041999340057 | 14.33016699925065  |  1.00 |
| planck.js (current) |        13.01 | 11.887500001117587 | 14.298832999542356 |  1.00 |
| planck.js (current) |        13.18 | 12.029790999367833 | 14.547833999618888 |  1.00 |
| planck.js (current) |        12.83 | 11.65612499974668  | 14.266707999631763 |  1.00 |
| planck.js (current) |        13.22 | 12.081416999921203 | 14.534709000959992 |  1.00 |
| planck.js (current) |        13.02 | 11.900624999776483 | 14.34375           |  1.00 |
| planck.js (current) |        13.22 | 12.049542000517249 | 14.55120899900794  |  1.00 |
| planck.js (current) |        13.13 | 11.960750000551343 | 14.503916000947356 |  1.00 |
| planck.js (current) |        12.83 | 11.659291999414563 | 14.188333000987768 |  1.00 |


    fix setMassData
Running Benchmarks:
 ✓ planck.js (current)

Results:
| Name                | avg ms/frame |           5th %ile |          95th %ile | Ratio |
| ------------------- | ------------ | ------------------ | ------------------ | ----- |
| planck.js (current) |        13.54 | 12.306792000308633 | 14.869791999459267 |  1.00 |
| planck.js (current) |        13.14 | 11.965250000357628 | 14.521833000704646 |  1.00 |
| planck.js (current) |        12.92 | 11.742500001564622 | 14.336292000487447 |  1.00 |
| planck.js (current) |        13.09 | 11.844208000227809 | 14.573958000168204 |  1.00 |
| planck.js (current) |        12.92 | 11.737958000972867 | 14.373540999367833 |  1.00 |
| planck.js (current) |        12.91 | 11.786875000223517 | 14.235790999606252 |  1.00 |
| planck.js (current) |        12.92 | 11.671540999785066 | 14.627749999985099 |  1.00 |
| planck.js (current) |        13.63 | 12.491916000843048 | 14.934125000610948 |  1.00 |
| planck.js (current) |        13.32 | 12.188791001215577 | 14.714042000472546 |  1.00 |

@zOadT zOadT merged commit 80803cb into master Dec 20, 2023
1 check passed
@zOadT zOadT deleted the combine3Vec2 branch December 20, 2023 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants