Center of mass
Posted: Fri Jun 16, 2017 11:21 am
Hello!
I have a little problem:
When i was trying to attach a Shape to a PolygonShape Body, the Body's mass center, wasn't changed.
I tried using
but it isn't work.
On the right: Circle shape was created with body before polygon was attached.
On the left: Polygon shape was created with body before circle was attached.
Filled circles: shapes mass center. (calculated)
Small circles: bodies mass center. (getWorldCenter)
Big circles: bodies position. (getPosition)
Thanks for your help!
I have a little problem:
When i was trying to attach a Shape to a PolygonShape Body, the Body's mass center, wasn't changed.
I tried using
Code: Select all
body:resetMassData()
On the right: Circle shape was created with body before polygon was attached.
On the left: Polygon shape was created with body before circle was attached.
Filled circles: shapes mass center. (calculated)
Small circles: bodies mass center. (getWorldCenter)
Big circles: bodies position. (getPosition)
Thanks for your help!