I'm using polygons for collision detection. Here is the code:
poly = new Polygon(verticies);
poly.setOrigin(100,100);
poly.setRotation(45);
renderer.setColor(Color.GREEN);
renderer.begin(ShapeType.Line);
renderer.identity();
renderer.translate(poly.getOriginX(), poly.getOriginY(), 0);
renderer.polygon(poly.getTransformedVertices());
renderer.translate(-poly.getOriginX(), -poly.getOriginY(), 0);
renderer.end();
Result, polygon is rotated, but it moves to the right. Here is the picture for 0, 30, 45, 60 , 90 degrees (from left to right). What am I doing wrong?