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

Sweep Advance getting called on Non-Dynamic bodies #149

Open
2chivi opened this issue Oct 12, 2020 · 0 comments
Open

Sweep Advance getting called on Non-Dynamic bodies #149

2chivi opened this issue Oct 12, 2020 · 0 comments

Comments

@2chivi
Copy link

2chivi commented Oct 12, 2020

This pertains to this function in planck.js: Solver.prototype.solveWorldTOI

I've spent that past few days hunting down a rare desync bug with my multiplayer game. I isolated the problem to my static terrain bodies being very slightly altered by dynamic bodies. By very slightly, I mean m_sweep being altered by very small float rounding errors. But eventually they compound and cause desync issues.

These small rounding errors are caused because Body.prototype.advance or Sweep.prototype.advance getting called on Static objects in Solver.prototype.solveWorldTOI. I don't believe there is a reason for sweep advance to get called on Static objects? I might be wrong. I'm not* super familiar with how this engines works.

I'm not sure I could write a good demo to show off the problem.. but I figured I would altease raise the issue. I've been able to solve the issue by putting !isStatic() checks before each sweep.advance call in Solver.prototype.solveWorldTOI.

(I've never done a bug fix pr, trying to figure it out)

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

No branches or pull requests

1 participant