<?xml version="1.0"?>

<PropertyList include="Harrier-GR3-bombableinclude.xml">

    <!-- Model -->

    <path>Harrier-GR3.ac</path>
    <nasal>
      <load>
        <![CDATA[
var r = cmdarg();
print ("Harrier-GR3 loading for remote pilot " ~ r.getNode ("sim/multiplay/callsign").getValue());
var livery_update = aircraft.livery_update.new("Aircraft/Harrier-GR3/Models/Liveries");
var generic = r.getNode ("sim/multiplay/generic");
r.initNode ("controls/eject", 0, "BOOL");
r.getNode ("controls/eject").alias (generic.getNode ("bool[0]"));
r.getNode ("controls/engines/engine/mixture", 1).alias (generic.getNode ("float[6]"));

var weight = [];
foreach (var w; r.getNode ("sim").getChildren ("weight")) {
   # build a reversed list of weight nodes as we decode the variant in reverse order
   weight = [ w.getNode ("selected") ] ~ weight;
}

# Decode sim/model/variant into sim/weight[*]/selected
variant_decoder = maketimer (1.0, func () {
  var v = r.getNode("sim/model/variant").getValue();
  foreach (var s; weight) {
    s.setValue (math.mod (v, 2) == 0 ? "none" : "selected");
    v = int (v/2);
  }
});
variant_decoder.start();
        ]]>
      </load>
      <unload><![CDATA[
        print ("Harrier-GR3 unloading for remote pilot " ~ r.getNode ("sim/multiplay/callsign").getValue ());
livery_update.stop();
variant_decoder.stop();
      ]]></unload>
    </nasal>
    
    <offsets>
        <x-m>19.0</x-m>
        <y-m>0</y-m>
        <z-m>5.95</z-m>
        <pitch-deg>0.0</pitch-deg>
    </offsets>

    <model>
        <path>Aircraft/Harrier-GR3/Models/Cockpit/Cockpit.xml</path>
    </model>

    <!-- Rembrandt auto switching for glass -->

    <effect>
        <inherits-from>Effects/model-transparent</inherits-from>
        <condition>
            <property>/sim/rendering/rembrandt/enabled</property>
        </condition>
        <object-name>Canopy Glass</object-name>
        <object-name>Front Glass</object-name>
    </effect>

    <!-- Parts invisible from internally -->

    <animation>
        <type>select</type>
        <object-name>Canopy Glass</object-name>
        <object-name>Front Glass</object-name>
        <condition>
            <not>
                <property>sim/current-view/internal</property>
            </not>
        </condition>
    </animation>

    <!-- Lights -->

    <model>
        <path>Aircraft/Harrier-GR3/Models/Lights/LightPack.xml</path>
    </model>

    <nasal>
      <load><![CDATA[
  var root = cmdarg();
  var rootindex = root.getIndex();
  var mpPath = "/ai/models/multiplayer["~ rootindex ~"]/";

  var lightsPath = mpPath~"lightpack/"; #path to the property node, where all internal values are placed

  props.globals.initNode(mpPath~"sim/is-MP-Aircraft", 1, "BOOL");

  srand();
  #wherever you want to add randomization of time, use something like:  + rand()*0.05-0.025 (included by default where appropriate)


  #list of switches for lights - if you don't intend to use some light, assign it nil value instead, like whateverSwitch = nil; and you don't need to care about anything else
  #IMPORTANT: don't put / on the start of the string, it's already included in the mpPath property
  var navSwitch = mpPath~"controls/lighting/nav-lights-switch";
  var beaconSwitch = mpPath~"controls/lighting/beacon-switch";
  var strobeSwitch = mpPath~"controls/lighting/strobe-switch";
  var landingSwitch = mpPath~"controls/lighting/landing-lights-switch";
  var taxiSwitch = mpPath~"controls/lighting/taxi-light-switch";
  var probeSwitch = mpPath~"controls/lighting/probe-light-switch";
  var whiteSwitch = mpPath~"controls/lighting/white-light-switch";

  #switch this from 1 to 0 if you want to use advanced cyclical fading animation of the the nav lights instead of being stable on when the switch is on
  navStillOn = 1;


  #I need to set listener on some MP transferred properties; this doesn't seem to work well sometimes, so I mirror them to the original location on any change
  #This also simplifies work as I can use almost the same code for MP as is the local Nasal. Furthermore, I can use meaningful property names in the model XML files instead of referencing the MP properties.
  var mpVar = {
  	new: func(propIn, propOut) {
  		var m = { parents: [mpVar] };
  		m.propIn = propIn;
  		m.propOut = propOut;
  		if(propIn==nil) return m;
  		m.value = getprop(propIn);
  		setprop(propOut, m.value);
  		return m;
  	},
  	check: func {
  		if(me.propIn==nil) return;
  		var newValue = getprop(me.propIn);
  		if(newValue != me.value) {
  			setprop(me.propOut, newValue);
  			me.value = newValue;
  			#print("value of "~me.propOut~" changed: "~newValue);
  		}
  	},
  };
  #init any property copy object needed in this array (anything you need to transfer over MP, but you are using the original paths in your xmls)
  #also used for properties you are using a listener on, or properties which you maybe want to manipulate during the <unload>
  #if you're just using the pack, change the values according to the MP bindings in the -set.xml file
  #you don't need to delete the entries if the path is nil - it gets skipped automatically and the MP path is just ignored
  var mirrorValues = [
  	mpVar.new(mpPath~"sim/multiplay/generic/int[7]", mpPath~"sim/crashed"),
  	mpVar.new(mpPath~"sim/multiplay/generic/int[0]", navSwitch),
  	mpVar.new(mpPath~"sim/multiplay/generic/int[1]", beaconSwitch),
  	mpVar.new(mpPath~"sim/multiplay/generic/int[1]", strobeSwitch),
  	mpVar.new(mpPath~"sim/multiplay/generic/int[2]", landingSwitch),
  	mpVar.new(mpPath~"sim/multiplay/generic/int[3]", taxiSwitch),
  	mpVar.new(mpPath~"sim/multiplay/generic/int[3]", probeSwitch),
  	mpVar.new(mpPath~"sim/multiplay/generic/int[0]", whiteSwitch),
  ];
  #loop at the default MP transfer frequency (10Hz)
  var mirrorTimer = maketimer(0.1, func {
  	foreach(var mir; mirrorValues) {
  		mir.check();
  	}
  });
  mirrorTimer.start();



  #### NAV LIGHTS ####

  #class for a periodic fade in/out animation - for flashing, use rather standard aircraft.light.new(), as in Beacon and Strobe section
  var lightCycle = {
  	#constructor
  	new: func(propSwitch, propOut) {
  		m = { parents: [lightCycle] };
  		props.globals.initNode(propOut, 0, "DOUBLE");
  		props.globals.initNode(propSwitch, 1, "BOOL");
  		m.fadeIn = 0.4 + rand()*0.05-0.025; #fade in time
  		m.fadeOut = 0.4 + rand()*0.05-0.025; #fade out time
  		m.stayOn = 1.5 + rand()*0.05-0.025; #stable on period
  		m.stayOff = 1 + rand()*0.05-0.025; #stable off period
  		m.turnOff = 0.12; #fade out time when turned off
  		m.phase = 0; #phase to be run on next timer call: 0 -> fade in, 1 -> stay on, 2 -> fade out, 3 -> stay off
  		m.cycleTimer = maketimer(0.1, func {
  			if(getprop(propSwitch)) {
  				if(m.phase == 0) {
  					interpolate(propOut, 1, m.fadeIn);
  					m.phase = 1;
  					m.cycleTimer.restart(m.fadeIn);
  				}
  				else if(m.phase == 1){
  					m.phase = 2;
  					m.cycleTimer.restart(m.stayOn);
  				}
  				else if(m.phase == 2){
  					interpolate(propOut, 0, m.fadeOut);
  					m.phase = 3;
  					m.cycleTimer.restart(m.fadeOut);
  				}
  				else if(m.phase == 3){
  					m.phase = 0;
  					m.cycleTimer.restart(m.stayOff);
  				}
  			}
  			else {
  				interpolate(propOut, 0, m.turnOff); #kills any currently ongoing interpolation
  				m.phase = 0;
  			}
  		});
  		m.cycleTimer.singleShot = 1;
  		if(propSwitch==nil) {
  			m.listen = nil;
  			return m;
  		}
  		m.listen = setlistener(propSwitch, func{m.cycleTimer.restart(0);}); #handle switch changes
  		m.cycleTimer.restart(0); #start the looping
  		return m;
  	},
  	#destructor
  	del: func {
  		if(me.listen!=nil) removelistener(me.listen);
  		me.cycleTimer.stop();
  	},
  };

  #By default, the switch property is initialized to 1 (only if no value is already assigned). Don't change the class implementation! To override this, set the property manually. You don't need to care if any other code already does it for you.
  var navLights = nil;
  if(!navStillOn) {
  	navLights = lightCycle.new(navSwitch, lightsPath~"nav-lights-intensity");
  	### Uncomment and tune those to customize times ###
  	#navLights.fadeIn = 0.4; #fade in time
  	#navLights.fadeOut = 0.4; #fade out time
  	#navLights.stayOn = 3 + rand()*0.05-0.025; #stable on period
  	#navLights.stayOff = 0.6; #stable off period
  	#navLights.turnOff = 0.12; #fade out time when turned off
  }


  ### BEACON ###
  var beacon = nil;
  if(beaconSwitch!=nil) {
  	props.globals.initNode(beaconSwitch, 1, "BOOL");
  	beacon = aircraft.light.new(lightsPath~"beacon-state",
  		[0.0, 1.0 + rand()*0.05-0.025], beaconSwitch);
  }


  ### STROBE ###
  var strobe = nil;
  if(strobeSwitch!=nil) {
  	props.globals.initNode(strobeSwitch, 1, "BOOL");
  	strobe = aircraft.light.new(lightsPath~"strobe-state",
  		[0.0, 0.87 + rand()*0.05-0.025], strobeSwitch);
  }


  ### LIGHT FADING ###

  #class for controlling fade in/out behavior - propIn is a control property (handled as a boolean) and propOut is interpolated
  #all light brightness animations in xmls depend on propOut (Rembrandt brightness, material emission, flares transparency, ...)
  var lightFadeInOut = {
  	#constructor
  	new: func(propSwitch, propOut) {
  		m = { parents: [lightFadeInOut] };
  		m.fadeIn = 0.3; #some sane defaults
  		m.fadeOut = 0.4;
  		if(propSwitch==nil) {
  			m.listen = nil;
  			return m;
  		}
  		props.globals.initNode(propSwitch, 1, "BOOL");
  		m.isOn = getprop(propSwitch);
  		props.globals.initNode(propOut, m.isOn, "DOUBLE");
  		m.listen = setlistener(propSwitch,
  			func {
  				if(m.isOn and !getprop(propSwitch)) {
  					interpolate(propOut, 0, m.fadeOut);
  					m.isOn = 0;
  				}
  				if(!m.isOn and getprop(propSwitch)) {
  					interpolate(propOut, 1, m.fadeIn);
  					m.isOn = 1;
  				}
  			}
  		);
  		return m;
  	},
  	#destructor
  	del: func {
  		if(me.listen!=nil) removelistener(me.listen);
  	},
  };

  fadeLanding = lightFadeInOut.new(landingSwitch, lightsPath~"landing-lights-intensity");
  fadeTaxi = lightFadeInOut.new(taxiSwitch, lightsPath~"taxi-light-intensity");
  fadeProbe = lightFadeInOut.new(probeSwitch, lightsPath~"probe-light-intensity");
  fadeWhite = lightFadeInOut.new(whiteSwitch, lightsPath~"white-light-intensity");
  if(navStillOn) {
  	navLights = lightFadeInOut.new(navSwitch, lightsPath~"nav-lights-intensity");
  	navLights.fadeIn = 0.1;
  	navLights.fadeOut = 0.12;
  }
  #manipulate times if defaults don't fit your needs:
  #fadeLanding.fadeIn = 0.5;
  #fadeLanding.fadeOut = 0.8;


  ### the rest of your model load embedded Nasal code ###

      ]]>
      </load>
      <unload>
        stopFire();
        disintegrated = 0;
        removelistener(listenCrash);

        #prevent multiple timers and listeners from running and fighting on next connect
        #cleanly destroy MP property mirroring
        mirrorTimer.stop();
        mirrorTimer = nil;
        mirrorValues = nil;

        #cleanly destroy nav lights
        if(navStillOn) {
        	navLights.del();
        }
        else {
        	if(navSwitch!=nil) setprop(navSwitch, 0);
        	navLights.del();
        	if(navSwitch!=nil) navLights.cycleTimer = nil;
        	navLights = nil;
        }

        #cleanly destroy beacon
        if(beaconSwitch!=nil) setprop(beaconSwitch, 0);
        beacon.del();
        beacon = nil;

        #cleanly destroy strobe
        if(strobeSwitch!=nil) setprop(strobeSwitch, 0);
        strobe.del();
        strobe = nil;

        #cleanly destroy light fade in/out animation objects
        fadeLanding.del();
        fadeTaxi.del();
        fadeProbe.del();
        fadeWhite.del();

        ### the rest of your model unload embedded Nasal code ###
      </unload>
    </nasal>

    <!-- Effects -->
    <model>
        <path>Aircraft/Harrier-GR3/Models/Effects.xml</path>
    </model>

    <!-- MP sound -->
    <sound>
        <path>Aircraft/Harrier-GR3/Sounds/MP-Sound.xml</path>
    </sound>

    <!-- Shaders -->
    <animation>
        <type>shader</type>
        <shader>chrome</shader>
        <texture>Aircraft/Generic/Effects/glass_shader.png</texture>
        <object-name>Front Glass</object-name>
        <object-name>Canopy Glass</object-name>
        <object-name>HUDGlass</object-name>
    </animation>

    <animation>
        <type>noshadow</type>
        <object-name>Front Glass</object-name>
        <object-name>Canopy Glass</object-name>
        <object-name>HUDGlass</object-name>
    </animation>

    <animation>
        <type>material</type>
        <object-name>Fuselage</object-name>
        <object-name>Fin</object-name>
        <object-name>Antenna</object-name>
        <object-name>Nose</object-name>
        <object-name>Box</object-name>
        <object-name>Pylon1</object-name>
        <object-name>Pylon2</object-name>
        <object-name>Pylon4</object-name>
        <object-name>Pylon5</object-name>
        <object-name>Airbrake</object-name>
        <object-name>Arch</object-name>
        <object-name>Canopy Arch</object-name>
        <object-name>Antennas</object-name>
        <object-name>Intake</object-name>
        <object-name>Fan</object-name>
        <object-name>Tail</object-name>
        <object-name>Rudder</object-name>
        <object-name>LAileron</object-name>
        <object-name>RAileron</object-name>
        <object-name>LFlap</object-name>
        <object-name>RFlap</object-name>
        <object-name>Elevators</object-name>
        <object-name>LGearHouse</object-name>
        <object-name>RGearHouse</object-name>
        <object-name>LStrut</object-name>
        <object-name>RStrut</object-name>
        <object-name>LSpoiler</object-name>
        <object-name>RSpoiler</object-name>
        <object-name>FLGrDoor</object-name>
        <object-name>FRGrDoor</object-name>
        <object-name>MLGrDoor</object-name>
        <object-name>MRGrDoor</object-name>
        <object-name>LFNozzle</object-name>
        <object-name>RFNozzle</object-name>
        <object-name>LRNozzle</object-name>
        <object-name>RRNozzle</object-name>
        <object-name>FrontTire</object-name>
        <object-name>FrontUpperStrut</object-name>
        <object-name>FrontMiddleStrut</object-name>
        <object-name>FrontLowerStrut</object-name>
        <object-name>FLandLight</object-name>
        <object-name>MiddleTires</object-name>
        <object-name>MStrut</object-name>
        <object-name>MAxle</object-name>
        <object-name>LTire</object-name>
        <object-name>RTire</object-name>
        <object-name>LDStrut</object-name>
        <object-name>LUStrut</object-name>
        <object-name>RDStrut</object-name>
        <object-name>RUStrut</object-name>
        <object-name>Airbrake Strut</object-name>
        <property-base>sim/model/livery</property-base>
        <texture-prop>texture</texture-prop>
        <texture>Liveries/Default.png</texture>
    </animation>

    <!-- Payload -->

    <model>
        <path>Aircraft/Harrier-GR3/Models/FuelBoom.xml</path>
        <condition>
            <not>
                <equals>
                    <property>sim/weight[7]/selected</property>
                    <value>none</value>
                </equals>
            </not>
        </condition>
    </model>

    <model>
        <path>Aircraft/Harrier-GR3/Models/Payload.xml</path>
    </model>

    <animation>
        <type>select</type>
        <object-name>LSpoiler</object-name>
        <condition>
            <equals>
                <property>sim/weight[2]/selected</property>
                <value>none</value>
            </equals>
        </condition>
    </animation>

    <animation>
        <type>select</type>
        <object-name>RSpoiler</object-name>
        <condition>
            <equals>
                <property>sim/weight[4]/selected</property>
                <value>none</value>
            </equals>
        </condition>
    </animation>

    <!-- Animations -->

    <!-- Canopy -->
    <animation>
        <type>translate</type>
        <object-name>Canopy Glass</object-name>
        <object-name>Canopy Arch</object-name>
        <property>canopy/position-norm</property>
        <factor>0.7</factor>
        <axis>
            <x1-m>-15.46</x1-m>
            <y1-m>  0.00</y1-m>
            <z1-m> -5.84</z1-m>
            <x2-m>-14.66</x2-m>
            <y2-m>  0.00</y2-m>
            <z2-m> -5.32</z2-m>
        </axis>
    </animation>

    <!-- Eject -->

 <animation>
     <type>translate</type>
     <object-name>Pilot</object-name>
     <object-name>Seat</object-name>
     <property>controls/eject</property>
     <factor>20</factor>
     <center>
         <x-m>0</x-m>
         <y-m>0</y-m>
         <z-m>0</z-m>
     </center>
     <axis>
         <x>0</x>
         <y>0</y>
         <z>1</z>
     </axis>
 </animation>

 <animation>
     <type>select</type>
     <object-name>Canopy Glass</object-name>
     <condition>
         <not>
             <property>controls/eject</property>
         </not>
     </condition>
 </animation>

    <!-- Gear -->

    <!-- Front Gear -->
    <animation>
        <type>select</type>
        <object-name>FLandLight</object-name>
        <condition>
            <equals>
                <property>gear/gear[0]/position-norm</property>
                <value>1</value>
            </equals>
        </condition>
    </animation>

    <animation>
        <type>rotate</type>
        <object-name>FrontTire</object-name>
        <object-name>FrontUpperStrut</object-name>
        <object-name>FrontMiddleStrut</object-name>
        <object-name>FrontLowerStrut</object-name>
        <object-name>FLandLight</object-name>
        <property>gear/gear[0]/position-norm</property>
        <factor>-115</factor>
        <offset-deg>0</offset-deg>
        <center>
            <x-m>-14.03</x-m>
            <y-m>0</y-m>
            <z-m>-6.59</z-m>
        </center>
        <axis>
            <x>0</x>
            <y>1</y>
            <z>0</z>
        </axis>
    </animation>

    <!-- Middle Gear -->
    <animation>
        <type>rotate</type>
        <object-name>MiddleTires</object-name>
        <object-name>MStrut</object-name>
        <object-name>MAxle</object-name>
        <property>gear/gear[1]/position-norm</property>
        <factor>-115</factor>
        <offset-deg>0</offset-deg>
        <center>
            <x-m>-10.48</x-m>
            <y-m>0</y-m>
            <z-m>-6.53</z-m>
        </center>
        <axis>
            <x>0</x>
            <y>-1</y>
            <z>0</z>
        </axis>
    </animation>

    <!-- Side Gear -->
    <animation>
        <type>rotate</type>
        <object-name>LTire</object-name>
        <object-name>RTire</object-name>
        <object-name>LStrut</object-name>
        <object-name>RStrut</object-name>
        <object-name>LDStrut</object-name>
        <object-name>LUStrut</object-name>
        <object-name>RDStrut</object-name>
        <object-name>RUStrut</object-name>
        <property>gear/gear[2]/position-norm</property>
        <factor>-90</factor>
        <offset-deg>0</offset-deg>
        <center>
            <x-m>-9.733</x-m>
            <y-m>0</y-m>
            <z-m>-5.984</z-m>
        </center>
        <axis>
            <x>0</x>
            <y>-1</y>
            <z>0</z>
        </axis>
    </animation>

    <!-- Doors -->

    <!-- Front Doors -->
    <animation>
        <type>rotate</type>
        <object-name>FLGrDoor</object-name>
        <property>gear/gear[0]/position-norm</property>
        <interpolation>
            <entry>
                <ind>0.0</ind>
                <dep>0</dep>
            </entry>
            <entry>
                <ind>0.1</ind>
                <dep>-90</dep>
            </entry>
            <entry>
                <ind>0.9</ind>
                <dep>-90</dep>
            </entry>
            <entry>
                <ind>1.0</ind>
                <dep>-90</dep>
            </entry>
        </interpolation>
        <offset-deg>0</offset-deg>
        <axis>
            <x1-m>-15.2415</x1-m>
            <y1-m> -0.1762</y1-m>
            <z1-m> -6.7264</z1-m>
            <x2-m>-14.2516</x2-m>
            <y2-m> -0.2100</y2-m>
            <z2-m> -6.7383</z2-m>
        </axis>
    </animation>

    <animation>
        <type>rotate</type>
        <object-name>FRGrDoor</object-name>
        <property>gear/gear[0]/position-norm</property>
        <interpolation>
            <entry>
                <ind>0.0</ind>
                <dep>0</dep>
            </entry>
            <entry>
                <ind>0.1</ind>
                <dep>90</dep>
            </entry>
            <entry>
                <ind>0.9</ind>
                <dep>90</dep>
            </entry>
            <entry>
                <ind>1.0</ind>
                <dep>90</dep>
            </entry>
        </interpolation>
        <offset-deg>0</offset-deg>
        <axis>
            <x1-m>-15.2415</x1-m>
            <y1-m>  0.1762</y1-m>
            <z1-m> -6.7264</z1-m>
            <x2-m>-14.2516</x2-m>
            <y2-m>  0.2100</y2-m>
            <z2-m> -6.7383</z2-m>
        </axis>
    </animation>

    <!-- Middle Doors -->
    <animation>
        <type>rotate</type>
        <object-name>MRGrDoor</object-name>
        <property>gear/gear[0]/position-norm</property>
        <interpolation>
            <entry>
                <ind>0.0</ind>
                <dep>0</dep>
            </entry>
            <entry>
                <ind>0.1</ind>
                <dep>90</dep>
            </entry>
            <entry>
                <ind>0.9</ind>
                <dep>90</dep>
            </entry>
            <entry>
                <ind>1.0</ind>
                <dep>0</dep>
            </entry>
        </interpolation>
        <offset-deg>0</offset-deg>
        <axis>
            <x1-m>-10.4120</x1-m>
            <y1-m>  0.3717</y1-m>
            <z1-m> -6.4964</z1-m>
            <x2-m> -9.5749</x2-m>
            <y2-m>  0.3370</y2-m>
            <z2-m> -6.4149</z2-m>
        </axis>
    </animation>

    <animation>
        <type>rotate</type>
        <object-name>MLGrDoor</object-name>
        <property>gear/gear[0]/position-norm</property>
        <interpolation>
            <entry>
                <ind>0.0</ind>
                <dep>0</dep>
            </entry>
            <entry>
                <ind>0.1</ind>
                <dep>-90</dep>
            </entry>
            <entry>
                <ind>0.9</ind>
                <dep>-90</dep>
            </entry>
            <entry>
                <ind>1.0</ind>
                <dep>0</dep>
            </entry>
        </interpolation>
        <offset-deg>0</offset-deg>
        <axis>
            <x1-m>-10.4120</x1-m>
            <y1-m> -0.3717</y1-m>
            <z1-m> -6.4964</z1-m>
            <x2-m> -9.5749</x2-m>
            <y2-m> -0.3370</y2-m>
            <z2-m> -6.4149</z2-m>
        </axis>
    </animation>

    <!-- Steering-->
    <animation>
        <type>rotate</type>
        <object-name>FrontTire</object-name>
        <object-name>FrontLowerStrut</object-name>
        <object-name>FrontMiddleStrut</object-name>
        <property>surface-positions/rudder-pos-norm</property>
        <factor>80</factor>
        <center>
            <x-m>-14.45</x-m>
            <y-m>0</y-m>
            <z-m>-6.41</z-m>
        </center>
        <axis>
            <x>-90</x>
            <y>0</y>
            <z>25</z>
        </axis>
    </animation>

    <!-- Gear Compression -->

    <!-- Front Gear -->
    <animation>
        <type>rotate</type>
        <object-name>FrontTire</object-name>
        <object-name>FrontLowerStrut</object-name>
        <property>gear/gear[0]/compression-norm[0]</property>
        <factor>100</factor>
        <offset-deg>0</offset-deg>
        <center>
            <x-m>-14.46</x-m>
            <y-m>0</y-m>
            <z-m>-6.08</z-m>
        </center>
        <axis>
            <x>0</x>
            <y>-1</y>
            <z>0</z>
        </axis>
    </animation>

    <!-- Middle Gear -->
    <animation>
        <type>translate</type>
        <object-name>MiddleTires</object-name>
        <object-name>MAxle</object-name>
        <property>gear/gear[1]/compression-norm[0]</property>
        <factor>0.3</factor>
        <axis>
            <x>-1</x>
            <y>0</y>
            <z>-0.167</z>
        </axis>
    </animation>

    <!-- Side Gear -->
    <animation>
        <type>translate</type>
        <object-name>LTire</object-name>
        <object-name>LDStrut</object-name>
        <object-name>LUStrut</object-name>
        <property>gear/gear[2]/compression-norm[0]</property>
        <factor>0.3</factor>
        <axis>
            <x>-1</x>
            <y>0</y>
            <z>0</z>
        </axis>
    </animation>

    <animation>
        <type>translate</type>
        <object-name>RTire</object-name>
        <object-name>RDStrut</object-name>
        <object-name>RUStrut</object-name>
        <property>gear/gear[3]/compression-norm[0]</property>
        <factor>0.3</factor>
        <axis>
            <x>-1</x>
            <y>0</y>
            <z>0</z>
        </axis>
    </animation>

    <!-- Control Surfaces-->

    <!-- Rudder -->
    <animation>
        <type>rotate</type>
        <object-name>Rudder</object-name>
        <property>surface-positions/rudder-pos-norm</property>
        <factor>30</factor>
        <offset-deg>0</offset-deg>
        <axis>
            <x1-m> -5.7426</x1-m>
            <y1-m>  0.0000</y1-m>
            <z1-m> -4.9432</z1-m>
            <x2-m> -5.4251</x2-m>
            <y2-m>  0.0000</y2-m>
            <z2-m> -3.3663</z2-m>
        </axis>
    </animation>

    <!-- Elevators -->
    <animation>
        <type>rotate</type>
        <object-name>Elevators</object-name>
        <property>surface-positions/elevator-pos-norm</property>
        <factor>20</factor>
        <offset-deg>0</offset-deg>
        <axis>
            <x1-m> -6.2236</x1-m>
            <y1-m> -1.0000</y1-m>
            <z1-m> -5.8086</z1-m>
            <x2-m> -6.2236</x2-m>
            <y2-m>  1.0000</y2-m>
            <z2-m> -5.8086</z2-m>
        </axis>
    </animation>

    <!-- Ailerons -->
    <animation>
        <type>rotate</type>
        <object-name>LAileron</object-name>
        <property>surface-positions/left-aileron-pos-norm</property>
        <factor>25</factor>
        <offset-deg>0</offset-deg>
        <axis>
            <x1-m> -9.3696</x1-m>
            <y1-m> -3.3021</y1-m>
            <z1-m> -5.9689</z1-m>
            <x2-m> -9.6092</x2-m>
            <y2-m> -2.3391</y2-m>
            <z2-m> -5.7400</z2-m>
        </axis>
    </animation>

    <animation>
        <type>rotate</type>
        <object-name>RAileron</object-name>
        <property>surface-positions/right-aileron-pos-norm</property>
        <factor>-25</factor>
        <offset-deg>0</offset-deg>
        <axis>
            <x1-m> -9.3696</x1-m>
            <y1-m>  3.3021</y1-m>
            <z1-m> -5.9689</z1-m>
            <x2-m> -9.6092</x2-m>
            <y2-m>  2.3391</y2-m>
            <z2-m> -5.7400</z2-m>
        </axis>
    </animation>

    <!-- Flaps -->
    <animation>
        <type>rotate</type>
        <object-name>LFlap</object-name>
        <property>surface-positions/flap-pos-norm</property>
        <factor>50</factor>
        <offset-deg>0</offset-deg>
        <axis>
            <x1-m> -9.6065</x1-m>
            <y1-m> -2.2812</y1-m>
            <z1-m> -5.7282</z1-m>
            <x2-m> -9.9684</x2-m>
            <y2-m> -0.8582</y2-m>
            <z2-m> -5.3834</z2-m>
        </axis>
    </animation>

    <animation>
        <type>rotate</type>
        <object-name>RFlap</object-name>
        <property>surface-positions/flap-pos-norm</property>
        <factor>-50</factor>
        <offset-deg>0</offset-deg>
        <axis>
            <x1-m> -9.6065</x1-m>
            <y1-m>  2.2812</y1-m>
            <z1-m> -5.7282</z1-m>
            <x2-m> -9.9684</x2-m>
            <y2-m>  0.8582</y2-m>
            <z2-m> -5.3834</z2-m>
        </axis>
    </animation>

    <!-- Nozzle Rotation -->
    <animation>
        <type>rotate</type>
        <object-name>LFNozzle</object-name>
        <object-name>RFNozzle</object-name>
        <property>controls/engines/engine/mixture</property>
        <factor>-100</factor>
        <offset-deg>98</offset-deg>
        <center>
            <x-m>-12.7398</x-m>
            <y-m>  0.0000</y-m>
            <z-m> -6.0471</z-m>
        </center>
        <axis>
            <x>0</x>
            <y>1</y>
            <z>0</z>
        </axis>
    </animation>

    <animation>
        <type>rotate</type>
        <object-name>LRNozzle</object-name>
        <object-name>RRNozzle</object-name>
        <property>controls/engines/engine/mixture</property>
        <factor>-100</factor>
        <offset-deg>98</offset-deg>
        <center>
            <x-m>-10.7627</x-m>
            <y-m>  0.0000</y-m>
            <z-m> -6.1292</z-m>
        </center>
        <axis>
            <x>0</x>
            <y>1</y>
            <z>0</z>
        </axis>
    </animation>

    <!-- Air Brake -->
    <animation>
        <type>rotate</type>
        <object-name>Airbrake</object-name>
        <object-name>Airbrake Strut</object-name>
        <property>surface-positions/speedbrake-pos-norm</property>
        <factor>60</factor>
        <offset-deg>0</offset-deg>
        <center>
            <x-m>-9.0167</x-m>
            <y-m> 0.0000</y-m>
            <z-m>-6.3777</z-m>
        </center>
        <axis>
            <x>0</x>
            <y>1</y>
            <z>0</z>
        </axis>
    </animation>

    <!-- Intake Doors -->
    <animation>
        <type>select</type>
        <object-name>Intake</object-name>
        <condition>
            <greater-than>
                <property>controls/engines/engine/mixture</property>
                <value>0.7</value>
            </greater-than>
        </condition>
    </animation>

    <!-- Fan -->
    <animation>
        <type>spin</type>
        <object-name>Fan</object-name>
        <property>engines/engine/rpm</property>
        <factor>100</factor>
        <center>
            <x-m>-14.1426</x-m>
            <y-m>-0.0000</y-m>
            <z-m>-6.0354</z-m>
        </center>
        <axis>
            <x>-1</x>
            <y>0</y>
            <z>0</z>
        </axis>
    </animation>

</PropertyList>
