It consists of setting up a virtual joystick device using the vJoy driver, then emulating it as a device of your choice using FreePIE and exposing its axis using the configurable script, and finally using FGCamera so that it binds these axis to a /sim/TrackIR/ property which is used to pan views.
The process outlined below will work on Windows7/8/10, and _assumes_ you have the TrackIR.
Prerequisites/Software:
# vJoy, sets up a virtual joystick device for handling by a feeder application like FreePIE, click to download vJoy 2.0.5-080115
# FreePIE, arbitrary device emulation, configurable using a Python-syntax script, click to download FreePIE 1.9.611.0
# FGCamera, interactive camera management system, click to download fgcamera_v1_2
Installation instructions:
1 - Install FGCamera, once you have FGCamera working and tested running by following these instructions http://wiki.flightgear.org/FGCamera#Download_link_.2F_Installation, create the following file in $FGData\Input\Joysticks\vJoy\trackir.xml:
- Code: Select all
<PropertyList>
<name>vJoy Device</name>
<axis n="0">
<desc>6DOFYaw</desc>
<tolerance>0.00001</tolerance>
<binding>
<command>property-scale</command>
<property>/sim/TrackIR/heading-deg</property>
<factor type="double">-180.0</factor>
</binding>
</axis>
<axis n="1">
<desc>6DOFPitch</desc>
<tolerance>0.00001</tolerance>
<binding>
<command>property-scale</command>
<property>/sim/TrackIR/pitch-deg</property>
<factor type="double">100.0</factor>
</binding>
</axis>
<axis n="2">
<desc>6DOFRoll</desc>
<tolerance>0.00001</tolerance>
<binding>
<command>property-scale</command>
<property>/sim/TrackIR/roll-deg</property>
<factor type="double">100.0</factor>
</binding>
</axis>
<axis n="3">
<desc>6DOFX</desc>
<tolerance>0.00001</tolerance>
<binding>
<command>property-scale</command>
<property>/sim/TrackIR/x-m</property>
<factor type="double">0.5</factor>
</binding>
</axis>
<axis n="4">
<desc>6DOFY</desc>
<tolerance>0.00001</tolerance>
<binding>
<command>property-scale</command>
<property>/sim/TrackIR/y-m</property>
<factor type="double">-0.5</factor>
</binding>
</axis>
<axis n="5">
<desc>6DOFZ</desc>
<tolerance>0.00001</tolerance>
<binding>
<command>property-scale</command>
<property>/sim/TrackIR/z-m</property>
<factor type="double">1.5</factor>
</binding>
</axis>
</PropertyList>
<!-- end of trackir.xml -->
2 - Install vJoy driver(doesn't require restart on Windows 8 ).
3 - Run TrackIR software.
4 - Install FreePIE, run as admin, insert and save the following script, then choose "Script > Run Script" from within the application(make sure there aren't any errors):
- Code: Select all
import sys
def toIntSafe(value):
if value > sys.maxint: return sys.maxint
if value < -sys.maxint: return -sys.maxint
return value
def update():
yaw = filters.mapRange(trackIR.yaw, -90, 90, -vJoy[0].axisMax, vJoy[0].axisMax)
pitch = filters.mapRange(trackIR.pitch, -90, 90, -vJoy[0].axisMax, vJoy[0].axisMax)
roll = filters.mapRange(trackIR.roll, -120, 120, -vJoy[0].axisMax, vJoy[0].axisMax)
side = filters.mapRange(trackIR.x, -120, 120, -vJoy[0].axisMax, vJoy[0].axisMax)
zoom = filters.mapRange(trackIR.z, -120, 120, -vJoy[0].axisMax, vJoy[0].axisMax)
updown = filters.mapRange(trackIR.y, -120, 120, -vJoy[0].axisMax, vJoy[0].axisMax)
vJoy[0].x = toIntSafe(yaw)
vJoy[0].y = toIntSafe(pitch)
vJoy[0].z = toIntSafe(roll)
vJoy[0].rx = toIntSafe(side)
vJoy[0].rz = toIntSafe(zoom)
vJoy[0].ry = toIntSafe(updown)
if starting:
trackIR.update += update
5 - Start vJoy Monitor testing utility which was installed by the vJoy driver, and monitor if the axis are corresponding to your input, if they are...
6 - Launch Flightgear and Enjoy!!!