<?xml version="1.0" encoding="UTF-8"?>

<PropertyList>

  <path>fk9mk2.ac</path>

  <nasal>
    <load>
      var livery_update = aircraft.livery_update.new("Aircraft/FK9MK2/Models/Liveries", 10);
    </load>
    <unload>
      livery_update.stop();
    </unload>
  </nasal>

  <animation>
    <!-- Objets opaques -->
    <object-name>fuselage</object-name>
    <object-name>roueG</object-name>
    <object-name>roueD</object-name>
    <object-name>roueA</object-name>
    <object-name>ailes</object-name>
    <object-name>aileronG</object-name>
    <object-name>aileronD</object-name>
    <object-name>voletG</object-name>
    <object-name>voletD</object-name>
    <object-name>bol</object-name>
    <object-name>helice</object-name>
    <object-name>deriveV</object-name>
    <object-name>deriveH</object-name>
    <object-name>profondeur</object-name>
    <object-name>direction</object-name>
    <object-name>barre</object-name>
    <object-name>axe</object-name>
    <object-name>cacheG</object-name>
    <object-name>cacheD</object-name>
    <object-name>air</object-name>
    <object-name>priseavant</object-name>
    <object-name>prisearriere</object-name>
    <object-name>echappe</object-name>

    <!-- Objets transparents -->
    <object-name>vitres</object-name>
    <object-name>propblur</object-name>
    <object-name>propdisc</object-name>
  </animation>

  <animation>
    <type>noshadow</type>
    <object-name>vitres</object-name>
    <object-name>propdisc</object-name>
    <object-name>propblur</object-name>
  </animation>

  <animation>
    <type>shader</type>
    <shader>chrome</shader>
    <texture>glass_shader.png</texture>
    <object-name>vitres</object-name>
  </animation>

  <animation>
    <type>material</type>
    <object-name>fuselage</object-name>
    <object-name>roueG</object-name>
    <object-name>roueD</object-name>
    <object-name>roueA</object-name>
    <object-name>ailes</object-name>
    <object-name>aileronG</object-name>
    <object-name>aileronD</object-name>
    <object-name>voletG</object-name>
    <object-name>voletD</object-name>
    <object-name>bol</object-name>
    <object-name>helice</object-name>
    <object-name>deriveV</object-name>
    <object-name>deriveH</object-name>
    <object-name>profondeur</object-name>
    <object-name>direction</object-name>
    <object-name>barre</object-name>
    <object-name>axe</object-name>
    <object-name>cacheG</object-name>
    <object-name>cacheD</object-name>
    <object-name>air</object-name>
    <object-name>priseavant</object-name>
    <object-name>prisearriere</object-name>
    <object-name>echappe</object-name>

    <property-base>sim/model/livery</property-base>
    <texture-prop>texture</texture-prop>
    <texture>texture.png</texture>
<!--
    <diffuse>
      <red-prop>diffuse/red</red-prop>
      <green-prop>diffuse/green</green-prop>
      <blue-prop>diffuse/blue</blue-prop>
    </diffuse>

    <ambient>
      <red-prop>ambient/red</red-prop>
      <green-prop>ambient/green</green-prop>
      <blue-prop>ambient/blue</blue-prop>
    </ambient>
-->
    <specular>
      <red-prop>specular/red</red-prop>
      <green-prop>specular/green</green-prop>
      <blue-prop>specular/blue</blue-prop>
    </specular>

    <emission>
      <red-prop>emission/red</red-prop>
      <green-prop>emission/green</green-prop>
      <blue-prop>emission/blue</blue-prop>
    </emission>
<!--
    <shininess>
      <shininess-prop>shininess</shininess-prop>
    </shininess>
