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

<PropertyList>

  <path>ju87.ac</path>

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

  <animation>
    <!-- draw these first (in no particular order) -->
    <object-name>fuselage</object-name>
    <object-name>ailes</object-name>
    <object-name>aileronG</object-name>
    <object-name>aileronD</object-name>
    <object-name>voletG1</object-name>
    <object-name>voletG2</object-name>
    <object-name>voletD1</object-name>
    <object-name>voletD2</object-name>
    <object-name>bol</object-name>
    <object-name>derive</object-name>
    <object-name>profondeur</object-name>
    <object-name>direction</object-name>
    <object-name>ajouts</object-name>
    <object-name>ajoutsprof</object-name>
    <object-name>roueG</object-name>
    <object-name>roueD</object-name>
    <object-name>roueA</object-name>
    <object-name>helice</object-name>
    <object-name>caches</object-name>
    <object-name>pieds</object-name>
    <object-name>antenne</object-name>
    <object-name>piedsirene</object-name>
    <object-name>bolsirene</object-name>
    <object-name>helicesirene</object-name>
    <object-name>echappes</object-name>
    <object-name>verriere</object-name>
    <object-name>sousair</object-name>
    <object-name>freins</object-name>
    <object-name>barres</object-name>
    <object-name>rebords</object-name>

    <!-- draw this at last (order critical!) -->
    <object-name>vitres</object-name>
    <object-name>propblur</object-name>
    <object-name>propdisc</object-name>
    <object-name>propblursirene</object-name>
    <object-name>propdiscsirene</object-name>
    <object-name>verrieretransp</object-name>
  </animation>

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

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

  <animation>
    <type>material</type>
    <object-name>fuselage</object-name>
    <object-name>ailes</object-name>
    <object-name>aileronG</object-name>
    <object-name>aileronD</object-name>
    <object-name>voletG1</object-name>
    <object-name>voletG2</object-name>
    <object-name>voletD1</object-name>
    <object-name>voletD2</object-name>
    <object-name>bol</object-name>
    <object-name>derive</object-name>
    <object-name>profondeur</object-name>
    <object-name>direction</object-name>
    <object-name>ajouts</object-name>
    <object-name>ajoutsprof</object-name>
    <object-name>roueG</object-name>
    <object-name>roueD</object-name>
    <object-name>roueA</object-name>
    <object-name>helice</object-name>
    <object-name>caches</object-name>
    <object-name>pieds</object-name>
    <object-name>antenne</object-name>
    <object-name>piedsirene</object-name>
    <object-name>bolsirene</object-name>
    <object-name>helicesirene</object-name>
    <object-name>echappes</object-name>
    <object-name>verriere</object-name>
    <object-name>sousair</object-name>
    <object-name>freins</object-name>
    <object-name>barres</object-name>
    <object-name>rebords</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>

  <!-- Interior -->
  <model>
    <path>Aircraft/Ju-87/Models/Interior/interior.xml</path>
    <offsets>
      <x-m> 0 </x-m>
      <y-m> 0 </y-m>
      <z-m> 0 </z-m>
    </offsets>
  </model>

  <!-- Bomb/Torpedo add by David HAREL thanks to him -->
  <model>
    <path>Aircraft/Ju-87/Models/Effects/bomb.xml</path>
    <offsets>
      <x-m> -1.565 </x-m>
      <y-m>  0.000 </y-m>
      <z-m> -0.434 </z-m>
    </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> -5.000 </x-m>
      <y-m>  0.000 </y-m>
      <z-m>  0.245 </z-m>
    </center>
    <axis>
      <x> -1 </x>
      <y>  0 </y>
      <z>  0 </z>
    </axis>
  </animation>

  <!-- Gouvernes de profondeur -->
  <animation>
    <name>ProfondeurTotal</name>
    <object-name>profondeur</object-name>
    <object-name>ajoutsprof</object-name>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>ProfondeurTotal</object-name>
    <property>/controls/flight/elevator</property>
    <factor> 20 </factor>
    <center>
      <x-m> 4.413 </x-m>
      <y-m> 0.000 </y-m>
      <z-m> 0.736 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 1 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <!-- L'hélice de la sirène --> 
  <animation>
    <name>HeliceCompleteSirene</name>
    <object-name>propdiscsirene</object-name>
    <object-name>propblursirene</object-name>
    <object-name>helicesirene</object-name>
    <object-name>bolsirene</object-name>
  </animation>

  <!-- Séléction de l'objet visible en fonction de la vitesse -->
  <animation>
    <type>select</type>
    <object-name>propdiscsirene</object-name>
    <condition>
      <greater-than>
        <property>/instrumentation/airspeed-indicator/indicated-speed-kt</property>
        <value>200</value>
      </greater-than>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>propblursirene</object-name>
    <condition>
    <and>
      <greater-than>
        <property>/instrumentation/airspeed-indicator/indicated-speed-kt</property>
        <value>100.000</value>
      </greater-than>
      <less-than>
        <property>/instrumentation/airspeed-indicator/indicated-speed-kt</property>
        <value>200.001</value>
      </less-than>
    </and>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>helicesirene</object-name>
    <condition>
      <less-than>
        <property>/instrumentation/airspeed-indicator/indicated-speed-kt</property>
        <value>150</value>
      </less-than>
    </condition>
  </animation>

  <animation>
    <type>spin</type>
    <object-name>HeliceCompleteSirene</object-name>
    <property>/instrumentation/airspeed-indicator/indicated-speed-kt</property>
    <factor> 8 </factor>
    <center>
      <x-m> -2.518 </x-m>
      <y-m> -1.636 </y-m>
      <z-m> -0.655 </z-m>
    </center>
    <axis>
      <x> -1 </x>
      <y>  0 </y>
      <z>  0 </z>
    </axis>
  </animation>

  <!-- Gouvernes de profondeur -->
  <animation>
    <name>ProfondeurTotal</name>
    <object-name>profondeur</object-name>
    <object-name>ajoutsprof</object-name>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>ProfondeurTotal</object-name>
    <property>/controls/flight/elevator</property>
    <factor> 13 </factor>
    <center>
      <x-m> 4.413 </x-m>
      <y-m> 0.000 </y-m>
      <z-m> 0.736 </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> 13 </factor>
    <center>
      <x-m> 4.903 </x-m>
      <y-m> 0.000 </y-m>
      <z-m> 0.279 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation>

  <!-- Animations des ailerons -->
  <animation>
    <type>rotate</type>
    <object-name>aileronG</object-name>
    <property>/surface-positions/left-aileron-pos-norm</property>
    <interpolation>
      <entry><ind> -0.75 </ind><dep> -15.0 </dep></entry>
      <entry><ind>  0.00 </ind><dep>   0.0 </dep></entry>
      <entry><ind>  0.75 </ind><dep>  15.0 </dep></entry>
    </interpolation>
    <axis>
      <x1-m> -1.591 </x1-m>
      <y1-m> -6.692 </y1-m>
      <z1-m>  0.430 </z1-m>
      <x2-m> -0.706 </x2-m>
      <y2-m> -4.227 </y2-m>
      <z2-m>  0.018 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>aileronD</object-name>
    <property>/surface-positions/right-aileron-pos-norm</property>
    <interpolation>
      <entry><ind> -0.75 </ind><dep> -15.0 </dep></entry>
      <entry><ind>  0.00 </ind><dep>   0.0 </dep></entry>
      <entry><ind>  0.75 </ind><dep>  15.0 </dep></entry>
    </interpolation>
    <axis>
      <x1-m> -0.706 </x1-m>
      <y1-m>  4.227 </y1-m>
      <z1-m>  0.018 </z1-m>
      <x2-m> -1.591 </x2-m>
      <y2-m>  6.692 </y2-m>
      <z2-m>  0.430 </z2-m>
    </axis>
  </animation>

  <!-- Volets -->
  <animation>
    <type>rotate</type>
    <object-name>voletG1</object-name>
    <property>/surface-positions/flaps-pos-norm</property>
    <factor>60.0</factor>
    <axis>
      <x1-m> -0.114 </x1-m>
      <y1-m> -1.546 </y1-m>
      <z1-m> -0.438 </z1-m>
      <x2-m>  0.175 </x2-m>
      <y2-m> -0.635 </y2-m>
      <z2-m> -0.218 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>voletG2</object-name>
    <property>/surface-positions/flaps-pos-norm</property>
    <factor>60.0</factor>
    <axis>
      <x1-m> -0.690 </x1-m>
      <y1-m> -4.165 </y1-m>
      <z1-m> -0.018 </z1-m>
      <x2-m> -0.150 </x2-m>
      <y2-m> -1.667 </y2-m>
      <z2-m> -0.438 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>voletD1</object-name>
    <property>/surface-positions/flaps-pos-norm</property>
    <factor>60.0</factor>
    <axis>
      <x1-m>  0.175 </x1-m>
      <y1-m>  0.635 </y1-m>
      <z1-m> -0.218 </z1-m>
      <x2-m> -0.114 </x2-m>
      <y2-m>  1.546 </y2-m>
      <z2-m> -0.438 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>voletD2</object-name>
    <property>/surface-positions/flaps-pos-norm</property>
    <factor>60.0</factor>
    <axis>
      <x1-m> -0.150 </x1-m>
      <y1-m>  1.667 </y1-m>
      <z1-m> -0.438 </z1-m>
      <x2-m> -0.690 </x2-m>
      <y2-m>  4.165 </y2-m>
      <z2-m> -0.018 </z2-m>
    </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> -2.644 </x-m>
      <y-m> -1.636 </y-m>
      <z-m> -1.535 </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> -2.644 </x-m>
      <y-m>  1.636 </y-m>
      <z-m> -1.535 </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[1]/rollspeed-ms</property>
    <factor> 30 </factor>
    <center>
      <x-m>  4.619 </x-m>
      <y-m>  0.000 </y-m>
      <z-m> -0.312 </z-m>
    </center>
    <axis>
      <x>  0 </x>
      <y> -1 </y>
      <z>  0 </z>
    </axis>
  </animation>

  <!-- Canopy -->
  <animation>
    <name>Canopy</name>
    <object-name>verriere</object-name>
    <object-name>verrieretransp</object-name>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>Canopy</object-name>
    <property>/instrumentation/doors/crew/position-norm</property>
    <interpolation>
      <entry><ind> 0 </ind><dep> 0.0 </dep></entry>
      <entry><ind> 1 </ind><dep> 0.7 </dep></entry>
    </interpolation>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

</PropertyList>

