I have a simply Box2d body with a triangular polygon shape and I’m trying to rotate the body. The code below appears to work; I’ve checked the body angle before and after and it has changed as I expect.
body.setTransform(body.getPosition(), body.getAngle()+TURN_ANGLE);
The problem is when I draw the polygon the vertices remain unchanged. Is this how it should be? I did wonder whether I need to apply a transform to the vertices but can’t find a way to do it.
Any pointers would be very much appreciated.
Originally my drawing method did something like this:
I’ve managed to get it working now by changing the code above to this:
Seems to work as expected.