<?xml version="1.0"?>

<!-- 
     VRP :
     - the model is shifted at the nose tip, where one wants the FDM to compute the movement.
     - that doesn't affect the animations.
     - that only requires a shift of views.
     - IMPORTANT : the model is already aligned vertically from Blender.


     Panels :
     all panels are 1024x512, i.e. surface must have width/height = 2/1, to keep the scale of instruments.


     Aninmation :
     - x y z Blender => x z y animation.
     - 1 blender unit = 1 m.
     - multiplayer requires property without leading slash.



     References :
     ==========

     - http://case.pr.erau.edu/reports/US_reports/1940/1943.02.22_PanAmericanAirways_Boeing-314.pdf
     (crash - 22 february 1943 Lisbon, Portugal) :

     Elevator range : +/-25 deg (20 + 5).
 
     - http://www.airweb.faa.gov/Regulatory_and_Guidance_Library/rgMakeModel.nsf/MainFrame?OpenFrameSet
     (FAA certificate, TC176 - Wright Double row Cyclone GR-260025) :

     Gear ratio 16 : 9.

     - http://www.southernoregonwarbirds.org/fa3.html/
     (Franck Varnum flew during WWII). 

     The propellers were geared down 9:5 from engine shaft, so when we slowed the engines to 1500 rpm
     the props were only turning at 850 rpm.


     Known problems :
     ==============
     - the shaft is visible behind the propeller disc, because they are not in a group.

-->

<PropertyList>

 <path>Boeing314Clipper.ac</path>

 <offsets>


<!-- VRP at nose -->

   <x-m>16.30</x-m>             <!-- model is not exactly at the middle of length 106 feet. -->

<!-- The black painting of the hull should be visible, if empty load.
     Both sponsons touch inside water (not only 1), if full load.
 -->
   <z-m> 0.0</z-m>               <!-- aligned by FDM gear, if model at scale. -->


 </offsets>

 <!-- ======================================= -->
 <!-- panel models (X/Y/Z depth/width/height) -->
 <!-- ======================================= -->

 <!-- PILOT -->

  <panel>
   <path>Aircraft/Boeing314/Panels/Boeing314A-pilot.xml</path>
   <bottom-left>
    <x-m>-10.94</x-m>
    <y-m>-0.950</y-m>
    <z-m> 0.3675</z-m>
   </bottom-left>
   <bottom-right>
    <x-m>-10.94</x-m>
    <y-m> 0.955</y-m>
    <z-m> 0.3675</z-m>
   </bottom-right>
   <top-left>
    <x-m>-11.14</x-m>
    <y-m>-0.950</y-m>
    <z-m> 1.32</z-m>
   </top-left>
  </panel>

 <!-- OVERHEAD -->

  <panel>
   <path>Aircraft/Boeing314/Panels/Boeing314A-overhead.xml</path>
   <bottom-left>
    <x-m>-11.0825</x-m>
    <y-m>-0.610</y-m>
    <z-m> 1.59</z-m>
   </bottom-left>
   <bottom-right>
    <x-m>-11.0825</x-m>
    <y-m> 1.295</y-m>
    <z-m> 1.59</z-m>
   </bottom-right>
   <top-left>
    <x-m>-10.18</x-m>
    <y-m>-0.610</y-m>
    <z-m> 1.69</z-m>
   </top-left>
  </panel>

 <!-- ENGINEER -->

  <panel>
   <path>Aircraft/Boeing314/Panels/Boeing314A-engineer.xml</path>
   <bottom-left>
    <x-m>-6.98</x-m>
    <y-m> 1.48</y-m>
    <z-m> 0.90</z-m>
   </bottom-left>
   <bottom-right>
    <x-m>-5.78</x-m>
    <y-m> 1.48</y-m>
    <z-m> 0.90</z-m>
   </bottom-right>
   <top-left>
    <x-m>-6.98</x-m>
    <y-m> 1.48</y-m>
    <z-m> 1.50</z-m>
   </top-left>
  </panel>

  <panel>
   <path>Aircraft/Boeing314/Panels/Boeing314A-engineer-lever.xml</path>
   <bottom-left>
    <x-m>-6.98</x-m>
    <y-m> 1.39</y-m>
    <z-m> 0.86</z-m>
   </bottom-left>
   <bottom-right>
    <x-m>-5.78</x-m>
    <y-m> 1.39</y-m>
    <z-m> 0.86</z-m>
   </bottom-right>
   <top-left>
    <x-m>-6.98</x-m>
    <y-m> 1.94</y-m>
    <z-m> 1.38</z-m>
   </top-left>
  </panel>

 <!-- RADIO -->

  <panel>
   <path>Aircraft/Boeing314/Panels/Boeing314A-radio.xml</path>
   <bottom-left>
    <x-m>-8.28</x-m>
    <y-m> 0.86</y-m>
    <z-m> 0.85</z-m>
   </bottom-left>
   <bottom-right>
    <x-m>-8.28</x-m>
    <y-m> 1.70</y-m>
    <z-m> 0.85</z-m>
   </bottom-right>
   <top-left>
    <x-m>-8.28</x-m>
    <y-m> 0.86</y-m>
    <z-m> 1.27</z-m>
   </top-left>
   <depth-test type="bool">true</depth-test>          <!-- alpha to hide pilot panel -->
  </panel>


