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

permanent movement? #862

Closed
gontis opened this issue Apr 25, 2020 · 4 comments
Closed

permanent movement? #862

gontis opened this issue Apr 25, 2020 · 4 comments

Comments

@gontis
Copy link

gontis commented Apr 25, 2020

basically I want to achieve brownian motion, ie, particles bouncing endlessly in 0 gavity.

even when I set
frictionAir: 0,
friction: 0,
frictionStatic: 0,
systems seems to lose momentum and slow down?

what I am doing wrong, an/or there is a way to hack around it?

@michael-garofalo
Copy link

what I am doing wrong

I don't think it's something you're doing wrong. I ran into this problem while working on the "Physics" (Hype) template...

https://photics.com/free-template-tuesday-23-tumult-hype-physics/

I thought it was something Hype might have done. But now that I'm seeing you're having the same problem, maybe it's a Matter.js thing.

there is a way to hack around it?

You could manage the movement manually. Turn the Physics bodies into sensors. Then, when a body collides with an object, just change their velocity. But what is brownian motion?

https://en.wikipedia.org/wiki/Brownian_motion

...ah, that's going to be a bit of math. 😄

Maybe this should be reported as an issue? 🤷🏻‍♂️

@gontis
Copy link
Author

gontis commented Apr 27, 2020 via email

@alisrn
Copy link

alisrn commented May 28, 2020

You should check the slopproperty.

    /**
     * A `Number` that specifies a tolerance on how far a body is allowed to 'sink' or rotate into other bodies.
     * Avoid changing this value unless you understand the purpose of `slop` in physics engines.
     * The default should generally suffice, although very large bodies may require larger values for stable stacking.
     *
     * @property slop
     * @type number
     * @default 0.05
     */

@liabru
Copy link
Owner

liabru commented Sep 12, 2020

This is a known issue, please refer to #256. I see this come up a lot, it's noted and I'll consider it more of a priority for sure.

Thanks for raising though and to those who got back here, but I'll close this one as a duplicate.

@liabru liabru closed this as completed Sep 12, 2020
willhoyle added a commit to willhoyle/continuum that referenced this issue Nov 24, 2020
liabru/matter-js#862

Seems like there's problems with energy conservation for perfect
bounces. What we'll have to do is manage the bounces ourselves.

Shouldn;t be too hard since we're really just mirroring the velocity
vector
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

4 participants