GameDevTecnico / cubos

A still very barebones game engine focused on voxels and data-oriented programming
https://cubosengine.org
MIT License
83 stars 36 forks source link

Add friction and restitution on penetration constraint solving #1277

Closed fallenatlas closed 2 months ago

fallenatlas commented 3 months ago

Description

Note: I couldn't find how to apply restitution using accumulated impulses anywhere, which is ridiculous, so the implementation I have is based only on how Erin Catto does it in Box2D v3.0, which he says it's not the most accurate but it seems to work pretty well.

Checklist

github-actions[bot] commented 3 months ago

PR Preview Action v1.4.7 :---: :rocket: Deployed preview to https://GameDevTecnico.github.io/cubos/preview/pr-1277/ on branch gh-pages at 2024-07-22 23:05 UTC

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 0% with 94 lines in your changes missing coverage. Please review.

Project coverage is 36.19%. Comparing base (071ab63) to head (9fb7ea3).

Files Patch % Lines
...c/physics/solver/penetration_constraint/plugin.cpp 0.00% 87 Missing :warning:
...src/physics/constraints/penetration_constraint.cpp 0.00% 7 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1277 +/- ## ========================================== - Coverage 36.27% 36.19% -0.08% ========================================== Files 376 376 Lines 30851 30916 +65 ========================================== Hits 11191 11191 - Misses 19660 19725 +65 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

luishfonseca commented 3 months ago

@fallenatlas please share your resources for the physics engine to ease reviewing. The math looks right, but i don't know if I'd catch errors without a reference