title: Box2D rotate a body around its center.. LIBGDX
body: <p>Im trying to rotate a body around its center in box2d. The rotation of the sprite works, but what the body does is rotate around its top left point.</p>
  
  <p>Code for rotating the sprite:</p>
  
  <pre><code>    public void drawBitMap(Bitmap bit, float x, float y, float width, float height, float rotation){
      Sprite sprt = null;
      if (!sprts.containsKey(bit)) {
           sprt = new Sprite(bit.texture);
          sprts.put(bit, sprt);
      }else{
          sprt = sprts.get(bit);
      }
      sprt.setOrigin(width/2,height/2);
      sprt.setRotation(rotation);
      sprt.setPosition(x,y);
  
      sprt.setSize(width,height);
      sprt.draw(this);
  }
  </code></pre>
  
  <p>Code for rotating body:</p>
  
  <pre><code> body.setTransform(x, y, rotation * MathUtils.degreesToRadians);
  </code></pre>
  
  <p>Images of what is happening:</p>
  
  <p><a href="https://i.stack.imgur.com/Gb7As.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gb7As.png" alt="Here, rotation is around (-/+)90 degrees"></a></p>
  
  <p><a href="https://i.stack.imgur.com/Gx01m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gx01m.png" alt="Here rotation is broken for every wolf"></a></p>