private double turnTo(double direction, double tickTime){
		double dirDiff = direction - head.rotation;
		while(dirDiff < -180f) dirDiff += 360f;
		while(dirDiff > 180f) dirDiff -= 360f;
		double sign = Math.signum(dirDiff);
		// already done?
		if(dirDiff * sign <= 0.5d){
			headVel = 0d;
			return 0d;
		}
		// already time to decelerate?
		if(dirDiff * sign <= headVel * headVel / def.headAcceleration * 0.5f){
			// decelerate
			headVel -= sign * def.headAcceleration * tickTime;
			if(headVel * sign < 0.5d) headVel = 0f;
		} else {
			// accelerate if still possible
			headVel += sign * def.headAcceleration * tickTime;
			if(headVel * sign > def.headMaxVel) headVel = sign * def.headMaxVel;
		}
		return dirDiff;
	}