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

Major fixes #113

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Major fixes #113

wants to merge 3 commits into from

Conversation

Manamongods
Copy link

@Manamongods Manamongods commented Aug 31, 2021

  • Several major fixes to BeginContact and EndContact
  • Makes fixture<->particle collision distance use radius instead of diameter, and if the extra distance was intentional, the setting b2_fixtureParticleCollisionRadiusScaler gives control over this instead of it being a constant 2.
  • Makes b2ParticleSystem forces clear in b2World::ClearForces(), the same way that b2Body forces are cleared. This fixes forces from being applied at only the first particleIteration.
  • SolveCollision and SolveBarrier relied on (delayed) forces to be cleared immediately, in order to generate the contacts they desire, so I added m_impulseBuffer for them to use, which clears immediately.
  • Fixes elastic directional bias. I believe that this bias was more noticeable with smaller time steps.

@google-cla
Copy link

google-cla bot commented Aug 31, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

- Several fixes to BeginContact and EndContact
- Makes fixture<->particle collision distance use radius instead of diameter
- Makes b2ParticleSystem forces clear in b2World::ClearForces()
- Fixes elastic directional bias
SolveCollision and SolveBarrier needed forces to clear differently than how b2World clears forces, so when I fixed the way particle forces cleared, it broke SolveCollision and SolveBarrier. This adds the m_impulseBuffer, which clears immediately, which is what SolveCollision and SolveBarrier now use.
This makes the distance correctly calculated when it comes to corners.
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.

1 participant