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

<PropertyList>

  <path>m33.ac</path>

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

  <animation>
    <!-- Objets opaques -->
    <object-name>fuselage</object-name>
    <object-name>dessous</object-name>
    <object-name>structure</object-name>
    <object-name>bol</object-name>
    <object-name>echappes</object-name>
    <object-name>ailes</object-name>
    <object-name>aileronG</object-name>
    <object-name>aileronD</object-name>
    <object-name>ailes2</object-name>
    <object-name>profondeurG</object-name>
    <object-name>profondeurD</object-name>
    <object-name>direction</object-name>
    <object-name>moteur</object-name>
    <object-name>helice</object-name>
    <object-name>flotteurs</object-name>
    <object-name>tour</object-name>
    <object-name>guns</object-name>
    <object-name>trous</object-name>
    <object-name>dynamo</object-name>
    <object-name>boldynamo</object-name>
    <object-name>helicedynamo</object-name>

    <!-- Objets transparents -->
    <object-name>propblur</object-name>
    <object-name>propdisc</object-name>
    <object-name>vitres</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>Aircraft/Generic/Effects/glass_shader.png</texture>
    <object-name>vitres</object-name>
  </animation>

  <animation>
    <type>material</type>
    <object-name>fuselage</object-name>
    <object-name>dessous</object-name>
    <object-name>structure</object-name>
    <object-name>bol</object-name>
    <object-name>echappes</object-name>
    <object-name>ailes</object-name>
    <object-name>aileronG</object-name>
    <object-name>aileronD</object-name>
    <object-name>ailes2</object-name>
    <object-name>profondeurG</object-name>
    <object-name>profondeurD</object-name>
    <object-name>direction</object-name>
    <object-name>moteur</object-name>
    <object-name>helice</object-name>
    <object-name>flotteurs</object-name>
    <object-name>tour</object-name>
    <object-name>guns</object-name>
    <object-name>trous</object-name>
    <object-name>dynamo</object-name>
    <object-name>boldynamo</object-name>
    <object-name>helicedynamo</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/Macchi-M33/Models/Interior/interior.xml</path>
    <offsets>
      <x-m> 0 </x-m>
      <y-m> 0 </y-m>
      <z-m> 0 </z-m>
    </offsets>
  </model>

  <!-- Trainée fuselage -->
  <model>
    <path>Aircraft/Macchi-M33/Models/Effects/wakeC.xml</path>
    <offsets>
      <x-m>  2.867 </x-m>
      <y-m>  0.000 </y-m>
      <z-m> -1.036 </z-m>
      <roll-deg>    0 </roll-deg>
      <pitch-deg>   0 </pitch-deg>
      <heading-deg> 0 </heading-deg>
    </offsets>
  </model> 

  <!-- Trainée gauche -->
  <model>
    <path>Aircraft/Macchi-M33/Models/Effects/wakeG.xml</path>
    <offsets>
      <x-m> -0.813 </x-m>
      <y-m> -2.917 </y-m>
      <z-m> -0.928 </z-m>
      <roll-deg>    0 </roll-deg>
      <pitch-deg>   0 </pitch-deg>
      <heading-deg> 0 </heading-deg>
    </offsets>
  </model> 

  <!-- Trainée droite -->
  <model>
    <path>Aircraft/Macchi-M33/Models/Effects/wakeG.xml</path>
    <offsets>
      <x-m> -0.813 </x-m>
      <y-m>  2.917 </y-m>
      <z-m> -0.928 </z-m>
      <roll-deg>    0 </roll-deg>
      <pitch-deg>   0 </pitch-deg>
      <heading-deg> 0 </heading-deg>
    </offsets>
  </model> 

  <!-- Effets de tir -->
  <!-- Gauche extérieur -->
  <model>
    <path>Aircraft/Macchi-M33/Models/Effects/guns/fire.xml</path>
    <offsets>
      <x-m> -3.482 </x-m>
      <y-m> -0.181 </y-m>
      <z-m> -0.336 </z-m>
      <roll-deg>    0 </roll-deg>
      <pitch-deg>   0 </pitch-deg>
      <heading-deg> 0 </heading-deg>
    </offsets>
  </model>

  <!-- Gauche intérieur -->
  <model>
    <path>Aircraft/Macchi-M33/Models/Effects/guns/fire.xml</path>
    <offsets>
      <x-m> -3.482 </x-m>
      <y-m>  0.181 </y-m>
      <z-m> -0.336 </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>helice</object-name>
    <object-name>bol</object-name>
    <object-name>propdisc</object-name>
    <object-name>propblur</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>900</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>300.000</value>
      </greater-than>
      <less-than>
        <property>/engines/engine[0]/rpm</property>
        <value>900.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>900</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.579 </x-m>
      <y-m>  0.000 </y-m>
      <z-m>  0.789 </z-m>
    </center>
    <axis>
      <x> -1 </x>
      <y>  0 </y>
      <z>  0 </z>
    </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.009 </x1-m>
      <y1-m> -4.283 </y1-m>
      <z1-m>  0.088 </z1-m>
      <x2-m> -0.303 </x2-m>
      <y2-m> -2.865 </y2-m>
      <z2-m>  0.068 </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.303 </x1-m>
      <y1-m>  2.865 </y1-m>
      <z1-m>  0.068 </z1-m>
      <x2-m>  0.009 </x2-m>
      <y2-m>  4.283 </y2-m>
      <z2-m>  0.088 </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>
    <center>
      <x-m> 3.495 </x-m>
      <y-m> 0.000 </y-m>
      <z-m> 0.228 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </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>  3.815 </x1-m>
      <y1-m> -1.633 </y1-m>
      <z1-m> -0.205 </z1-m>
      <x2-m>  3.544 </x2-m>
      <y2-m> -0.313 </y2-m>
      <z2-m> -0.207 </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.544 </x1-m>
      <y1-m>  0.313 </y1-m>
      <z1-m> -0.207 </z1-m>
      <x2-m>  3.815 </x2-m>
      <y2-m>  1.633 </y2-m>
      <z2-m> -0.205 </z2-m>
    </axis>
  </animation>

  <animation>
    <name>HeliceDynameComplete</name>
    <object-name>boldynamo</object-name>
    <object-name>helicedynamo</object-name>
  </animation>

  <animation>
    <type>spin</type>
    <object-name>HeliceDynameComplete</object-name>
    <property>/instrumentation/airspeed-indicator/indicated-speed-kt</property>
    <factor> 8 </factor>
    <center>
      <x-m> -0.730 </x-m>
      <y-m> -0.442 </y-m>
      <z-m> -0.405 </z-m>
    </center>
    <axis>
      <x> -1 </x>
      <y>  0 </y>
      <z>  0 </z>
    </axis>
  </animation>

  <!-- Effets lumineux -->
  <model>
    <path>Aircraft/Macchi-M33/Models/lights/beacon.xml</path>
    <offsets>
      <x-m> 3.379 </x-m>
      <y-m> 0.000 </y-m>
      <z-m> 0.836 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Macchi-M33/Models/lights/RedLight.xml</path>
    <offsets>
      <x-m> -0.276 </x-m>
      <y-m> -4.884 </y-m>
      <z-m>  0.097 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Macchi-M33/Models/lights/GreenLight.xml</path>
    <offsets>
      <x-m> -0.276 </x-m>
      <y-m>  4.884 </y-m>
      <z-m>  0.097 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Macchi-M33/Models/lights/StrobeWhite.xml</path>
    <offsets>
      <x-m> -0.260 </x-m>
      <y-m> -4.884 </y-m>
      <z-m>  0.097 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Macchi-M33/Models/lights/StrobeWhite.xml</path>
    <offsets>
      <x-m> -0.260 </x-m>
      <y-m>  4.884 </y-m>
      <z-m>  0.097 </z-m>
   </offsets>
  </model>

</PropertyList>