-->
  </animation>

  <!-- Interieur -->
  <model>
    <path>Aircraft/FK9MK2/Models/Interior/interior.xml</path>
    <offsets>
      <x-m> 0 </x-m>
      <y-m> 0 </y-m>
      <z-m> 0 </z-m>
      <roll-deg>    0 </roll-deg>
      <pitch-deg>   0 </pitch-deg>
      <heading-deg> 0 </heading-deg>
    </offsets>
  </model>

  <!-- L'hélice --> 
  <animation>
    <name>HeliceComplete</name>
    <object-name>propdisc</object-name>
    <object-name>propblur</object-name>
    <object-name>helice</object-name>
    <object-name>bol</object-name>
  </animation>

  <!-- Séléction de l'objet visible en fonction des rpm -->
  <animation>
    <type>select</type>
    <object-name>propdisc</object-name>
    <condition>
      <greater-than>
        <property>engines/engine[0]/rpm</property>
        <value>1500</value>
      </greater-than>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>propblur</object-name>
    <condition>
    <and>
      <greater-than>
        <property>engines/engine[0]/rpm</property>
        <value>600.000</value>
      </greater-than>
      <less-than>
        <property>engines/engine[0]/rpm</property>
        <value>1500.001</value>
      </less-than>
    </and>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>helice</object-name>
    <condition>
      <less-than>
        <property>engines/engine[0]/rpm</property>
	<value>1500</value>
      </less-than>
    </condition>
  </animation>

  <animation>
    <type>spin</type>
    <object-name>HeliceComplete</object-name>
    <property>/engines/engine[0]/rpm</property>
    <factor> 1 </factor>
    <center>
      <x-m> -2.811 </x-m>
      <y-m>  0.000 </y-m>
      <z-m> -0.037 </z-m>
    </center>
    <axis>
      <x> -1 </x>
      <y>  0 </y>
      <z>  0 </z>
    </axis>
  </animation>

  <!-- Gouverne de profondeur -->
  <animation>
    <type>rotate</type>
    <object-name>profondeur</object-name>
    <property>/controls/flight/elevator</property>
    <factor>11</factor>
    <center>
      <x-m> 2.490</x-m>
      <y-m> 0.000 </y-m>
      <z-m> 0.094 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 1 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <!-- Gouverne de direction -->
  <animation>
    <type>rotate</type>
    <object-name>direction</object-name>
    <property>/controls/flight/rudder</property>
    <factor>20</factor>
    <axis>
      <x1-m>  2.422 </x1-m>
      <y1-m>  0.000 </y1-m>
      <z1-m> -0.201 </z1-m>
      <x2-m>  2.670 </x2-m>
      <y2-m>  0.000 </y2-m>
      <z2-m>  1.066 </z2-m>
    </axis>
  </animation>

  <!-- Animations des ailerons -->
  <animation>
    <type>rotate</type>
    <object-name>aileronG</object-name>
    <property>/surface-positions/left-aileron-pos-norm</property>
    <factor>-15.0</factor>
    <axis>
      <x1-m> -0.486 </x1-m>
      <y1-m> -2.640 </y1-m>
      <z1-m>  0.480 </z1-m>
      <x2-m> -0.486 </x2-m>
      <y2-m> -4.817 </y2-m>
      <z2-m>  0.515 </z2-m>
    </axis>
  </animation> 

  <animation>
    <type>rotate</type>
    <object-name>aileronD</object-name>
    <property>/surface-positions/right-aileron-pos-norm</property>
    <factor>-15.0</factor>
    <axis>
      <x1-m> -0.486 </x1-m>
      <y1-m>  4.817 </y1-m>
      <z1-m>  0.515 </z1-m>
      <x2-m> -0.486 </x2-m>
      <y2-m>  2.640 </y2-m>
      <z2-m>  0.480 </z2-m>
    </axis>
  </animation>

  <!-- Volets -->
  <animation>
    <type>rotate</type>
    <object-name>voletG</object-name>
    <property>/surface-positions/flap-pos-norm</property>
    <factor>-10.0</factor>
    <axis>
      <x1-m> -0.486 </x1-m>
      <y1-m> -0.464 </y1-m>
      <z1-m>  0.434 </z1-m>
      <x2-m> -0.486 </x2-m>
      <y2-m> -2.641 </y2-m>
      <z2-m>  0.468 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>voletD</object-name>
    <property>/surface-positions/flap-pos-norm</property>
    <factor>-10.0</factor>
    <axis>
      <x1-m> -0.486 </x1-m>
      <y1-m>  2.641 </y1-m>
      <z1-m>  0.468 </z1-m>
      <x2-m> -0.486 </x2-m>
      <y2-m>  0.464 </y2-m>
      <z2-m>  0.434 </z2-m>
    </axis>
  </animation>

  <!-- Rotation de la rouelette de queue en fonction de la gouverne de direction -->
  <animation>
    <type>rotate</type>
    <object-name>roueA</object-name>
    <property>/controls/flight/rudder</property>
    <factor> 20.0 </factor>
    <center>
      <x-m>  2.849 </x-m>
      <y-m>  0.000 </y-m>
      <z-m> -0.305 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation>

  <!-- Compression -->
  <animation>
    <type>translate</type>
    <object-name>roueG</object-name>
    <property>/gear/gear[0]/compression-norm</property>
    <interpolation>
      <entry><ind> 0 </ind><dep> 0.00 </dep></entry>
      <entry><ind> 1 </ind><dep> 0.15 </dep></entry>
    </interpolation>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>roueD</object-name>
    <property>/gear/gear[1]/compression-norm</property>
    <interpolation>
      <entry><ind> 0 </ind><dep> 0.00 </dep></entry>
      <entry><ind> 1 </ind><dep> 0.15 </dep></entry>
    </interpolation>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>roueA</object-name>
    <property>/gear/gear[2]/compression-norm</property>
    <interpolation>
      <entry><ind> 0 </ind><dep> 0.00 </dep></entry>
      <entry><ind> 1 </ind><dep> 0.15 </dep></entry>
    </interpolation>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation>

  <!-- Rotation des roues lors du roulage -->
  <animation>
    <type>spin</type>
    <object-name>roueG</object-name>
    <property>/gear/gear[0]/rollspeed-ms</property>
    <factor> 30 </factor>
    <center>
      <x-m> -1.349 </x-m>
      <y-m>  0.850 </y-m>
      <z-m> -0.921 </z-m>
    </center>
    <axis>
      <x>  0 </x>
      <y> -1 </y>
      <z>  0 </z>
    </axis>
  </animation>

  <animation>
    <type>spin</type>
    <object-name>roueD</object-name>
    <property>/gear/gear[1]/rollspeed-ms</property>
    <factor> 30 </factor>
    <center>
      <x-m> -1.349 </x-m>
      <y-m> -0.850 </y-m>
      <z-m> -0.921 </z-m>
    </center>
    <axis>
      <x>  0 </x>
      <y> -1 </y>
      <z>  0 </z>
    </axis>
  </animation>

  <animation>
    <type>spin</type>
    <object-name>roueA</object-name>
    <property>/gear/gear[2]/rollspeed-ms</property>
    <factor> 30 </factor>
    <center>
      <x-m>  2.849 </x-m>
      <y-m>  0.000 </y-m>
      <z-m> -0.305 </z-m>
    </center>
    <axis>
      <x>  0 </x>
      <y> -1 </y>
      <z>  0 </z>
    </axis>
  </animation>

</PropertyList>

