<?xml version="1.0"?>

<PropertyList>

  <path>vimy.ac</path>

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

  <animation>
    <!-- Objets opaques -->
    <object-name>fuselage</object-name>
    <object-name>aileB</object-name>
    <object-name>aileronGB</object-name>
    <object-name>aileronDB</object-name>
    <object-name>aileH</object-name>
    <object-name>aileronGH</object-name>
    <object-name>aileronDH</object-name>
    <object-name>moteurG</object-name>
    <object-name>heliceG</object-name>
    <object-name>bolG</object-name>
    <object-name>moteurD</object-name>
    <object-name>heliceD</object-name>
    <object-name>bolD</object-name>
    <object-name>rouesG</object-name>
    <object-name>rouesD</object-name>
    <object-name>patte</object-name>
    <object-name>derive</object-name>
    <object-name>profondeurH</object-name>
    <object-name>profondeurB</object-name>
    <object-name>directionG</object-name>
    <object-name>directionD</object-name>
    <object-name>montants</object-name>
    <object-name>essieus</object-name>
    <object-name>entreroues</object-name>
    <object-name>marches</object-name>
    <object-name>axes</object-name>
    <object-name>trous</object-name>

    <!-- Objets transparents -->
    <object-name>cables</object-name>
    <object-name>cablesAilGH</object-name>
    <object-name>cablesAilGB</object-name>
    <object-name>cablesAilDH</object-name>
    <object-name>cablesAilDB</object-name>
    <object-name>propdiscG</object-name>
    <object-name>propblurG</object-name>
    <object-name>propdiscD</object-name>
    <object-name>propblurD</object-name>
  </animation>

  <animation>
    <type>noshadow</type>
    <object-name>propdiscG</object-name>
    <object-name>propblurG</object-name>
    <object-name>propdiscD</object-name>
    <object-name>propblurD</object-name>
  </animation>

  <animation>
    <type>material</type>
    <object-name>fuselage</object-name>
    <object-name>aileB</object-name>
    <object-name>aileronGB</object-name>
    <object-name>aileronDB</object-name>
    <object-name>aileH</object-name>
    <object-name>aileronGH</object-name>
    <object-name>aileronDH</object-name>
    <object-name>moteurG</object-name>
    <object-name>heliceG</object-name>
    <object-name>bolG</object-name>
    <object-name>moteurD</object-name>
    <object-name>heliceD</object-name>
    <object-name>bolD</object-name>
    <object-name>rouesG</object-name>
    <object-name>rouesD</object-name>
    <object-name>patte</object-name>
    <object-name>derive</object-name>
    <object-name>profondeurH</object-name>
    <object-name>profondeurB</object-name>
    <object-name>directionG</object-name>
    <object-name>directionD</object-name>
    <object-name>montants</object-name>
    <object-name>essieus</object-name>
    <object-name>entreroues</object-name>
    <object-name>marches</object-name>
    <object-name>axes</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>

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

  <animation>
    <type>select</type>
    <object-name>shadowOSG</object-name>
    <condition>
      <equals>
        <property>sim[0]/rendering/shadows-ai</property>
        <value>true</value>
      </equals>
    </condition>
  </animation>

  <!-- Interieur -->
  <model>
    <path>Aircraft/Vickers-Vimy/Models/Interior/interior.xml</path>
    <offsets>
      <x-m> 0.0 </x-m>
      <y-m> 0.0 </y-m>
      <z-m> 0.0 </z-m>
      <roll-deg>    0.0 </roll-deg>
      <pitch-deg>   0.0 </pitch-deg>
      <heading-deg> 0.0 </heading-deg>
    </offsets>
  </model>

  <animation>
    <name>HeliceG</name>
    <object-name>propdiscG</object-name>
    <object-name>propblurG</object-name>
    <object-name>heliceG</object-name>
    <object-name>bolG</object-name>
  </animation>

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

  <animation>
    <type>select</type>
    <object-name>propblurG</object-name>
    <condition>
    <and>
      <greater-than>
        <property>engines/engine[0]/rpm</property>
        <value>400.000</value>
      </greater-than>
      <less-than>
        <property>engines/engine[0]/rpm</property>
        <value>1000.001</value>
      </less-than>
    </and>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>heliceG</object-name>
    <condition>
      <less-than>
        <property>engines/engine[0]/rpm</property>
	<value>1000</value>
      </less-than>
    </condition>
  </animation>

  <animation>
    <type>spin</type>
    <object-name>HeliceG</object-name>
    <property>engines/engine[0]/rpm</property>
    <factor> 1 </factor>
    <center>
      <x-m> -4.643 </x-m>
      <y-m> -2.539 </y-m>
      <z-m>  0.254 </z-m>
    </center>
    <axis>
      <x> -1.000 </x>
      <y>  0.000 </y>
      <z>  0.000 </z>
    </axis>
  </animation>

  <animation>
    <name>HeliceD</name>
    <object-name>propdiscD</object-name>
    <object-name>propblurD</object-name>
    <object-name>heliceD</object-name>
    <object-name>bolD</object-name>
  </animation>

  <!-- L'hélice --> 
  <!-- Séléction de l'objet visible en fonction des rpm -->
  <animation>
    <type>select</type>
    <object-name>propdiscD</object-name>
    <condition>
      <greater-than>
        <property>engines/engine[1]/rpm</property>
        <value>1000</value>
      </greater-than>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>propblurD</object-name>
    <condition>
    <and>
      <greater-than>
        <property>engines/engine[1]/rpm</property>
        <value>400.000</value>
      </greater-than>
      <less-than>
        <property>engines/engine[1]/rpm</property>
        <value>1000.001</value>
      </less-than>
    </and>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>heliceD</object-name>
    <condition>
      <less-than>
        <property>engines/engine[1]/rpm</property>
	<value>1000</value>
      </less-than>
    </condition>
  </animation>

  <animation>
    <type>spin</type>
    <object-name>HeliceD</object-name>
    <property>engines/engine[1]/rpm</property>
    <factor> 1 </factor>
    <center>
      <x-m> -4.643 </x-m>
      <y-m>  2.539 </y-m>
      <z-m>  0.254 </z-m>
    </center>
    <axis>
      <x> 1.000 </x>
      <y> 0.000 </y>
      <z> 0.000 </z>
    </axis>
  </animation>

  <!-- Animations des ailerons -->
  <animation>
    <type>rotate</type>
    <object-name>aileronGH</object-name>
    <object-name>cablesAilGH</object-name>
    <property>surface-positions/left-aileron-pos-norm</property>
    <factor>20.0</factor>
    <center>
      <x-m> -2.021 </x-m>
      <y-m> -7.457 </y-m>
      <z-m>  2.140 </z-m>
    </center>
    <axis>
      <x> 0.000 </x>
      <y> 1.000 </y>
      <z> 0.000 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>aileronGB</object-name>
    <object-name>cablesAilGB</object-name>
    <property>surface-positions/left-aileron-pos-norm</property>
    <factor>20.0</factor>
    <center>
      <x-m> -2.021 </x-m>
      <y-m> -7.457 </y-m>
      <z-m> -0.861 </z-m>
    </center>
    <axis>
      <x> 0.000 </x>
      <y> 1.000 </y>
      <z> 0.000 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>aileronDH</object-name>
    <object-name>cablesAilDH</object-name>
    <property>surface-positions/right-aileron-pos-norm</property>
    <factor>20.0</factor>
    <center>
      <x-m> -2.021 </x-m>
      <y-m>  7.457 </y-m>
      <z-m>  2.140 </z-m>
    </center>
    <axis>
      <x> 0.000 </x>
      <y> 1.000 </y>
      <z> 0.000 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>aileronDB</object-name>
    <object-name>cablesAilDB</object-name>
    <property>surface-positions/right-aileron-pos-norm</property>
    <factor>20.0</factor>
    <center>
      <x-m> -2.021 </x-m>
      <y-m>  7.457 </y-m>
      <z-m> -0.861 </z-m>
    </center>
    <axis>
      <x> 0.000 </x>
      <y> 1.000 </y>
      <z> 0.000 </z>
    </axis>
  </animation>

  <!-- Gouverne de profondeur -->
  <animation>
    <type>rotate</type>
    <object-name>profondeurH</object-name>
    <property>controls/flight/elevator</property>
    <factor>15</factor>
    <center>
      <x-m> 5.959 </x-m>
      <y-m> 0.000 </y-m>
      <z-m> 0.919 </z-m>
    </center>
    <axis>
      <x> 0.000 </x>
      <y> 1.000 </y>
      <z> 0.000 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>profondeurB</object-name>
    <property>controls/flight/elevator</property>
    <factor>15</factor>
    <center>
      <x-m>  5.959 </x-m>
      <y-m>  0.000 </y-m>
      <z-m> -0.617 </z-m>
    </center>
    <axis>
      <x> 0.000 </x>
      <y> 1.000 </y>
      <z> 0.000 </z>
    </axis>
  </animation>

  <!-- Gouverne de direction -->
  <animation>
    <type>rotate</type>
    <object-name>directionG</object-name>
    <property>controls/flight/rudder</property>
    <factor>25</factor>
    <center>
      <x-m>  5.866 </x-m>
      <y-m> -1.624 </y-m>
      <z-m>  0.137 </z-m>
    </center>
    <axis>
      <x> 0.000 </x>
      <y> 0.000 </y>
      <z> 1.000 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>directionD</object-name>
    <property>controls/flight/rudder</property>
    <factor>25</factor>
    <center>
      <x-m> 5.866 </x-m>
      <y-m> 1.624 </y-m>
      <z-m> 0.137 </z-m>
    </center>
    <axis>
      <x> 0.000 </x>
      <y> 0.000 </y>
      <z> 1.000 </z>
    </axis>
  </animation>

  <!-- Rotation des roues lors du roulage -->
  <animation>
    <type>spin</type>
    <object-name>rouesG</object-name>
    <property>gear/gear[0]/rollspeed-ms</property>
    <factor> 30 </factor>
    <center>
      <x-m> -3.203 </x-m>
      <y-m> -2.442 </y-m>
      <z-m> -1.827 </z-m>
    </center>
    <axis>
      <x>  0.000 </x>
      <y> -1.000 </y>
      <z>  0.000 </z>
    </axis>
  </animation>

  <animation>
    <type>spin</type>
    <object-name>rouesD</object-name>
    <property>gear/gear[1]/rollspeed-ms</property>
    <factor> 30 </factor>
    <center>
      <x-m> -3.203 </x-m>
      <y-m>  2.442 </y-m>
      <z-m> -1.827 </z-m>
    </center>
    <axis>
      <x>  0.000 </x>
      <y> -1.000 </y>
      <z>  0.000 </z>
    </axis>
  </animation>

</PropertyList>

