<?xml version="1.0"?>

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

<PropertyList>

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

 <offsets>
 
<!-- match the center of gravity of FDM -->
  <x-m>  0.0 </x-m>
  <y-m>  0.0 </y-m>
  <z-m>  0.0 </z-m> <!-- -2.0 -->

<!-- makes the wheels touch the ground, when changes center of gravity.
     When changing this value, also adjust the seat to keep the 2D instruments.
  <z-m>-2.1</z-m> -->

 </offsets>

 <animation>
   <object-name>fuselage</object-name>
   <object-name>interieur</object-name>
   <object-name>ailes</object-name>
   <object-name>aileron-A-D</object-name>
   <object-name>aileron-A-G</object-name>
   <object-name>aileron-D</object-name>
   <object-name>aileron-G</object-name>
   <object-name>bol-D2</object-name>
   <object-name>bol-G3</object-name>
   <object-name>bol-D4</object-name>
   <object-name>bol-D3</object-name>
   <object-name>bol-D1</object-name>
   <object-name>bol-G2</object-name>
   <object-name>bol-G1</object-name>
   <object-name>bol-G4</object-name>
   <object-name>enpennagefixeG</object-name>
   <object-name>enpennagefixeD</object-name>
   <object-name>flap-G</object-name>
   <object-name>flap-D</object-name>
   <object-name>flotteur-D</object-name>
   <object-name>flotteur-G</object-name>
   <object-name>gouverne</object-name>
   <object-name>gouvernefixe</object-name>
   <object-name>helice-G4</object-name>
   <object-name>helice-G2</object-name>
   <object-name>helice-G1</object-name>
   <object-name>helice-G3</object-name>
   <object-name>helice-D2</object-name>
   <object-name>helice-D1</object-name>
   <object-name>helice-D4</object-name>
   <object-name>helice-D3</object-name>
   <object-name>interieurmoteurs</object-name>
   <object-name>moteurs</object-name>
   <object-name>portantsG</object-name>
   <object-name>portantsD</object-name>
   <object-name>porte-A-G</object-name>
   <object-name>porte-A-D</object-name>
   <object-name>prises-air-G4</object-name>
   <object-name>prises-air-G3</object-name>
   <object-name>prises-airD1</object-name>
   <object-name>prises-air-G1</object-name>
   <object-name>prises-air-G2</object-name>
   <object-name>prises-airG3</object-name>
   <object-name>prises-airG2</object-name>
   <object-name>prises-airG1</object-name>
   <object-name>prises-airD2</object-name>
   <object-name>prises-airD3</object-name>
   <object-name>prises-airD4</object-name>
   <object-name>prises-airG4</object-name>
   <object-name>prises-air-D4</object-name>
   <object-name>prises-air-D1</object-name>
   <object-name>prises-air-D2</object-name>
   <object-name>prises-air-D3</object-name>

   <!-- transparent objects -->
   <object-name>vitres</object-name>
   <object-name>lampe-D</object-name>
   <object-name>lampe-G</object-name>
   <object-name>propdiscG1</object-name>
   <object-name>propblurG1</object-name>
   <object-name>propdiscG2</object-name>
   <object-name>propblurG2</object-name>
   <object-name>propdiscG3</object-name>
   <object-name>propblurG3</object-name>
   <object-name>propdiscG4</object-name>
   <object-name>propblurG4</object-name>
   <object-name>propdiscD1</object-name>
   <object-name>propblurD1</object-name>
   <object-name>propdiscD2</object-name>
   <object-name>propblurD2</object-name>
   <object-name>propdiscD3</object-name>
   <object-name>propblurD3</object-name>
   <object-name>propdiscD4</object-name>
   <object-name>propblurD4</object-name>
 </animation>

  <!-- Intérieur de l'avion -->
  <model>
    <path>Aircraft/H4-Hercules/Models/Interior/interior.xml</path>
    <offsets>
      <x-m> -7.676 </x-m>
      <y-m>  0.000 </y-m>
      <z-m>  5.637 </z-m>
      <roll-deg>    0.000 </roll-deg>
      <pitch-deg>   0.000 </pitch-deg>
      <heading-deg> 0.000 </heading-deg>
    </offsets>
  </model>