<!-- ============= -->
<!-- Optimizations -->
<!-- ============= -->


<!-- ================================== -->
<!-- Animations (x/y/z = back/right/up) -->
<!-- ================================== -->

<!-- PROPELLERS -->

 <animation>
  <type>noshadow</type>
  <object-name>PropellerDisc1</object-name>
  <object-name>PropellerDisc2</object-name>
  <object-name>PropellerDisc3</object-name>
  <object-name>PropellerDisc4</object-name>
 </animation>

<!-- assume 1/7 gear ratio -->

<!-- OUTBOARDS PROPELLERS -->

 <animation>
  <type>spin</type>
  <object-name>PropellerDisc1</object-name>
  <object-name>PropellerShaft1</object-name>
  <object-name>Propeller1</object-name>
  <property>engines/engine[0]/rpm</property>
  <factor>0.5625</factor> <!-- real 16 : 9 -->
  <center>
   <x-m>0.0</x-m>
   <y-m>-10.07</y-m>
   <z-m>1.70</z-m>
  </center>
  <axis>
   <x>1</x>
   <y>0</y>
   <z>0</z>
  </axis>
 </animation>

 <animation> 
  <type>blend</type>
  <object-name>PropellerDisc1</object-name>
  <property>engines/engine[0]/rpm</property>
  <factor>0.00015</factor>
  <offset>-0.5</offset>
  <min>0.0</min>
  <max>0.5</max>
 </animation>

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

 <animation>
  <type>select</type>
  <object-name>PropellerShaft1</object-name>
  <object-name>PropellerDisc1</object-name>
  <condition>
   <greater-than-equals>
    <property>engines/engine[0]/rpm</property>
    <value>1800</value>
   </greater-than-equals>
  </condition>
 </animation>

<!-- 4 -->

 <animation>
  <type>spin</type>
  <object-name>PropellerDisc4</object-name>
  <object-name>PropellerShaft4</object-name>
  <object-name>Propeller4</object-name>
  <property>engines/engine[3]/rpm</property>
  <factor>0.5625</factor> <!-- test with 0.01 -->
  <center>
   <x-m>0.0</x-m>
   <y-m>10.05</y-m>
   <z-m>1.70</z-m>
  </center>
  <axis>
   <x>1</x>
   <y>0</y>
   <z>0</z>
  </axis>
 </animation>

 <animation> 
  <type>blend</type>
  <object-name>PropellerDisc4</object-name>
  <property>engines/engine[3]/rpm</property>
  <factor>0.00015</factor>
  <offset>-0.5</offset>
  <min>0.0</min>
  <max>0.5</max>
 </animation>

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

 <animation>
  <type>select</type>
  <object-name>PropellerShaft4</object-name>
  <object-name>PropellerDisc4</object-name>
  <condition>
   <greater-than-equals>
    <property>engines/engine[3]/rpm</property>
    <value>1800</value>
   </greater-than-equals>
  </condition>
 </animation>

<!-- INBOARDS PROPELLERS -->

 <animation>
  <type>spin</type>
  <object-name>PropellerDisc2</object-name>
  <object-name>PropellerShaft2</object-name>
  <object-name>Propeller2</object-name>
  <property>engines/engine[1]/rpm</property>
  <factor>0.5625</factor>
  <center>
   <x-m>0.0</x-m>
   <y-m>-4.75</y-m>
   <z-m>0.92</z-m>
  </center>
  <axis>
   <x>1</x>
   <y>0</y>
   <z>0</z>
  </axis>
 </animation>

 <animation> 
  <type>blend</type>
  <object-name>PropellerDisc2</object-name>
  <property>engines/engine[1]/rpm</property>
  <factor>0.00015</factor>
  <offset>-0.5</offset>
  <min>0.0</min>
  <max>0.5</max>
 </animation>

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

 <animation>
  <type>select</type>
  <object-name>PropellerShaft2</object-name>
  <object-name>PropellerDisc2</object-name>
  <condition>
   <greater-than-equals>
    <property>engines/engine[1]/rpm</property>
    <value>1800</value>
   </greater-than-equals>
  </condition>
 </animation>

<!-- 3 -->

 <animation>
  <type>spin</type>
  <object-name>PropellerDisc3</object-name>
  <object-name>PropellerShaft3</object-name>
  <object-name>Propeller3</object-name>
  <property>engines/engine[2]/rpm</property>
  <factor>0.5625</factor> <!-- test with 0.01 -->
  <center>
   <x-m>0.0</x-m>
   <y-m>4.72</y-m>
   <z-m>0.92</z-m>
  </center>
  <axis>
   <x>1</x>
   <y>0</y>
   <z>0</z>
  </axis>
 </animation>

 <animation> 
  <type>blend</type>
  <object-name>PropellerDisc3</object-name>
  <property>engines/engine[2]/rpm</property>
  <factor>0.00015</factor>
  <offset>-0.5</offset>
  <min>0.0</min>
  <max>0.5</max>
 </animation>

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

 <animation>
  <type>select</type>
  <object-name>PropellerShaft3</object-name>
  <object-name>PropellerDisc3</object-name>
  <condition>
   <greater-than-equals>
    <property>engines/engine[2]/rpm</property>
    <value>1800</value>
   </greater-than-equals>
  </condition>
 </animation>

