The court, on its own motion or on the motion of any party, may call witnesses and interrogate them the same as if they had been produced by a party to the action, and the parties may object to the questions asked and the evidence adduced the same as if such witnesses were called and examined by an adverse party. Such witnesses may be cross-examined by all parties to the action in such order as the court directs.