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

How can I stop clipping? #951

Closed
miyucomics opened this issue Jan 11, 2021 · 2 comments
Closed

How can I stop clipping? #951

miyucomics opened this issue Jan 11, 2021 · 2 comments
Labels

Comments

@miyucomics
Copy link

How can I stop my bodies from squishing/clipping into each other like here?

It occurs most often when an object is travelling at high speeds or a lot of objects are falling onto each other.

@bouraqadi
Copy link

It seems like this related to issue #5

@liabru
Copy link
Owner

liabru commented Jan 18, 2021

To prevent the bodies overlapping you can try some or all of these approaches:

  • increase engine.positionIterations and engine.velocityIterations
  • use a fixed timestep for Engine.update (you can do this in Matter.Runner options too)
  • use a smaller timestep and multiple iterations of Engine.update per-step
  • keep mass values in a tighter range

As for issues with high speed collisions, as @bouraqadi mentioned please refer to discussion in #5 which presents some ways to avoid this until CCD is completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants