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

<!-- Hughes H4 Hercules - 1946 -->
<PropertyList>

  <path>h4-hercules.ac</path>

  <!-- MP sound call -->
  <sound>
    <path>../Sounds/mp-sound.xml</path>
  </sound>

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

  <animation>
    <!-- Objets opaques -->
    <object-name>fuselage</object-name>
    <object-name>ailes</object-name>
    <object-name>aileron-D</object-name>
    <object-name>aileron-G</object-name>
    <object-name>derive</object-name>
    <object-name>direction</object-name>
    <object-name>profondeur</object-name>
    <object-name>flap-G</object-name>
    <object-name>flap-D</object-name>
    <object-name>flotteurs</object-name>
    <object-name>porte-A-G</object-name>
    <object-name>porte-A-D</object-name>
    <object-name>dessous</object-name>
    <object-name>dessousflotteurs</object-name>

    <!-- transparent objects -->
    <object-name>vitres</object-name>
    <object-name>hublot-A-G</object-name>
    <object-name>hublot-A-D</object-name>
    <object-name>lampe-D</object-name>
    <object-name>lampe-G</object-name>
    <!-- HDR mode -->
    <object-name>HDRvitres</object-name>
    <object-name>HDRhublot-A-G</object-name>
    <object-name>HDRhublot-A-D</object-name>
  </animation>

  <animation>
    <type>material</type>
    <object-name>fuselage</object-name>
    <object-name>ailes</object-name>
    <object-name>aileron-D</object-name>
    <object-name>aileron-G</object-name>
    <object-name>derive</object-name>
    <object-name>direction</object-name>
    <object-name>profondeur</object-name>
    <object-name>flap-G</object-name>
    <object-name>flap-D</object-name>
    <object-name>flotteurs</object-name>
    <object-name>porte-A-G</object-name>
    <object-name>porte-A-D</object-name>
    <object-name>dessous</object-name>
    <object-name>dessousflotteurs</object-name>
    <object-name>vitres</object-name>
    <object-name>hublot-A-G</object-name>
    <object-name>hublot-A-D</object-name>
    <object-name>lampe-D</object-name>
    <object-name>lampe-G</object-name>
    <object-name>HDRvitres</object-name>
    <object-name>HDRhublot-A-G</object-name>
    <object-name>HDRhublot-A-D</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/H4-Hercules/Models/Effects/Bump/bumpspec</inherits-from>
    <object-name>fuselage</object-name>
    <object-name>ailes</object-name>
    <object-name>aileron-D</object-name>
    <object-name>aileron-G</object-name>
    <object-name>derive</object-name>
    <object-name>direction</object-name>
    <object-name>profondeur</object-name>
    <object-name>flap-G</object-name>
    <object-name>flap-D</object-name>
    <object-name>flotteurs</object-name>
    <object-name>porte-A-G</object-name>
    <object-name>porte-A-D</object-name>
    <object-name>dessous</object-name>
    <object-name>dessousflotteurs</object-name>
  </effect>

  <!-- working for Compositor -->
  <effect>
    <inherits-from>Effects/Glass/glassrain</inherits-from>
    <object-name>vitres</object-name>
    <object-name>hublot-A-G</object-name>
    <object-name>hublot-A-D</object-name>
  </effect>

  <effect>
    <inherits-from>Effects/Glass/glass</inherits-from>
    <object-name>HDRvitres</object-name>
    <object-name>HDRhublot-A-G</object-name>
    <object-name>HDRhublot-A-D</object-name>
  </effect>

  <!-- Sélection des vitres en fonction de HDR ou pas -->
  <animation>
    <type>select</type>
    <condition>
      <!-- <property>sim/rendering/hdr/hdr-enabled</property> -->
      <property>sim/multiplay/generic/bool[2]</property>
    </condition>
    <object-name>HDRvitres</object-name>
    <object-name>HDRhublot-A-G</object-name>
    <object-name>HDRhublot-A-D</object-name>
  </animation>

  <animation>
    <type>select</type>
    <condition>
      <!-- <not><property>sim/rendering/hdr/hdr-enabled</property></not> -->
      <not><property>sim/multiplay/generic/bool[2]</property></not>
    </condition>
    <object-name>vitres</object-name>
    <object-name>hublot-A-G</object-name>
    <object-name>hublot-A-D</object-name>
  </animation>

  <!-- working for Rembrandt -->
  <effect>
    <inherits-from>Effects/model-transparent</inherits-from>
    <object-name>lampe-D</object-name>
    <object-name>lampe-G</object-name>
  </effect>

  <model>
    <path>Interior/interior.xml</path>
  </model>

  <model>
    <path>Engines/all-engines.xml</path>
  </model>

  <animation>
    <type>material</type>
    <object-name>carter</object-name>
    <object-name>prise-air</object-name>
    <object-name>trappe-air</object-name>
    <object-name>helice</object-name>
    <object-name>bol</object-name>

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

  <model>
    <path>Effects/waves/all-waves.xml</path>
  </model>

  <model>
    <path>light/all-lights.xml</path>
  </model>

  <!-- Gouverne de direction -->
  <animation>
    <type>rotate</type>
    <object-name>direction</object-name>
    <!-- <property>controls/flight/rudder</property> -->
    <property>surface-positions/rudder-pos-norm</property>
    <factor> -15 </factor>
    <center>
      <x-m> 40.960 </x-m>
      <y-m>  0.000 </y-m>
      <z-m> 14.171 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation>

  <!-- Gouverne de profondeur -->
  <animation>
    <type>rotate</type>
    <object-name>profondeur</object-name>
    <!-- <property>controls/flight/elevator</property> -->
    <property>surface-positions/elevator-pos-norm</property>
    <factor> 15 </factor>
    <center>
      <x-m> 39.210 </x-m>
      <y-m>  0.000 </y-m>
      <z-m>  8.000 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 1 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <!-- Animations des ailerons -->
  <animation>
    <type>rotate</type>
    <object-name>aileron-G</object-name>
    <property>surface-positions/left-aileron-pos-norm</property>
    <factor> -15 </factor>
    <axis>
      <x1-m>   3.949 </x1-m>
      <y1-m> -26.421 </y1-m>
      <z1-m>   6.718 </z1-m>
      <x2-m>   3.240 </x2-m>
      <y2-m> -47.631 </y2-m>
      <z2-m>   8.182 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>aileron-D</object-name>
    <property>surface-positions/right-aileron-pos-norm</property>
    <factor> -15 </factor>
    <axis>
      <x1-m>   3.240 </x1-m>
      <y1-m>  47.631 </y1-m>
      <z1-m>   8.182 </z1-m>
      <x2-m>   3.949 </x2-m>
      <y2-m>  26.421 </y2-m>
      <z2-m>   6.718 </z2-m>
    </axis>
  </animation>

  <!-- Volets -->
  <animation>
    <type>rotate</type>
    <object-name>flap-G</object-name>
    <property>surface-positions/flap-pos-norm</property>
    <factor> -55 </factor>
    <axis>
      <x1-m>   5.892 </x1-m>
      <y1-m>  -5.599 </y1-m>
      <z1-m>   3.471 </z1-m>
      <x2-m>   4.660 </x2-m>
      <y2-m> -23.766 </y2-m>
      <z2-m>   4.832 </z2-m>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>flap-D</object-name>
    <property>surface-positions/flap-pos-norm</property>
    <factor> 55 </factor>
    <axis>
      <x1-m>   5.892 </x1-m>
      <y1-m>   5.599 </y1-m>
      <z1-m>   3.471 </z1-m>
      <x2-m>   4.660 </x2-m>
      <y2-m>  23.766 </y2-m>
      <z2-m>   4.832 </z2-m>
    </axis>
  </animation>

  <animation>
    <name>PorteGauche</name>
    <object-name>porte-A-G</object-name>
    <object-name>hublot-A-G</object-name>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>PorteGauche</object-name>
    <object-name>HDRhublot-A-G</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>rotate</type>
    <object-name>PorteGauche</object-name>
    <object-name>HDRhublot-A-G</object-name>
    <!-- <property>sim/model/door-positions/crew/position-norm</property> -->
    <property>sim/multiplay/generic/float[0]</property>
    <factor> -170 </factor>
    <center>
      <x-m> -14.989 </x-m>
      <y-m>  -2.879 </y-m>
      <z-m>   1.395 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation>

  <animation>
    <name>PorteDroite</name>
    <object-name>porte-A-D</object-name>
    <object-name>hublot-A-D</object-name>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>PorteDroite</object-name>
    <object-name>HDRhublot-A-D</object-name>
    <visible>true</visible>
    <action>
      <button>0</button>
      <repeatable>false</repeatable>
      <binding>
        <command>nasal</command>
        <script>doors.passenger.toggle();</script>
      </binding>
    </action>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>PorteDroite</object-name>
    <object-name>HDRhublot-A-D</object-name>
    <!-- <property>sim/model/door-positions/passenger/position-norm</property> -->
    <property>sim/multiplay/generic/float[1]</property>
    <factor> 170 </factor>
    <center>
      <x-m> -14.989 </x-m>
      <y-m>   2.879 </y-m>
      <z-m>   1.395 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation>

</PropertyList>