<!-- Animations des hélices -->

<!-- Sélection/déselection en fonction des rpm moteurs -->
<!-- On sélectionne l'un des disques en fonction des rpm -->
  <animation>
    <type>select</type>
    <object-name>propdiscD1</object-name>
    <condition>
      <greater-than>
        <property>engines/engine[0]/rpm</property>
        <value>1500</value>
      </greater-than>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>propblurD1</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>propdiscD2</object-name>
    <condition>
      <greater-than>
        <property>engines/engine[1]/rpm</property>
        <value>1500</value>
      </greater-than>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>propblurD2</object-name>
    <condition>
    <and>
      <greater-than>
        <property>engines/engine[1]/rpm</property>
        <value>600.000</value>
      </greater-than>
      <less-than>
        <property>engines/engine[1]/rpm</property>
        <value>1500.001</value>
      </less-than>
    </and>
    </condition>
  </animation>

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

  <animation>
    <type>select</type>
    <object-name>propblurD3</object-name>
    <condition>
    <and>
      <greater-than>
        <property>engines/engine[2]/rpm</property>
        <value>600.000</value>
      </greater-than>
      <less-than>
        <property>engines/engine[2]/rpm</property>
        <value>1500.001</value>
      </less-than>
    </and>
    </condition>
  </animation>

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

  <animation>
    <type>select</type>
    <object-name>propblurD4</object-name>
    <condition>
    <and>
      <greater-than>
        <property>engines/engine[3]/rpm</property>
        <value>600.000</value>
      </greater-than>
      <less-than>
        <property>engines/engine[3]/rpm</property>
        <value>1500.001</value>
      </less-than>
    </and>
    </condition>
  </animation>

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

  <animation>
    <type>select</type>
    <object-name>propblurG1</object-name>
    <condition>
    <and>
      <greater-than>
        <property>engines/engine[4]/rpm</property>
        <value>600.000</value>
      </greater-than>
      <less-than>
        <property>engines/engine[4]/rpm</property>
        <value>1500.001</value>
      </less-than>
    </and>
    </condition>
  </animation>

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

  <animation>
    <type>select</type>
    <object-name>propblurG2</object-name>
    <condition>
    <and>
      <greater-than>
        <property>engines/engine[5]/rpm</property>
        <value>600.000</value>
      </greater-than>
      <less-than>
        <property>engines/engine[5]/rpm</property>
        <value>1500.001</value>
      </less-than>
    </and>
    </condition>
  </animation>

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

  <animation>
    <type>select</type>
    <object-name>propblurG3</object-name>
    <condition>
    <and>
      <greater-than>
        <property>engines/engine[6]/rpm</property>
        <value>600.000</value>
      </greater-than>
      <less-than>
        <property>engines/engine[6]/rpm</property>
        <value>1500.001</value>
      </less-than>
    </and>
    </condition>
  </animation>

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

  <animation>
    <type>select</type>
    <object-name>propblurG4</object-name>
    <condition>
    <and>
      <greater-than>
        <property>engines/engine[7]/rpm</property>
        <value>600.000</value>
      </greater-than>
      <less-than>
        <property>engines/engine[7]/rpm</property>
        <value>1500.001</value>
      </less-than>
    </and>
    </condition>
  </animation>


<!-- On sélectionne l'hélice si rpm inférieur à 1000 -->
  <animation>
    <type>select</type>
    <object-name>helice-D1</object-name>
    <condition>
      <less-than>
        <property>engines/engine[0]/rpm</property>
	<value>1500</value>
      </less-than>
    </condition>
  </animation>

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

  <animation>
    <type>select</type>
    <object-name>helice-D3</object-name>
    <condition>
      <less-than>
        <property>engines/engine[2]/rpm</property>
	<value>1500</value>
      </less-than>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>helice-D4</object-name>
    <condition>
      <less-than>
        <property>engines/engine[3]/rpm</property>
	<value>1500</value>
      </less-than>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>helice-G1</object-name>
    <condition>
      <less-than>
        <property>engines/engine[4]/rpm</property>
	<value>1500</value>
      </less-than>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>helice-G2</object-name>
    <condition>
      <less-than>
        <property>engines/engine[5]/rpm</property>
	<value>1500</value>
      </less-than>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>helice-G3</object-name>
    <condition>
      <less-than>
        <property>engines/engine[6]/rpm</property>
	<value>1500</value>
      </less-than>
    </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>helice-G4</object-name>
    <condition>
      <less-than>
        <property>engines/engine[7]/rpm</property>
	<value>1500</value>
      </less-than>
    </condition>
  </animation>
 
