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

<PropertyList>

  <path>model17.ac</path>

  <nasal>
    <load>
      var livery_update = aircraft.livery_update.new("Aircraft/Beechcraft-Staggerwing/Models/Liveries", 10);

      var self = cmdarg();

      var float_0 = self.getNode("sim/multiplay/generic/float[0]", 1);
      var float_1 = self.getNode("sim/multiplay/generic/float[1]", 1);
      
      var crew_door = self.getNode("instrumentation/doors/crew/position-norm", 1);
      var passenger_door = self.getNode("instrumentation/doors/passenger/position-norm", 1);
    
      crew_door.alias(float_0);
      passenger_door.alias(float_1);
    </load>

    <unload>
      livery_update.stop();
      crew_door.unalias();
      passenger_door.unalias();
    </unload>
  </nasal>

  <animation>
    <!-- Objets opaques -->
    <object-name>capot</object-name>
    <object-name>fuselage</object-name>
    <object-name>porteG1</object-name>
    <object-name>porteG2</object-name>
    <object-name>porteD1</object-name>
    <object-name>porteD2</object-name>
    <object-name>porteAG</object-name>
    <object-name>porteAD</object-name>
    <object-name>ailesH</object-name>
    <object-name>aileronG</object-name>
    <object-name>aileronD</object-name>
    <object-name>ailesB</object-name>
    <object-name>voletG</object-name>
    <object-name>voletD</object-name>
    <object-name>ailes2</object-name>
    <object-name>profondeurG</object-name>
    <object-name>profondeurD</object-name>
    <object-name>direction</object-name>
    <object-name>aubans</object-name>
    <object-name>bol</object-name>
    <object-name>porte</object-name>

    <object-name>helice</object-name>
    <object-name>attache</object-name>
    <object-name>axeGA</object-name>
    <object-name>axeGB</object-name>
    <object-name>roueG</object-name>
    <object-name>axeDA</object-name>
    <object-name>axeDB</object-name>
    <object-name>roueD</object-name>
    <object-name>axeAA</object-name>
    <object-name>axeAB</object-name>
    <object-name>roueA</object-name>
    <object-name>echappements</object-name>
    <object-name>trous</object-name>

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

  <animation>
    <type>material</type>
    <object-name>capot</object-name>
    <object-name>fuselage</object-name>
    <object-name>porteG1</object-name>
    <object-name>porteG2</object-name>
    <object-name>porteD1</object-name>
    <object-name>porteD2</object-name>
    <object-name>porteAG</object-name>
    <object-name>porteAD</object-name>
    <object-name>ailesH</object-name>
    <object-name>aileronG</object-name>
    <object-name>aileronD</object-name>
    <object-name>ailesB</object-name>
    <object-name>voletG</object-name>
    <object-name>voletD</object-name>
    <object-name>ailes2</object-name>
    <object-name>profondeurG</object-name>
    <object-name>profondeurD</object-name>
    <object-name>direction</object-name>
    <object-name>aubans</object-name>
    <object-name>bol</object-name>
    <object-name>porte</object-name>

    <object-name>helice</object-name>
    <object-name>attache</object-name>
    <object-name>axeGA</object-name>
    <object-name>axeGB</object-name>
    <object-name>roueG</object-name>
    <object-name>axeDA</object-name>
    <object-name>axeDB</object-name>
    <object-name>roueD</object-name>
    <object-name>axeAA</object-name>
    <object-name>axeAB</object-name>
    <object-name>roueA</object-name>
    <object-name>echappements</object-name>
    <object-name>trous</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>

  <effect>
    <inherits-from>Aircraft/Generic/Effects/Fuselagereflect</inherits-from>
    <object-name>capot</object-name>
    <object-name>fuselage</object-name>
    <object-name>porteG1</object-name>
    <object-name>porteG2</object-name>
    <object-name>porteD1</object-name>
    <object-name>porteD2</object-name>
    <object-name>porteAG</object-name>
    <object-name>porteAD</object-name>
    <object-name>ailesH</object-name>
    <object-name>aileronG</object-name>
    <object-name>aileronD</object-name>
    <object-name>ailesB</object-name>
    <object-name>voletG</object-name>
    <object-name>voletD</object-name>
    <object-name>ailes2</object-name>
    <object-name>profondeurG</object-name>
    <object-name>profondeurD</object-name>
    <object-name>direction</object-name>
    <object-name>aubans</object-name>
    <object-name>bol</object-name>
    <object-name>porte</object-name>
  </effect>

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

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

  <!-- Le moteur -->
  <model>
    <path>Aircraft/Beechcraft-Staggerwing/Models/Engine/engine.xml</path>
    <offsets>
      <x-m> -3.340 </x-m>
      <y-m>  0.000 </y-m>
      <z-m> -0.033 </z-m>
      <pitch-deg> -4 </pitch-deg>
    </offsets>
  </model>

  <!-- Une ombre pour OSG -->
  <model>
    <path>Aircraft/Beechcraft-Staggerwing/Models/shadow.xml</path>
    <offsets>
      <x-m>  0.000 </x-m>
      <y-m>  0.000 </y-m>
      <z-m> -1.500 </z-m>
    </offsets>
  </model>

  <!-- L'interieur -->
  <model>
    <path>Aircraft/Beechcraft-Staggerwing/Models/Interior/interior.xml</path>
  </model>

  <!-- Cranking effects -->
  <!-- Left -->
  <model>
    <path>Aircraft/Beechcraft-Staggerwing/Models/Effects/cranking/cranking.xml</path>
    <offsets>
      <x-m> -3.044 </x-m>
      <y-m> -0.245 </y-m>
      <z-m> -0.689 </z-m>
      <pitch-deg>  45 </pitch-deg>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Beechcraft-Staggerwing/Models/Effects/cranking/cranking.xml</path>
    <offsets>
      <x-m> -3.044 </x-m>
      <y-m>  0.245 </y-m>
      <z-m> -0.689 </z-m>
      <pitch-deg>  45 </pitch-deg>
    </offsets>
  </model>

  <!-- Effets sur le sol -->
  <!-- Roue gauche -->
  <model>
    <path>Aircraft/Beechcraft-Staggerwing/Models/Effects/ground/ground0.xml</path>
    <offsets>
      <x-m> -2.102 </x-m>
      <y-m> -1.108 </y-m>
      <z-m> -1.718 </z-m>
    </offsets>
  </model>

  <!-- Roue de droite -->
  <model>
    <path>Aircraft/Beechcraft-Staggerwing/Models/Effects/ground/ground1.xml</path>   
    <offsets>
      <x-m> -2.102 </x-m>
      <y-m>  1.108 </y-m>
      <z-m> -1.718 </z-m>
    </offsets>
  </model>

  <!-- Roue de queue -->
  <model>
    <path>Aircraft/Beechcraft-Staggerwing/Models/Effects/ground/ground2.xml</path>
    <offsets>
      <x-m> -3.112 </x-m>
      <y-m>  0.000 </y-m>
      <z-m> -0.395 </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>
    <axis>
      <x1-m> -4.062 </x1-m>
      <y1-m>  0.000 </y1-m>
      <z1-m> -0.073 </z1-m>
      <x2-m> -3.626 </x2-m>
      <y2-m>  0.000 </y2-m>
      <z2-m> -0.042 </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 </factor>
    <axis>
      <x1-m> -0.508 </x1-m>
      <y1-m> -4.233 </y1-m>
      <z1-m>  0.861 </z1-m>
      <x2-m> -0.480 </x2-m>
      <y2-m> -1.193 </y2-m>
      <z2-m>  0.848 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>aileronD</object-name>
    <property>surface-positions/right-aileron-pos-norm</property>
    <factor> 15 </factor>
    <axis>
      <x1-m> -0.480 </x1-m>
      <y1-m>  1.193 </y1-m>
      <z1-m>  0.848 </z1-m>
      <x2-m> -0.508 </x2-m>
      <y2-m>  4.233 </y2-m>
      <z2-m>  0.861 </z2-m>
    </axis>
  </animation>

  <!-- Gouverne de direction -->
  <animation>
    <type>rotate</type>
    <object-name>direction</object-name>
    <property>surface-positions/rudder-pos-norm</property>
    <factor> 20 </factor>
    <axis>
      <x1-m> 3.450 </x1-m>
      <y1-m> 0.000 </y1-m>
      <z1-m> 0.037 </z1-m>
      <x2-m> 3.399 </x2-m>
      <y2-m> 0.000 </y2-m>
      <z2-m> 1.583 </z2-m>
    </axis>
 </animation>

  <!-- Gouverne de profondeur -->
  <animation>
    <type>rotate</type>
    <object-name>profondeurG</object-name>
    <property>surface-positions/elevator-pos-norm</property>
    <factor> 15 </factor>
    <axis>
      <x1-m>  3.427 </x1-m>
      <y1-m> -1.781 </y1-m>
      <z1-m>  0.374 </z1-m>
      <x2-m>  3.456 </x2-m>
      <y2-m> -0.101 </y2-m>
      <z2-m>  0.398 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>profondeurD</object-name>
    <property>surface-positions/elevator-pos-norm</property>
    <factor> 15 </factor>
    <axis>
      <x1-m> 3.456 </x1-m>
      <y1-m> 0.101 </y1-m>
      <z1-m> 0.398 </z1-m>
      <x2-m> 3.427 </x2-m>
      <y2-m> 1.781 </y2-m>
      <z2-m> 0.374 </z2-m>
    </axis>
  </animation>

  <!-- Volets -->
  <animation>
    <type>rotate</type>
    <object-name>voletG</object-name>
    <property>surface-positions/flap-pos-norm</property>
    <factor> 40 </factor>
    <axis>
      <x1-m> -1.151 </x1-m>
      <y1-m> -4.230 </y1-m>
      <z1-m> -0.686 </z1-m>
      <x2-m> -1.151 </x2-m>
      <y2-m> -1.195 </y2-m>
      <z2-m> -0.796 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>voletD</object-name>
    <property>surface-positions/flap-pos-norm</property>
    <factor> 40 </factor>
    <axis>
      <x1-m> -1.151 </x1-m>
      <y1-m>  1.195 </y1-m>
      <z1-m> -0.796 </z1-m>
      <x2-m> -1.151 </x2-m>
      <y2-m>  4.230 </y2-m>
      <z2-m> -0.686 </z2-m>
    </axis>
  </animation>

  <!-- Fermeture des portes des trains -->
  <!-- Gauche -->
  <animation>
    <name>PorteGauche</name>
    <object-name>porteG1</object-name>
    <object-name>porteG2</object-name>
  </animation>

  <animation>
    <name>PorteDroite</name>
    <object-name>porteD1</object-name>
    <object-name>porteD2</object-name>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>porteG2</object-name>
    <property>gear/gear[0]/position-norm</property>
    <interpolation>
      <entry><ind>  0 </ind><dep>   0 </dep></entry>
      <entry><ind>  1 </ind><dep> -80 </dep></entry>
    </interpolation>
    <axis>
      <x1-m> -2.431 </x1-m>
      <y1-m> -0.308 </y1-m>
      <z1-m> -0.718 </z1-m>
      <x2-m> -1.811 </x2-m>
      <y2-m> -0.308 </y2-m>
      <z2-m> -0.814 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>PorteGauche</object-name>
    <property>gear/gear[0]/position-norm</property>
    <interpolation>
      <entry><ind>  0 </ind><dep>    0 </dep></entry>
      <entry><ind>  1 </ind><dep> -108 </dep></entry>
    </interpolation>
    <axis>
      <x1-m> -2.078 </x1-m>
      <y1-m> -1.143 </y1-m>
      <z1-m> -0.793 </z1-m>
      <x2-m> -1.308 </x2-m>
      <y2-m> -1.143 </y2-m>
      <z2-m> -0.802 </z2-m>
    </axis>
  </animation>

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

  <animation>
    <type>rotate</type>
    <object-name>porteD2</object-name>
    <property>gear/gear[1]/position-norm</property>
    <interpolation>
      <entry><ind>  0 </ind><dep>  0 </dep></entry>
      <entry><ind>  1 </ind><dep> 80 </dep></entry>
    </interpolation>
    <axis>
      <x1-m> -2.431 </x1-m>
      <y1-m>  0.308 </y1-m>
      <z1-m> -0.718 </z1-m>
      <x2-m> -1.811 </x2-m>
      <y2-m>  0.308 </y2-m>
      <z2-m> -0.814 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>PorteDroite</object-name>
    <property>gear/gear[1]/position-norm</property>
    <interpolation>
      <entry><ind>  0 </ind><dep>   0 </dep></entry>
      <entry><ind>  1 </ind><dep> 108 </dep></entry>
    </interpolation>
    <axis>
      <x1-m> -2.078 </x1-m>
      <y1-m>  1.143 </y1-m>
      <z1-m> -0.793 </z1-m>
      <x2-m> -1.308 </x2-m>
      <y2-m>  1.143 </y2-m>
      <z2-m> -0.802 </z2-m>
    </axis>
  </animation>

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

  <animation>
    <type>rotate</type>
    <object-name>porteAG</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> -95 </dep></entry>
      <entry><ind> 1.0 </ind><dep> -95 </dep></entry>
    </interpolation>
    <axis>
      <x1-m>  2.739 </x1-m>
      <y1-m> -0.066 </y1-m>
      <z1-m> -0.072 </z1-m>
      <x2-m>  3.311 </x2-m>
      <y2-m> -0.066 </y2-m>
      <z2-m>  0.010 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>porteAD</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> -95 </dep></entry>
      <entry><ind> 1.0 </ind><dep> -95 </dep></entry>
    </interpolation>
    <axis>
      <x1-m>  3.311 </x1-m>
      <y1-m>  0.066 </y1-m>
      <z1-m>  0.010 </z1-m>
      <x2-m>  2.739 </x2-m>
      <y2-m>  0.066 </y2-m>
      <z2-m> -0.072 </z2-m>
    </axis>
  </animation>

  <!-- Rentrée des roues -->
  <animation>
    <name>TrainGauche</name>
    <object-name>axeGA</object-name>
    <object-name>axeGB</object-name>
    <object-name>roueG</object-name>
  </animation>

  <animation>
    <name>TrainDroit</name>
    <object-name>axeDA</object-name>
    <object-name>axeDB</object-name>
    <object-name>roueD</object-name>
  </animation>

  <animation>
    <name>TrainArriere</name>
    <object-name>axeAA</object-name>
    <object-name>axeAB</object-name>
    <object-name>roueA</object-name>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>TrainGauche</object-name>
    <property>gear/gear[0]/position-norm</property>
    <interpolation>
      <entry><ind> 0 </ind><dep> 95 </dep></entry>
      <entry><ind> 1 </ind><dep>  0 </dep></entry>
    </interpolation>
    <center>
      <x-m> -2.114 </x-m>
      <y-m> -1.108 </y-m>
      <z-m> -0.662 </z-m>
    </center>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>TrainDroit</object-name>
    <property>gear/gear[1]/position-norm</property>
    <interpolation>
      <entry><ind> 0 </ind><dep> -95 </dep></entry>
      <entry><ind> 1 </ind><dep>   0 </dep></entry>
    </interpolation>
    <center>
      <x-m> -2.114 </x-m>
      <y-m>  1.108 </y-m>
      <z-m> -0.662 </z-m>
    </center>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>TrainArriere</object-name>
    <property>gear/gear[2]/position-norm</property>
    <interpolation>
      <entry><ind> 0 </ind><dep> 0.4 </dep></entry>
      <entry><ind> 1 </ind><dep> 0.0 </dep></entry>
    </interpolation>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation>

  <!-- Animation des portes -->
  <animation>
    <name>LaPorte</name>
    <object-name>porte</object-name>
    <object-name>vitreporte</object-name>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>LaPorte</object-name>
    <property>instrumentation/doors/crew/position-norm</property>
    <factor> -130 </factor>
    <axis>
      <x1-m> -1.379 </x1-m>
      <y1-m> -0.724 </y1-m>
      <z1-m> -0.103 </z1-m>
      <x2-m> -1.379 </x2-m>
      <y2-m> -0.730 </y2-m>
      <z2-m>  0.243 </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.114 </x-m>
      <y-m> -1.108 </y-m>
      <z-m> -1.423 </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.114 </x-m>
      <y-m>  1.108 </y-m>
      <z-m> -1.423 </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>  3.107 </x-m>
      <y-m>  0.000 </y-m>
      <z-m> -0.266 </z-m>
    </center>
    <axis>
      <x>  0 </x>
      <y> -1 </y>
      <z>  0 </z>
    </axis>
  </animation>

  <!-- Ajout des effets lumineux -->
  <model>
    <path>Aircraft/Beechcraft-Staggerwing/Models/lights/beacon.xml</path>
    <offsets>
      <x-m> 3.399 </x-m>
      <y-m> 0.000 </y-m>
      <z-m> 1.715 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Beechcraft-Staggerwing/Models/lights/RedLight.xml</path>
    <offsets>
      <x-m> -1.651 </x-m>
      <y-m> -4.867 </y-m>
      <z-m> -0.556 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Beechcraft-Staggerwing/Models/lights/GreenLight.xml</path>
    <offsets>
      <x-m> -1.651 </x-m>
      <y-m>  4.867 </y-m>
      <z-m> -0.556 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Beechcraft-Staggerwing/Models/lights/StrobeWhite.xml</path>
    <offsets>
      <x-m> -1.648 </x-m>
      <y-m> -4.867 </y-m>
      <z-m> -0.556 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Beechcraft-Staggerwing/Models/lights/StrobeWhite.xml</path>
    <offsets>
      <x-m> -1.648 </x-m>
      <y-m>  4.867 </y-m>
      <z-m> -0.556 </z-m>
    </offsets>
  </model>

</PropertyList>

