planck.js icon indicating copy to clipboard operation
planck.js copied to clipboard

How to declare a MassData to use with getMassData

Open bobcgausa opened this issue 4 years ago • 1 comments

i tried var md = new planck.MassData() and error message is no constructor i'm trying to put a dot on the center of mass

btw a getCenterOfMass () would be useful

bobcgausa avatar Apr 23 '21 18:04 bobcgausa

It's just an object, you could just create an object like md = { mass: 0, center: Vec2(), I: 0 }

shakiba avatar Apr 24 '21 04:04 shakiba

btw a getCenterOfMass () would be useful

getWorldCenter() and getLocalCenter() return the center of mass.

shakiba avatar Aug 23 '23 09:08 shakiba