I making a map with Tiled and load all box2d bodies with Box2DMapObjectParser to my world and everything just work fine except one thing. I'm using a newer version of Tiled where implemented body rotation. I'm trying to implement it in Box2DMapObjectParser by myself and this is what I get from it:
Editor:
And the game:
As you can see the right rectangle has a property named Rotation so I can easily get from properties, but I don't know what is wrong with it.
I set the rotation like this
fixture.getBody().setTransform(fixture.getBody().getPosition(), degree);
where degree
is value from editor. Anybody have a clues about what am I doing wrong? I also tried doing something like
fixture.getBody().setTransform(fixture.getBody().getPosition(), degree*MathUtils.degreesToRadians);
But itsalso sets a wrong rotation.