<!-- FLAP -->

 <animation>
  <type>rotate</type>
  <object-name>LeftFlap</object-name>
  <property>surface-positions/flap-pos-norm</property>
  <factor>-55.0</factor>
  <offset-deg>0</offset-deg>   
  <center>
   <x-m>-0.12</x-m>
   <y-m>-8.4</y-m>
   <z-m>1.60</z-m>
  </center>
  <axis>
   <x>-0.11</x>
   <y>-1.0</y>
   <z>0.07</z>
  </axis>
 </animation>

 <animation>
  <type>rotate</type>
  <object-name>RightFlap</object-name>
  <property>surface-positions/flap-pos-norm</property>
  <factor>55.0</factor>
  <offset-deg>0</offset-deg>   
  <center>
   <x-m>-0.12</x-m>
   <y-m>8.4</y-m>
   <z-m>1.60</z-m>
  </center>
  <axis>
   <x>-0.11</x> <!-- height -->
   <y>1.0</y>
   <z>0.07</z> <!-- depth -->
  </axis>
 </animation>

<!-- AILERON -->

 <animation>
  <type>rotate</type>
  <object-name>LeftAileron</object-name>
  <property>surface-positions/left-aileron-pos-norm</property>
  <factor>25.0</factor>
  <offset-deg>0</offset-deg>   
  <center>
   <x-m>-1.16</x-m>
   <y-m>-19.19</y-m>
   <z-m>2.16</z-m>
  </center>
  <axis>
   <x>-0.14</x>
   <y>-1.0</y>
   <z>0.05</z>
  </axis>
 </animation>

 <animation>
  <type>rotate</type>
  <object-name>RightAileron</object-name>
  <property>surface-positions/right-aileron-pos-norm</property>
  <factor>25.0</factor>
  <offset-deg>0</offset-deg>   
  <center>
   <x-m>-1.16</x-m>
   <y-m>19.19</y-m>
   <z-m>2.16</z-m>
  </center>
  <axis>
   <x>-0.14</x> <!-- height -->
   <y>1.0</y>
   <z>0.05</z> <!-- depth -->
  </axis>
 </animation>

<!-- ELEVATOR -->

 <animation>
  <type>rotate</type>
  <object-name>LeftElevator</object-name>
  <property>surface-positions/elevator-pos-norm</property>
  <factor>25.0</factor> <!-- real -->
  <offset-deg>0</offset-deg>   
  <center>
   <x-m>14.49</x-m>
   <y-m>0.0</y-m>
   <z-m>2.04</z-m>
  </center>
  <axis>
   <x>0.0</x>
   <y>1.0</y>
   <z>0.0</z>
  </axis>
 </animation>

 <animation>
  <type>rotate</type>
  <object-name>RightElevator</object-name>
  <property>surface-positions/elevator-pos-norm</property>
  <factor>-25.0</factor> <!-- real -->
  <offset-deg>0</offset-deg>   
  <center>
   <x-m>14.49</x-m>
   <y-m>0.0</y-m>
   <z-m>2.04</z-m>
  </center>
  <axis>
   <x>0.0</x>
   <y>-1.0</y>
   <z>0.0</z>
  </axis>
 </animation>

<!-- RUDDER -->

 <animation>
  <type>rotate</type>
  <object-name>LeftRudder</object-name>
  <property>surface-positions/rudder-pos-norm</property>
  <factor>20</factor>
  <offset-deg>0</offset-deg>   
  <center>
   <x-m>14.37</x-m>
   <y-m>-6.95</y-m>
   <z-m>0.0</z-m>
  </center>
  <axis>
   <x>0.0</x>
   <y>0.0</y>
   <z>1.0</z>
  </axis>
 </animation>

 <animation>
  <type>rotate</type>
  <object-name>RightRudder</object-name>
  <property>surface-positions/rudder-pos-norm</property>
  <factor>20</factor>
  <offset-deg>0</offset-deg>   
  <center>
   <x-m>14.37</x-m>
   <y-m>6.95</y-m>
   <z-m>0.0</z-m>
  </center>
  <axis>
   <x>0.0</x>
   <y>0.0</y>
   <z>1.0</z>
  </axis>
 </animation>

<!-- ANCHOR -->

 <animation>
  <type>select</type>
  <object-name>AnchorLeft</object-name>
  <object-name>AnchorRight</object-name>
  <condition>
   <not-equals>
    <property>controls/gear/brake-parking</property>
    <value>0.0</value>
   </not-equals>
  </condition>
 </animation>

</PropertyList>
