Kan Che
Kan Che

Reputation: 33

Set origin of Box2d Body LIBGDX

I want to rotate Body with two fixtures. By default when you call body.setAngularVelocity() Body rotates around center of all fixtures. Can i change center of a body to rotate all fixtures around my point?

Upvotes: 1

Views: 237

Answers (1)

Jiří
Jiří

Reputation: 251

This is impossible to do with the setAngularVelocity as it sets only rotation of body not relative to other points or bodies. You can probably use distance or revolute joints to set the point around which you want the body to rotate. Then to apply angular velocity you can use applyImpulse in direction where you want the body to rotate.

Upvotes: 1

Related Questions