Matter-js: Major tunneling between bodies

Created on 29 Oct 2016  路  10Comments  路  Source: liabru/matter-js

This is a big issue, and probably the last one I'm creating here, mainly because it's the reason I'm not using this engine. I've spent a lot of time designing a game using it, and now that the core is done I've noticed a big problem regarding bodies passing through other bodies:

A dynamic rectangular body falls between two static rectangular bodies side by side and tunnels through them

There's no space between those static bodies. Inertia is set to Infinity. No chamfering.

Don't get me wrong; I really appreciate the effort you've done here, and I know it makes no difference to you if I'm going to use it or not. I just wanted to express my frustration because I'm going to be forced to go back to box2d and it's terrible javascript API again.

Unrelated: The documentation API has gone offline this week so it might be a good idea to include a copy of it in this repository, just like EaselJS does.

bug investigate

Most helpful comment

I've been looking at it recently and I think I know where the issue lies, hope to solve it soon.

All 10 comments

See #5 and the CCD implementation currently in the ccd branch. You can try it out using this build and here is an example of how to enable CCD. It's still needs some more testing, but hopefully it should help here. Tell me if you have any luck with it.

That said, looking at your example, it seems like there is a bug as I wouldn't expect tunnelling to happen in that situation even without CCD. Would you be able to share some code so I can check it out?

The documentation API has gone offline this week so it might be a good idea to include a copy of it in this repository, just like EaselJS does.

Sorry about this! I had some DNS issues which have been since resolved, the docs should be back. Though I'm definitely considering hosting the docs on Github Pages in future, so watch this space.

Thanks for logging this!

I was expecting you to suggest CCD, but it turns out that this bug persists even when using the CCD build, it just gets a little bit less frequent. :(

I wrote a minimal example in this fiddle (using the CCD build) reproducing the issue (if it goes right the first time click Run again). Note that it's not difficult to trigger the bug. Almost any situation where a dynamic rectangle falls between two static side-by-side rectangles will cause the dynamic body to tunnel through them.

Thank you for your response and amazing work. :)

Looks like there's a bug here, will investigate. Thanks for the test case.

Also, I could not reproduce the issue using the {continuous: 2} flag in the fiddle, but it still exists. I was able to trigger it in my game.

Any news on solving this issue?

Yea, I'd love to hear how big of a deal CCD is to support. Amazing work on this engine though, its very impressive.

the CCD build solved the issue for my case with continuous:2 . When are you planning to merge it with the master?

I've been looking at it recently and I think I know where the issue lies, hope to solve it soon.

Any updates on this issue?

Where can I find the CCD build? It seems to be disappeared

Was this page helpful?
0 / 5 - 0 ratings

Related issues

moe091 picture moe091  路  3Comments

TimuJiang picture TimuJiang  路  4Comments

jack-guy picture jack-guy  路  3Comments

liabru picture liabru  路  3Comments

car1ot picture car1ot  路  3Comments