hi,
i’m new in using the Phys2D library
I 'd like to know how to change (if it’s possible) the center of the rotation of a box
by default, the center of a box rotation is the box’s center itself
i’d like to change it
thanx … !
hi,
i’m new in using the Phys2D library
I 'd like to know how to change (if it’s possible) the center of the rotation of a box
by default, the center of a box rotation is the box’s center itself
i’d like to change it
thanx … !
Objects rotate around their mass center. It is physic. So the rotation center can not be change.
But if you want to rotate a shape (for example a car), when you apply a force on a objet it is always on the mass center in Phys2D. You will have to add a dummy object (low mass, no collision, fixed joint) to your object, then apply a force on the dummy object (it can be tricky).
Alternatively you could create a box shaped polygon around any center point. Whether it’ll behave as with a normal box I’m not sure.
You could take a look at JBox2D, I think the new engine supports arbitrary centre of rotations? It certainly has more consistent polygon support.
Kev