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

<PropertyList>

  <path>stiletto.ac</path>

  <nasal>
    <load>
      var livery_update = aircraft.livery_update.new("Aircraft/Stiletto/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>fuselage</object-name>
    <object-name>nez</object-name>
    <object-name>dessus</object-name>
    <object-name>trappe</object-name>
    <object-name>aile</object-name>
    <object-name>aileronG</object-name>
    <object-name>aileronD</object-name>
    <object-name>voletG</object-name>
    <object-name>voletD</object-name>
    <object-name>profondeur</object-name>
    <object-name>derive</object-name>
    <object-name>direction</object-name>
    <object-name>manche</object-name>
    <object-name>porteA</object-name>
    <object-name>porteBG</object-name>
    <object-name>porteHG</object-name>
    <object-name>porteBD</object-name>
    <object-name>porteHD</object-name> 
    <object-name>sorties</object-name> 

    <object-name>trous</object-name>
    <object-name>axeA</object-name>
    <object-name>axeB</object-name>
    <object-name>roueA</object-name>
    <object-name>axeGH</object-name>
    <object-name>axeGB</object-name>
    <object-name>roueG</object-name>
    <object-name>axeDH</object-name>
    <object-name>axeDB</object-name>
    <object-name>roueD</object-name>

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

  <animation>
    <type>material</type>
    <object-name>fuselage</object-name>
    <object-name>nez</object-name>
    <object-name>dessus</object-name>
    <object-name>trappe</object-name>
    <object-name>aile</object-name>
    <object-name>aileronG</object-name>
    <object-name>aileronD</object-name>
    <object-name>voletG</object-name>
    <object-name>voletD</object-name>
    <object-name>profondeur</object-name>
    <object-name>derive</object-name>
    <object-name>direction</object-name>
    <object-name>manche</object-name>
    <object-name>porteA</object-name>
    <object-name>porteBG</object-name>
    <object-name>porteHG</object-name>
    <object-name>porteBD</object-name>
    <object-name>porteHD</object-name> 
    <object-name>sorties</object-name> 

    <object-name>trous</object-name>
    <object-name>axeA</object-name>
    <object-name>axeB</object-name>
    <object-name>roueA</object-name>
    <object-name>axeGH</object-name>
    <object-name>axeGB</object-name>
    <object-name>roueG</object-name>
    <object-name>axeDH</object-name>
    <object-name>axeDB</object-name>
    <object-name>roueD</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>nez</object-name>
    <object-name>fuselage</object-name>
    <object-name>dessus</object-name>
    <object-name>trappe</object-name>
    <object-name>aile</object-name>
    <object-name>aileronG</object-name>
    <object-name>aileronD</object-name>
    <object-name>voletG</object-name>
    <object-name>voletD</object-name>
    <object-name>profondeur</object-name>
    <object-name>derive</object-name>
    <object-name>direction</object-name>
    <object-name>manche</object-name>
    <object-name>porteA</object-name>
    <object-name>porteBG</object-name>
    <object-name>porteHG</object-name>
    <object-name>porteBD</object-name>
    <object-name>porteHD</object-name> 
    <object-name>sorties</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>
  </animation>

  <!-- Une ombre pour OSG  -->
  <model>
    <name>shadowOSG</name>
    <path>Aircraft/Stiletto/Models/shadow.xml</path>
  </model>

  <!-- Les flammes -->
  <!-- Gauche -->
  <model>
    <path>Aircraft/Stiletto/Models/Effects/flammes/flammesG.xml</path>
    <offsets>
      <x-m>  6.057 </x-m>
      <y-m> -0.455 </y-m>
      <z-m> -0.568 </z-m>
    </offsets>
  </model>

  <!-- Droite -->
  <model>
    <path>Aircraft/Stiletto/Models/Effects/flammes/flammesD.xml</path>
    <offsets>
      <x-m>  6.057 </x-m>
      <y-m>  0.455 </y-m>
      <z-m> -0.568 </z-m>
    </offsets>
  </model>

  <!-- Particules OSG -->
  <!-- Gauche -->
  <model>
    <path>Aircraft/Stiletto/Models/Effects/smoke/smokeL.xml</path>
    <offsets>
      <x-m>  6.057 </x-m>
      <y-m> -0.455 </y-m>
      <z-m> -0.568 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Stiletto/Models/Effects/trail/trailL.xml</path>
    <offsets>
      <x-m>  6.057 </x-m>
      <y-m> -0.455 </y-m>
      <z-m> -0.568 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Alphajet/Models/Effects/tiptrail/tiptrail.xml</path>
    <offsets>
      <x-m>  3.830 </x-m>
      <y-m> -3.365 </y-m>
      <z-m> -0.692 </z-m>
    </offsets>
  </model>

  <!-- Droite -->
  <model>
    <path>Aircraft/Stiletto/Models/Effects/smoke/smokeR.xml</path>
    <offsets>
      <x-m>  6.057 </x-m>
      <y-m>  0.455 </y-m>
      <z-m> -0.568 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Stiletto/Models/Effects/trail/trailR.xml</path>
    <offsets>
      <x-m>  6.057 </x-m>
      <y-m>  0.455 </y-m>
      <z-m> -0.568 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Alphajet/Models/Effects/tiptrail/tiptrail.xml</path>
    <offsets>
      <x-m>  3.830 </x-m>
      <y-m>  3.365 </y-m>
      <z-m> -0.692 </z-m>
    </offsets>
  </model>

  <!-- Effets sur le sol -->
  <!-- Roue avant -->
  <model>
    <path>Aircraft/Stiletto/Models/Effects/ground/ground0.xml</path>
    <offsets>
      <x-m> -3.758 </x-m>
      <y-m>  0.000 </y-m>
      <z-m> -1.940 </z-m>
    </offsets>
  </model>

  <!-- Roue gauche -->
  <model>
    <path>Aircraft/Stiletto/Models/Effects/ground/ground1.xml</path>
    <offsets>
      <x-m>  2.186 </x-m>
      <y-m> -0.937 </y-m>
      <z-m> -1.940 </z-m>
    </offsets>
  </model>

  <!-- Roue droite -->
  <model>
    <path>Aircraft/Stiletto/Models/Effects/ground/ground2.xml</path>   
    <offsets>
      <x-m>  2.186 </x-m>
      <y-m>  0.937 </y-m>
      <z-m> -1.940 </z-m>
    </offsets>
  </model>

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

  <!-- Gouverne de profondeur -->
  <animation>
    <type>rotate</type>
    <object-name>profondeur</object-name>
    <property>surface-positions/elevator-pos-norm</property>
    <factor> 15 </factor>
    <center>
      <x-m> 8.666 </x-m>
      <y-m> 0.000 </y-m>
      <z-m> 0.272 </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>surface-positions/rudder-pos-norm</property>
    <factor> -30 </factor>
    <axis>
      <x1-m> 9.292 </x1-m>
      <y1-m> 0.000 </y1-m>
      <z1-m> 0.530 </z1-m>
      <x2-m> 9.797 </x2-m>
      <y2-m> 0.000 </y2-m>
      <z2-m> 1.563 </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>
    <center>
      <x-m>  3.514 </x-m>
      <y-m> -2.911 </y-m>
      <z-m> -0.692 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 1 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>aileronD</object-name>
    <property>surface-positions/right-aileron-pos-norm</property>
    <factor> 15 </factor>
    <center>
      <x-m>  3.514 </x-m>
      <y-m>  2.911 </y-m>
      <z-m> -0.692 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 1 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <!-- Volets -->
  <animation>
    <type>rotate</type>
    <object-name>voletG</object-name>
    <property>surface-positions/flap-pos-norm</property>
    <factor> 40 </factor>
    <center>
      <x-m>  3.515 </x-m>
      <y-m> -1.724 </y-m>
      <z-m> -0.705 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 1 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>voletD</object-name>
    <property>surface-positions/flap-pos-norm</property>
    <factor> 40 </factor>
    <center>
      <x-m>  3.515 </x-m>
      <y-m>  1.724 </y-m>
      <z-m> -0.705 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 1 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <!-- Rentrée des roues -->
  <!-- Roue avant -->
  <animation>
    <type>rotate</type>
    <object-name>axeA</object-name>
    <object-name>axeB</object-name>
    <object-name>roueA</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> -3.728 </x-m>
      <y-m>  0.000 </y-m>
      <z-m> -0.783 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 1 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <!-- Roue gauche -->
<!--
  <animation>
    <type>rotate</type>
    <object-name>axeGH</object-name>
    <object-name>axeGB</object-name>
    <object-name>roueG</object-name>
    <property>gear/gear[1]/position-norm</property>
    <interpolation>
      <entry><ind> 0 </ind><dep> 74.421 </dep></entry>
      <entry><ind> 1 </ind><dep>  0.000 </dep></entry>
    </interpolation>
    <center>
      <x-m>  2.186 </x-m>
      <y-m> -0.699 </y-m>
      <z-m> -0.879 </z-m>
    </center>
    <axis>
      <x> 1 </x>
      <y> 0 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>axeGH</object-name>
    <object-name>axeGB</object-name>
    <object-name>roueG</object-name>
    <property>gear/gear[1]/position-norm</property>
    <interpolation>
      <entry><ind> 0 </ind><dep> 12.7 </dep></entry>
      <entry><ind> 1 </ind><dep>  0.0 </dep></entry>
    </interpolation>
    <center>
      <x-m>  2.186 </x-m>
      <y-m> -0.699 </y-m>
      <z-m> -0.879 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 1 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>axeGH</object-name>
    <object-name>axeGB</object-name>
    <object-name>roueG</object-name>
    <property>gear/gear[1]/position-norm</property>
    <interpolation>
      <entry><ind> 0 </ind><dep> 128.256 </dep></entry>
      <entry><ind> 1 </ind><dep>   0.000 </dep></entry>
    </interpolation>
    <center>
      <x-m>  2.186 </x-m>
      <y-m> -0.699 </y-m>
      <z-m> -0.879 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation>
-->
  <!-- Rentré des roues Temporairement disparition/apparition des roues -->
  <animation>
    <type>select</type>
    <object-name>axeGH</object-name>
    <object-name>axeGB</object-name>
    <object-name>roueG</object-name>
    <object-name>axeDH</object-name>
    <object-name>axeDB</object-name>
    <object-name>roueD</object-name>
    <condition>
      <not>
        <equals>
          <property>gear/gear[0]/position-norm</property>
          <value>0</value>
        </equals>
      </not>
    </condition>
  </animation>

  <!-- Fermeture des portes des trains -->
  <animation>
    <type>rotate</type>
    <object-name>porteA</object-name>
    <property>gear/gear[0]/position-norm</property>
    <interpolation>
      <entry><ind> 0.0 </ind><dep>   0 </dep></entry>
      <entry><ind> 0.2 </ind><dep> 110 </dep></entry>
      <entry><ind> 1.0 </ind><dep> 110 </dep></entry>
    </interpolation>
    <axis>
      <x1-m> -5.000 </x1-m>
      <y1-m>  0.167 </y1-m>
      <z1-m> -0.850 </z1-m>
      <x2-m> -3.587 </x2-m>
      <y2-m>  0.167 </y2-m>
      <z2-m> -0.964 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>porteHG</object-name>
    <property>gear/gear[1]/position-norm</property>
    <interpolation>
      <entry><ind> 0.0 </ind><dep>   0 </dep></entry>
      <entry><ind> 0.2 </ind><dep> -95 </dep></entry>
      <entry><ind> 1.0 </ind><dep> -95 </dep></entry>
    </interpolation>
    <axis>
      <x1-m>  1.150 </x1-m>
      <y1-m> -0.903 </y1-m>
      <z1-m> -0.757 </z1-m>
      <x2-m>  1.929 </x2-m>
      <y2-m> -0.910 </y2-m>
      <z2-m> -0.775 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>porteHD</object-name>
    <property>gear/gear[2]/position-norm</property>
    <interpolation>
      <entry><ind> 0.0 </ind><dep>   0 </dep></entry>
      <entry><ind> 0.2 </ind><dep> -95 </dep></entry>
      <entry><ind> 1.0 </ind><dep> -95 </dep></entry>
    </interpolation>
    <axis>
      <x1-m>  1.929 </x1-m>
      <y1-m>  0.910 </y1-m>
      <z1-m> -0.775 </z1-m>
      <x2-m>  1.150 </x2-m>
      <y2-m>  0.903 </y2-m>
      <z2-m> -0.757 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>porteBG</object-name>
    <property>gear/gear[1]/position-norm</property>
    <interpolation>
      <entry><ind> 0.0 </ind><dep>  0 </dep></entry>
      <entry><ind> 0.2 </ind><dep> 85 </dep></entry>
      <entry><ind> 1.0 </ind><dep> 85</dep></entry>
    </interpolation>
    <axis>
      <x1-m>  1.099 </x1-m>
      <y1-m> -0.382 </y1-m>
      <z1-m> -1.152 </z1-m>
      <x2-m>  2.443 </x2-m>
      <y2-m> -0.388 </y2-m>
      <z2-m> -1.146 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>porteBD</object-name>
    <property>gear/gear[2]/position-norm</property>
    <interpolation>
      <entry><ind> 0.0 </ind><dep>  0 </dep></entry>
      <entry><ind> 0.2 </ind><dep> 85 </dep></entry>
      <entry><ind> 1.0 </ind><dep> 85</dep></entry>
    </interpolation>
    <axis>
      <x1-m>  2.443 </x1-m>
      <y1-m>  0.388 </y1-m>
      <z1-m> -1.146 </z1-m>
      <x2-m>  1.099 </x2-m>
      <y2-m>  0.382 </y2-m>
      <z2-m> -1.152 </z2-m>
    </axis>
  </animation>

  <!-- Rotation de la roue avant en fonction de la gouverne de direction -->
  <animation>
   <type>rotate</type>
   <object-name>axeA</object-name>
   <object-name>axeB</object-name>
   <object-name>roueA</object-name>
   <property>controls/flight/rudder</property>
   <factor> 15 </factor>
   <center>
    <x-m> -3.748 </x-m>
    <y-m>  0.000 </y-m>
    <z-m> -1.622 </z-m>
   </center>
   <axis>
     <x>  0 </x>
     <y>  0 </y>
     <z> -1 </z>
   </axis>
  </animation>

  <!-- Compression -->
  <animation>
    <type>translate</type>
    <object-name>roueA</object-name>
    <object-name>axeB</object-name>
    <property>gear/gear[0]/compression-norm</property>
    <factor> 0.3 </factor>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>roueG</object-name>
    <object-name>axeGB</object-name>
    <property>gear/gear[1]/compression-norm</property>
    <factor> 0.3 </factor>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation>

  <animation>
    <type>translate</type>
    <object-name>roueD</object-name>
    <object-name>axeDB</object-name>
    <property>gear/gear[2]/compression-norm</property>
    <factor> 0.3 </factor>
    <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> -3.748 </x-m>
      <y-m>  0.000 </y-m>
      <z-m> -1.622 </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.186 </x-m>
      <y-m> -0.937 </y-m>
      <z-m> -1.499 </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.186 </x-m>
      <y-m>  0.937 </y-m>
      <z-m> -1.499 </z-m>
    </center>
    <axis>
      <x>  0 </x>
      <y> -1 </y>
      <z>  0 </z>
    </axis>
  </animation>

  <!-- Canopy et autre-->
  <animation>
    <type>rotate</type>
    <object-name>dessus</object-name>
    <property>instrumentation/doors/crew/position-norm</property>
    <factor> 40 </factor>
    <center>
      <x-m> 0.414 </x-m>
      <y-m> 0.000 </y-m>
      <z-m> 0.397 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 1 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>trappe</object-name>
    <property>instrumentation/doors/crew/position-norm</property>
    <factor> -100 </factor>
    <axis>
      <x1-m> -2.027 </x1-m>
      <y1-m>  0.345 </y1-m>
      <z1-m> -1.002 </z1-m>
      <x2-m> -2.715 </x2-m>
      <y2-m>  0.352 </y2-m>
      <z2-m> -0.944 </z2-m>
    </axis>
  </animation>

  <!-- Effets lumineux -->
  <model>
    <path>Aircraft/Alphajet/Models/light/beacon.xml</path>
    <offsets>
      <x-m> 4.131 </x-m>
      <y-m> 0.000 </y-m>
      <z-m> 0.484 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Alphajet/Models/light/beacon.xml</path>
    <offsets>
      <x-m> -1.664 </x-m>
      <y-m>  0.000 </y-m>
      <z-m> -1.092 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Alphajet/Models/light/RedLight.xml</path>
    <offsets>
      <x-m>  2.826 </x-m>
      <y-m> -3.415 </y-m>
      <z-m> -0.692 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Alphajet/Models/light/StrobeWhite.xml</path>
    <offsets>
      <x-m>  2.820 </x-m>
      <y-m> -3.415 </y-m>
      <z-m> -0.692 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Alphajet/Models/light/GreenLight.xml</path>
    <offsets>
      <x-m>  2.826 </x-m>
      <y-m>  3.415 </y-m>
      <z-m> -0.692 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Alphajet/Models/light/StrobeWhite.xml</path>
    <offsets>
      <x-m>  2.820 </x-m>
      <y-m>  3.415 </y-m>
      <z-m> -0.692 </z-m>
    </offsets>
  </model>

</PropertyList>

