-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Matter.Body.setStatic() - setting to false after already true removes body #187
Comments
Ok, looks like resetting the body's mass to something non-static (i.e. non-infinity) does the trick. This allows me to use Matter.Body.setStatic() in a way where I can toggle a body's static property. thanks, |
It's a known limitation that you can't unset static once it's been set. The reason is that it requires certain properties to be set to Infinity (e.g. mass) which means the old value is lost. A possible fix is to add some sort of property cache to bodies so they can be restored, but this is currently a low priority. If you need this, you should be able to look at Body.setStatic and do something similar for your own project though. |
Perfect, will do. |
Was this ever solved? |
Not implemented yet but in the meantime you can implement your own based on my previous comment, I'll look at this again soon. |
can someone help me to change isStatic:true; to isStatic: false on click of down arrow. |
you can use eventListener to change static status with Body.setStatic(obj.body, false/true); |
thnks
…On Mon, 19 Oct 2020 at 02:01, Özgür Can Altınok ***@***.***> wrote:
can someone help me to change isStatic:true; to isStatic: false on click
of down arrow.
please help..
you can use eventListener to change static status with
Body.setStatic(obj.body, false/true);
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#187 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQ5X5IWZY4JZB5QZK2DTVELSLNGCHANCNFSM4BXQYRXQ>
.
|
me too |
@parthsharma365628 did you try Body.setStatic? |
Thanks...
…On Mon, 15 Feb, 2021, 2:42 am liabru, ***@***.***> wrote:
@parthsharma365628 <https://github.com/parthsharma365628> did you try
Body.setStatic
<https://brm.io/matter-js/docs/classes/Body.html#method_setStatic>?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#187 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQ5X5IQGWFZLFFYQ25Z6VL3S7A4EXANCNFSM4BXQYRXQ>
.
|
how to collide two bodies one static one non static |
I would like to be able to toggle a body between static and non-static, but it looks like once a body is set to static un-setting it messes something up and the body disappears from the render view.
Should it be possible to use setStatic in this manner? I'm using latest build (2015-12-23).
Thanks!
Dan
The text was updated successfully, but these errors were encountered: