Welcome to my little Flightgear corner!

Flightgear is a highly accurate and very realistic open source flight simulator, available for Windows, Linux and MacOS. Flight simulation is one of my hobbies and in this section you find some of my Flightgear stuff.

I was always annoyed that the POV hat turns the view differently in cockpit views and in outside views. Here is now the solution.

Normally, if you move the hat to the left, in the cockpit view, your view pans to the left. In outsides views however, because there the view is "towards" the reference position and not "from" the observer position, the view is panned left around the reference position which effectively means, the the view is panned right. A little modification of the joystick configuration file corrects this problem:

<axis n="3">
  <desc>View Direction</desc>
  <direction>left</direction>
  <low>
    <repeatable>true</repeatable>
    <binding>
      <command>nasal</command>
      <script>
    if ((getprop("/sim/current-view/name")=="Cockpit View") or (getprop("/sim/current-view/name")=="Cockpit")) {
      view.panViewDir(1);
    } else {
      view.panViewDir(-1);
    }
      </script>
    </binding>
  </low>
  <high>
    <repeatable>true</repeatable>
    <binding>
      <command>nasal</command>
      <script>
    if ((getprop("/sim/current-view/name")=="Cockpit View") or (getprop("/sim/current-view/name")=="Cockpit")) {
      view.panViewDir(-1);
    } else {
      view.panViewDir(1);
    }
      </script>
    </binding>
  </high>
  <dead-band type="double">0</dead-band>
  <binding>
    <factor type="double">-1</factor>
  </binding>
</axis>