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

Objects overlapping after collision #1068

Closed
PiotrSzlagura opened this issue Dec 8, 2021 · 2 comments
Closed

Objects overlapping after collision #1068

PiotrSzlagura opened this issue Dec 8, 2021 · 2 comments

Comments

@PiotrSzlagura
Copy link

PiotrSzlagura commented Dec 8, 2021

Hi, I have a problem where one body overlaps with another after collision:
Zrzut ekranu 2021-12-8 o 20 40 33

The wheel falls on the ground (flat line below) due to gravity, below are lines of code which are used to create both bodies:

let wheel = Matter.Bodies.circle(400, 200, 50);
let floor = Matter.Bodies.rectangle(1680 / 2, 670 - 1, 1680, 1, { isStatic: true, name: "floor" });

Could anyone tell me what am I doing wrong?

EDIT:
An idea came to my head while I was writing this description, and the solution turned out to be increasing height of the floor body (before it had 1 height as you can see above). For anyone having the same problem in future, try this solution :)

But still, is there any way to prevent such behaviour when we deal with very thin objects?

@liabru
Copy link
Owner

liabru commented Dec 20, 2021

Unfortunately very thin objects like this will cause problems so you should increase the thickness until it becomes stable (see #5). If you'd like them to appear thinner though, then try doing that during rendering instead.

@PiotrSzlagura
Copy link
Author

Yeah, it seems to be this case exactly :) when I was starting this thread I didn't even realise that I'm in a wireframe mode, in regular rendering mode it seems that I can do whatever I want :)

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

No branches or pull requests

2 participants