<!-- Moteur droit d'extrémitée 1 -->
  <animation>
    <type>spin</type>
    <object-name>helice-D1</object-name>
    <object-name>bol-D1</object-name>
    <object-name>propdiscD1</object-name>
    <object-name>propblurD1</object-name>
    <property>engines/engine[0]/rpm</property>
    <factor> 1 </factor>
    <center>
     <x-m> -9.509 </x-m>
     <y-m> 26.156 </y-m>
     <z-m>  6.773 </z-m>
    </center>
    <axis>
      <x> -1.000 </x>
      <y>  0.000 </y>
      <z>  0.000 </z>
    </axis>
  </animation>

<!-- Moteur droit intérieur droit 2 -->
  <animation>
    <type>spin</type>
    <object-name>helice-D2</object-name>
    <object-name>bol-D2</object-name>
    <object-name>propdiscD2</object-name>
    <object-name>propblurD2</object-name>
    <property>engines/engine[1]/rpm</property>
    <factor> 1 </factor>
    <center>
     <x-m>-10.362 </x-m>
     <y-m> 19.944 </y-m>
     <z-m>  6.439 </z-m>
    </center>
    <axis>
      <x> -1.000 </x>
      <y>  0.000 </y>
      <z>  0.000 </z>
    </axis>
  </animation>

<!-- Moteur droit intérieur gauche 3 -->
  <animation>
    <type>spin</type>
    <object-name>helice-D3</object-name>
    <object-name>bol-D3</object-name>
    <object-name>propdiscD3</object-name>
    <object-name>propblurD3</object-name>
    <property>engines/engine[2]/rpm</property>
    <factor> 1 </factor>
    <center>
     <x-m>-10.900 </x-m>
     <y-m> 13.786 </y-m>
     <z-m>  5.906 </z-m>
    </center>
    <axis>
      <x> -1.000 </x>
      <y>  0.000 </y>
      <z>  0.000 </z>
    </axis>
  </animation>

<!-- Moteur droit intérieur 4 -->
  <animation>
    <type>spin</type>
    <object-name>helice-D4</object-name>
    <object-name>bol-D4</object-name>
    <object-name>propdiscD4</object-name>
    <object-name>propblurD4</object-name>
    <property>engines/engine[3]/rpm</property>
    <factor> 1 </factor>
    <center>
     <x-m>-11.728 </x-m>
     <y-m>  7.533 </y-m>
     <z-m>  5.421 </z-m>
    </center>
    <axis>
      <x> -1.000 </x>
      <y>  0.000 </y>
      <z>  0.000 </z>
    </axis>
  </animation>

<!-- Moteur gauche d'extrémitée 5 -->
  <animation>
    <type>spin</type>
    <object-name>helice-G1</object-name>
    <object-name>bol-G1</object-name>
    <object-name>propdiscG1</object-name>
    <object-name>propblurG1</object-name>
    <property>engines/engine[4]/rpm</property>
    <factor> 1 </factor>
    <center>
     <x-m>  -9.509 </x-m>
     <y-m> -26.156 </y-m>
     <z-m>   6.773 </z-m>
    </center>
    <axis>
      <x> 1.000 </x>
      <y> 0.000 </y>
      <z> 0.000 </z>
    </axis>
  </animation>

