I'd like to rotate a spaceship around the z axis with the SKAction rotation method, depending on touch coordinates. After a touch the spaceship's nose should point to the touch point.
CGFloat rad = atan2f(touchPos.y - sprite.position.y, touchPos.x - sprite.position.x); // calc rad between vectors
SKAction *rotation = [SKAction rotateToAngle: rad duration: ??? shortestUnitArc:YES];
How can I adjust the duration so that the rotation speed is always the same (no matter how big the rotation angle is)?
The problem is that the radian occurs in the interval from -pi to pi (because of atan2). So the rotation depends on the quadrant touched and so does the speed.