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

Erratic behaviour, passing through bodies to the right. #52

Closed
mulhoon opened this issue Dec 7, 2014 · 3 comments
Closed

Erratic behaviour, passing through bodies to the right. #52

mulhoon opened this issue Dec 7, 2014 · 3 comments

Comments

@mulhoon
Copy link

mulhoon commented Dec 7, 2014

Hi there.
I came across this bug when dragging things to the right hand side. As you can see when dragging something to the left everything is fine, but to the right it starts bouncing and then passes through the wall. Do you know what this might be?

Image of Bug

Here is my code

    Demo.walls = function() {
        var _world = _engine.world;

        Demo.reset();

        World.add(_world, [
            Bodies.rectangle(300, 300, 10, 560, { isStatic: true }),
            Bodies.rectangle(500, 300, 10, 560, { isStatic: true })
            ]);

        World.add(_world, Bodies.circle(400, 100, 30));

        var renderOptions = _engine.render.options;
    };

Thanks for all your great work on matter.js, I find it very exciting.

@liabru
Copy link
Owner

liabru commented Dec 7, 2014

This happens because continuous collision detection is not yet implemented.
That means given enough velocity / force, objects will pass through others especially if they are very thin. So you may need to use thicker walls for now, or create a custom constraint that limits the amount force you can apply (tricky unless you know what you're doing!).

See issue #5, so closing this one, thanks.

@liabru liabru closed this as completed Dec 7, 2014
@mulhoon
Copy link
Author

mulhoon commented Dec 7, 2014

Ok thanks.
Looks like it is quite a big issue to solve.
Strange how it only happens on the right hand side though.

@liabru
Copy link
Owner

liabru commented Dec 7, 2014

Yeah it's a complicated problem with a number of possible approaches.

I've looked into it and played with some ideas, but it's tricky to solve since it requires big modifications to the collision detector.

It should be the same on both sides, but it wouldn't surprise me if there's some strange reason why it's different.

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

2 participants