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

Calling Body.setStatic(body, true) twice will break the body #641

Closed
jmfd opened this issue Aug 2, 2018 · 1 comment
Closed

Calling Body.setStatic(body, true) twice will break the body #641

jmfd opened this issue Aug 2, 2018 · 1 comment

Comments

@jmfd
Copy link
Contributor

jmfd commented Aug 2, 2018

Body.setStatic cannot be called consecutively with true; this will blow away the part[i]._original cache as it always does a replacement for the current values, even if they are reflective of a static body.

console.log("boxA.inertia = " + boxA.inertia);  // 27306.666666666668
Matter.Body.setStatic(boxA, true);
Matter.Body.setStatic(boxA, true);
Matter.Body.setStatic(boxA, false);
console.log("boxA.inertia = " + boxA.inertia); // Infinity

Example file:
setStatic2xBug.zip

@fserb
Copy link

fserb commented May 22, 2021

Same problem here.
The pushed fix doesn't really fix it (it does, but it breaks other things)

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

3 participants