I've got a body that has to rotate on touch. There is no linear movement needed, they body just needs to rotate along an axis point.
I'm using setTransform to rotate the body in the onAreaTouched event. Like this:
body.setTransform(body.getPosition(),((float)Math.atan2(-(pSceneTouchEvent.getX() - startX), (pSceneTouchEvent.getY() - startY))));
This is done in the 'Move' Action. StartX and StartY denote the starting X and Y points. They are reset after the above line of code, as:
startX = pSceneTouchEvent.getX();
startY = pSceneTouchEvent.getY();
The code does rotate the body BUT the body jitters while rotating if the speed of touch movement is slow. With faster movement of touch the body rotates smoothly.
How can I make the body rotation smooth (Whether the touch movement is slow of fast)?