<!-- Moteur gauche intérieur gauche 6 -->
  <animation>
    <type>spin</type>
    <object-name>helice-G2</object-name>
    <object-name>bol-G2</object-name>
    <object-name>propdiscG2</object-name>
    <object-name>propblurG2</object-name>
    <property>engines/engine[5]/rpm</property>
    <factor> 1 </factor>
    <center>
     <x-m>-10.362 </x-m>
     <y-m>-19.944 </y-m>
     <z-m>  6.439 </z-m>
    </center>
    <axis>
      <x> 1.000 </x>
      <y> 0.000 </y>
      <z> 0.000 </z>
    </axis>
  </animation>

<!-- Moteur gauche intérieur droit 7 -->
  <animation>
    <type>spin</type>
    <object-name>helice-G3</object-name>
    <object-name>bol-G3</object-name>
    <object-name>propdiscG3</object-name>
    <object-name>propblurG3</object-name>
    <property>engines/engine[6]/rpm</property>
    <factor> 1 </factor>
    <center>
     <x-m>-10.900 </x-m>
     <y-m>-13.786 </y-m>
     <z-m>  5.906 </z-m>
    </center>
    <axis>
      <x> 1.000 </x>
      <y> 0.000 </y>
      <z> 0.000 </z>
    </axis>
  </animation>

<!-- Moteur gauche intérieur 8 -->
  <animation>
    <type>spin</type>
    <object-name>helice-G4</object-name>
    <object-name>bol-G4</object-name>
    <object-name>propdiscG4</object-name>
    <object-name>propblurG4</object-name>
    <property>engines/engine[7]/rpm</property>
    <factor> 1 </factor>
    <center>
     <x-m>-11.728 </x-m>
     <y-m> -7.533 </y-m>
     <z-m>  5.421 </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>aileron-G</object-name>
  <property>surface-positions/left-aileron-pos-norm</property>
  <factor>-25.0</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>-25.0</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>

<!-- Gouverne de profondeur gauche -->
 <animation>
   <type>rotate</type>
   <object-name>aileron-A-G</object-name>
   <property>surface-positions/elevator-pos-norm</property>
   <factor>25.0</factor>
   <offset-deg>0</offset-deg>   
   <center> 
     <x-m> 39.210 </x-m>
     <y-m> -5.699 </y-m>
     <z-m>  8.000 </z-m>
   </center>
   <axis>
     <x> 0.0 </x>
     <y> 1.0 </y>
     <z> 0.0 </z>
   </axis>
 </animation>

<!-- Gouverne de profondeur droite -->
 <animation>
   <type>rotate</type>
   <object-name>aileron-A-D</object-name>
   <property>surface-positions/elevator-pos-norm</property>
   <factor>-25.0</factor>
   <offset-deg>0</offset-deg>   
   <center>
     <x-m> 39.210 </x-m>
     <y-m>  5.699 </y-m>
     <z-m>  8.000 </z-m>
   </center>
   <axis>
    <x>  0.0 </x>
    <y> -1.0 </y> 
    <z>  0.0 </z>
   </axis>
 </animation>
 
<!-- Gouverne de direction -->
 <animation>
   <type>rotate</type>
   <object-name>gouverne</object-name>
   <property>surface-positions/rudder-pos-norm</property>
   <factor>20</factor>
   <offset-deg>0</offset-deg>   
   <center>
     <x-m> 40.960 </x-m>
     <y-m>  0.000 </y-m>
     <z-m> 14.171 </z-m>
   </center>
   <axis>
     <x>  0.0 </x>
     <y>  0.0 </y>
     <z> -1.0 </z>
   </axis>
 </animation>

<!-- Volets -->
  <animation>
    <type>rotate</type>
    <object-name>flap-G</object-name>
    <property>surface-positions/flap-pos-norm</property>
    <factor>-55.0</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.0</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>porte-A-G</object-name>
    <object-name>hublot-A-G</object-name>    
    <property>instrumentation/doors/crew/position-norm</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.000 </x>
      <y> 0.000 </y>
      <z> 1.000 </z>
    </axis>
  </animation>

  </animation>
    <type>rotate</type>
    <object-name>porte-A-D</object-name>
    <object-name>hublot-A-D</object-name>    
    <property>instrumentation/doors/passenger/position-norm</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.000 </x>
      <y> 0.000 </y>
      <z> 1.000 </z>
    </axis>
  </animation>
-->

</PropertyList>
