<?xml version="1.0" encoding="ISO-8859-1"?>

<PropertyList>

  <path>pa350cd.ac</path>

  <nasal>
    <load>
      var livery_update = aircraft.livery_update.new("Aircraft/payen-pa350cd/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("sim/model/door-positions/crew/position-norm", 1);
      var passenger_door = self.getNode("sim/model/door-positions/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>fuselage</object-name>
    <object-name>ailes</object-name>
    <object-name>profondeurG</object-name>
    <object-name>profondeurD</object-name>
    <object-name>aileronG</object-name>
    <object-name>aileronD</object-name>
    <object-name>directionG</object-name>
    <object-name>directionD</object-name>
    <object-name>bol1</object-name>
    <object-name>bol2</object-name>
    <object-name>porteG</object-name>
    <object-name>porteD</object-name>
    <object-name>derives</object-name>
    <object-name>canopy</object-name>
    
    <object-name>trous</object-name>
    <object-name>axe</object-name>
    <object-name>essieu</object-name>
    <object-name>roueA</object-name>
    <object-name>roueG</object-name>
    <object-name>roueD</object-name>
    <object-name>helice1</object-name>
    <object-name>helice2</object-name>
    <object-name>echappe</object-name>
    
    <!-- Objets transparents -->
   <object-name>vitres</object-name>
   <object-name>propdisc1</object-name>
   <object-name>propblur1</object-name>
   <object-name>propdisc2</object-name>
   <object-name>propblur2</object-name>
 </animation>

  <animation>
    <type>material</type>
    <object-name>fuselage</object-name>
    <object-name>ailes</object-name>
    <object-name>profondeurG</object-name>
    <object-name>profondeurD</object-name>
    <object-name>aileronG</object-name>
    <object-name>aileronD</object-name>
    <object-name>directionG</object-name>
    <object-name>directionD</object-name>
    <object-name>bol1</object-name>
    <object-name>bol2</object-name>
    <object-name>porteG</object-name>
    <object-name>porteD</object-name>
    <object-name>derives</object-name>
    <object-name>canopy</object-name>
    
    <object-name>trous</object-name>
    <object-name>axe</object-name>
    <object-name>essieu</object-name>
    <object-name>roueA</object-name>
    <object-name>roueG</object-name>
    <object-name>roueD</object-name>
    <object-name>helice1</object-name>
    <object-name>helice2</object-name>
    <object-name>echappe</object-name>

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

  <effect>
    <inherits-from>Aircraft/Generic/Effects/Fuselagereflect</inherits-from>
    <object-name>fuselage</object-name>
    <object-name>ailes</object-name>
    <object-name>profondeurG</object-name>
    <object-name>profondeurD</object-name>
    <object-name>aileronG</object-name>
    <object-name>aileronD</object-name>
    <object-name>directionG</object-name>
    <object-name>directionD</object-name>
    <object-name>bol1</object-name>
    <object-name>bol2</object-name>
    <object-name>porteG</object-name>
    <object-name>porteD</object-name>
    <object-name>derives</object-name>
    <object-name>canopy</object-name>
  </effect>
  
  <!-- working for Rembrandt -->
  <effect>
    <inherits-from>Aircraft/payen-pa350cd/Models/Effects/Glass/glass</inherits-from>
    <object-name>vitres</object-name>
  </effect>
  
  <effect>
    <inherits-from>Effects/model-transparent</inherits-from>
    <object-name>vitres</object-name>
  </effect>
  
  <!-- Une ombre pour OSG -->
  <model>
    <path>Aircraft/payen-pa350cd/Models/shadow.xml</path>
    <offsets>
      <x-m>  0.0 </x-m>
      <y-m>  0.0 </y-m>
      <z-m> -0.8 </z-m>
    </offsets>
  </model>
  
  <!-- Cranking effects -->
  <model>
    <path>Aircraft/payen-pa350cd/Models/Effects/cranking/cranking.xml</path>
    <offsets>
      <x-m> -2.11888 </x-m>
      <y-m> -0.25756 </y-m>
      <z-m> -0.44943 </z-m>
    </offsets>
  </model>
  
  <model>
    <path>Aircraft/payen-pa350cd/Models/Effects/cranking/cranking.xml</path>
    <offsets>
      <x-m> -1.92626 </x-m>
      <y-m> -0.26700 </y-m>
      <z-m> -0.45030 </z-m>
    </offsets>
  </model>
  
  <model>
    <path>Aircraft/payen-pa350cd/Models/Effects/cranking/cranking.xml</path>
    <offsets>
      <x-m> -1.72583 </x-m>
      <y-m> -0.26889 </y-m>
      <z-m> -0.45048 </z-m>
    </offsets>
  </model>
  
  <model>
    <path>Aircraft/payen-pa350cd/Models/Effects/cranking/cranking.xml</path>
    <offsets>
      <x-m> -1.54094 </x-m>
      <y-m> -0.26606 </y-m>
      <z-m> -0.45022 </z-m>
    </offsets>
  </model>
  
  <!-- Effets sur le sol -->
  <!-- Roue central -->
  <model>
    <path>Aircraft/payen-pa350cd/Models/Effects/ground/ground0.xml</path>
    <offsets>
      <x-m> -0.99707 </x-m>
      <y-m>  0.00000 </y-m>
      <z-m> -1.30870 </z-m>
    </offsets>
  </model>
  
  <!-- Roue gauche -->
  <model>
    <path>Aircraft/payen-pa350cd/Models/Effects/ground/ground1.xml</path>
    <offsets>
      <x-m>  2.91478 </x-m>
      <y-m> -1.33575 </y-m>
      <z-m> -0.23592 </z-m>
    </offsets>
  </model>
  
  <!-- Roue droie -->
  <model>
    <path>Aircraft/payen-pa350cd/Models/Effects/ground/ground2.xml</path>   
    <offsets>
      <x-m>  2.91478 </x-m>
      <y-m>  1.33575 </y-m>
      <z-m> -0.23592 </z-m>
    </offsets>
  </model>
  
  <!-- Interieur -->
  <model>
    <path>Aircraft/payen-pa350cd/Models/Interior/interior.xml</path>
  </model>
 
  <!-- Les hélices --> 
  <animation>
    <name>HeliceComplete1</name>
    <object-name>propdisc1</object-name>
    <object-name>propblur1</object-name>
    <object-name>helice1</object-name>
    <object-name>bol1</object-name>
  </animation>

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

  <animation>
    <type>select</type>
    <object-name>propblur1</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>helice1</object-name>
    <condition>
      <less-than>
        <property>/engines/engine[0]/rpm</property>
        <value>1500</value>
      </less-than>
    </condition>
  </animation>

  <animation>
    <type>spin</type>
    <object-name>HeliceComplete1</object-name>
    <condition>
      <greater-than>
        <property>engines/engine[0]/rpm</property>
        <value> 5 </value>
      </greater-than>
    </condition>
    <property>/engines/engine[0]/rpm</property>
    <factor> 0.5 </factor>
    <center>
      <x-m> -2.979 </x-m>
      <y-m>  0.000 </y-m>
      <z-m>  0.069 </z-m>
    </center>
    <axis>
      <x> -1 </x>
      <y>  0 </y>
      <z>  0 </z>
    </axis>
  </animation>

  <animation>
    <name>HeliceComplete2</name>
    <object-name>propdisc2</object-name>
    <object-name>propblur2</object-name>
    <object-name>helice2</object-name>
    <object-name>bol2</object-name>
  </animation>

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

  <animation>
    <type>select</type>
    <object-name>propblur2</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>helice2</object-name>
    <condition>
      <less-than>
        <property>/engines/engine[0]/rpm</property>
        <value>1500</value>
      </less-than>
    </condition>
  </animation>

  <animation>
    <type>spin</type>
    <object-name>HeliceComplete2</object-name>
    <condition>
      <greater-than>
        <property>engines/engine[0]/rpm</property>
        <value> 5 </value>
      </greater-than>
    </condition>
    <property>/engines/engine[0]/rpm</property>
    <factor> 0.5 </factor>
    <center>
      <x-m> -2.749 </x-m>
      <y-m>  0.000 </y-m>
      <z-m>  0.069 </z-m>
    </center>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </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> -0.72868 </x1-m>
      <y1-m> -1.44585 </y1-m>
      <z1-m>  0.10250 </z1-m>
      <x2-m> -0.44385 </x2-m>
      <y2-m> -0.54894 </y2-m>
      <z2-m>  0.10152 </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> -0.44385 </x1-m>
      <y1-m>  0.54894 </y1-m>
      <z1-m>  0.10152 </z1-m>
      <x2-m> -0.72868 </x2-m>
      <y2-m>  1.44585 </y2-m>
      <z2-m>  0.10250 </z2-m>
    </axis>
  </animation>

  <!-- Gouverne de direction -->
  <animation>
    <type>rotate</type>
    <object-name>directionG</object-name>
    <property>surface-positions/rudder-pos-norm</property>
    <factor> 15 </factor>
    <axis>
      <x1-m>  3.02684 </x1-m>
      <y1-m> -1.33578 </y1-m>
      <z1-m> -0.14069 </z1-m>
      <x2-m>  2.89424 </x2-m>
      <y2-m> -1.33579 </y2-m>
      <z2-m>  0.43337 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>directionD</object-name>
    <property>surface-positions/rudder-pos-norm</property>
    <factor> 15 </factor>
    <axis>
      <x1-m>  3.02684 </x1-m>
      <y1-m>  1.33578 </y1-m>
      <z1-m> -0.14069 </z1-m>
      <x2-m>  2.89424 </x2-m>
      <y2-m>  1.33579 </y2-m>
      <z2-m>  0.43337 </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>  2.80319 </x1-m>
      <y1-m> -1.22397 </y1-m>
      <z1-m>  0.52522 </z1-m>
      <x2-m>  2.80767 </x2-m>
      <y2-m> -0.39845 </y2-m>
      <z2-m>  0.25620 </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> 2.80767 </x1-m>
      <y1-m> 0.39845 </y1-m>
      <z1-m> 0.25620 </z1-m>
      <x2-m> 2.80319 </x2-m>
      <y2-m> 1.22397 </y2-m>
      <z2-m> 0.52522 </z2-m>
    </axis>
  </animation>

  <!-- Rentré du train avant -->
  <animation>
    <name>TrainAvant</name>
    <object-name>axe</object-name>
    <object-name>essieu</object-name>
    <object-name>roueA</object-name>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>TrainAvant</object-name>
    <property>/gear/gear[0]/position-norm</property>
    <interpolation>
      <entry><ind> 0 </ind><dep> -100 </dep></entry>
      <entry><ind> 1 </ind><dep>    0 </dep></entry>
    </interpolation>
    <center>
      <x-m> -1.080 </x-m>
      <y-m>  0.000 </y-m>
      <z-m> -0.404 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 1 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <!-- Ouverture/fermeture des portes du train avant -->
  <animation>
    <type>rotate</type>
    <object-name>porteG</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> 1.0 </ind><dep> -90 </dep></entry>
    </interpolation>
    <axis>
      <x1-m> -0.944 </x1-m>
      <y1-m> -0.208 </y1-m>
      <z1-m> -0.470 </z1-m>
      <x2-m> -0.244 </x2-m>
      <y2-m> -0.165 </y2-m>
      <z2-m> -0.470 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>porteD</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> 1.0 </ind><dep> 90 </dep></entry>
    </interpolation>
    <axis>
      <x1-m> -0.944 </x1-m>
      <y1-m>  0.208 </y1-m>
      <z1-m> -0.470 </z1-m>
      <x2-m> -0.244 </x2-m>
      <y2-m>  0.165 </y2-m>
      <z2-m> -0.470 </z2-m>
    </axis>
  </animation>

  <!-- Rotation de la roue avant en fonction de la gouverne de direction -->
  <animation>
    <type>rotate</type>
    <object-name>roueA</object-name>
    <property>surface-positions/rudder-pos-norm</property>
    <factor> -10 </factor>
    <center>
     <x-m> -1.080 </x-m>
     <y-m>  0.000 </y-m>
     <z-m> -0.404 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation>

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

  <animation>
    <type>spin</type>
    <object-name>roueG</object-name>
    <property>/gear/gear[1]/rollspeed-ms</property>
    <factor> 30 </factor>
    <center>
      <x-m>  2.915 </x-m>
      <y-m> -1.336 </y-m>
      <z-m> -0.202 </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[2]/rollspeed-ms</property>
    <factor> 30 </factor>
    <center>
      <x-m>  2.915 </x-m>
      <y-m>  1.336 </y-m>
      <z-m> -0.202 </z-m>
    </center>
    <axis>
      <x>  0 </x>
      <y> -1 </y>
      <z>  0 </z>
    </axis>
  </animation>

  <!-- Canopy -->
  <animation>
    <name>AllCanopy</name>
    <object-name>canopy</object-name>
    <object-name>vitres</object-name>
  </animation>
  
  <animation>
    <type>pick</type>
    <object-name>AllCanopy</object-name>
    <visible>true</visible>
    <action>
      <button>0</button>
      <repeatable>false</repeatable>
      <binding>
        <command>nasal</command>
        <script>doors.crew.toggle();</script>
      </binding>
    </action>
  </animation>
  
  <animation>
    <type>translate</type>
    <object-name>AllCanopy</object-name>
    <property>sim/model/door-positions/crew/position-norm</property>
    <interpolation>
      <entry><ind> 0.00 </ind><dep> 0.00 </dep></entry>
      <entry><ind> 0.03 </ind><dep> 0.02 </dep></entry>
      <entry><ind> 1.00 </ind><dep> 0.02 </dep></entry>
    </interpolation>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>AllCanopy</object-name>
    <property>sim/model/door-positions/crew/position-norm</property>
    <interpolation>
      <entry><ind> 0.00 </ind><dep> 0.0 </dep></entry>
      <entry><ind> 0.03 </ind><dep> 0.0 </dep></entry>
      <entry><ind> 1.00 </ind><dep> 0.8 </dep></entry>
    </interpolation>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>
  
  <!-- Ajout des effets lumineux -->
  <model>
    <path>Aircraft/payen-pa350cd/Models/light/beacon.xml</path>
    <offsets>
      <x-m> 2.01723 </x-m>
      <y-m> 0.00000 </y-m>
      <z-m> 0.39647 </z-m>
    </offsets>
  </model>
  
  <model>
    <path>Aircraft/payen-pa350cd/Models/light/beacon.xml</path>
    <offsets>
      <x-m> -1.44669 </x-m>
      <y-m>  0.00000 </y-m>
      <z-m> -0.64849 </z-m>
    </offsets>
  </model>
  
  <model>
    <path>Aircraft/payen-pa350cd/Models/light/RedLight.xml</path>
    <offsets>
      <x-m> -0.94725 </x-m>
      <y-m> -1.62411 </y-m>
      <z-m>  0.10234 </z-m>
    </offsets>
  </model>
  
  <model>
    <path>Aircraft/payen-pa350cd/Models/light/StrobeLight.xml</path>
    <offsets>
      <x-m> -0.93796 </x-m>
      <y-m> -1.62411 </y-m>
      <z-m>  0.10234 </z-m>
    </offsets>
  </model>
  
  <model>
    <path>Aircraft/payen-pa350cd/Models/light/GreenLight.xml</path>
    <offsets>
      <x-m> -0.94725 </x-m>
      <y-m>  1.62411 </y-m>
      <z-m>  0.10234 </z-m>
    </offsets>
  </model>
  
  <model>
    <path>Aircraft/payen-pa350cd/Models/light/StrobeLight.xml</path>
    <offsets>
      <x-m> -0.93796 </x-m>
      <y-m>  1.62411 </y-m>
      <z-m>  0.10234 </z-m>
    </offsets>
  </model>
  
</PropertyList>
