Rotates the current direction based on the given rotation direction.
The new direction after rotation.
The direction to rotate (CLOCKWISE or COUNTERCLOCKWISE).