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

<PropertyList>

  <path>deperdussin.ac</path>

  <nasal>
    <load>
      var livery_update = aircraft.livery_update.new("Aircraft/Deperdussin/Models/Liveries", 10);

      var self = cmdarg();

      var float_0 = self.getNode("sim/multiplay/generic/float[0]", 1);
      var float_1 = self.getNode("sim/multiplay/generic/float[1]", 1);
      
      var crew_door = self.getNode("sim/model/door-positions/crew/position-norm", 1);
      var passenger_door = self.getNode("sim/model/door-positions/passenger/position-norm", 1);
      
      crew_door.alias(float_0);
      passenger_door.alias(float_1);
    </load>

    <unload>
      livery_update.stop();
      crew_door.unalias();
      passenger_door.unalias();
    </unload>
  </nasal>

  <animation>
    <!-- Objets opaques -->
    <object-name>fuselage</object-name>
    <object-name>capot</object-name>
    <object-name>bol</object-name>
    <object-name>ailes</object-name>
    <object-name>ailesG1</object-name>
    <object-name>ailesG2</object-name>
    <object-name>ailesG3</object-name>
    <object-name>ailesstructG1</object-name>
    <object-name>ailesstructG2</object-name>
    <object-name>ailesstructG3</object-name>
    <object-name>ailesstructD3</object-name>
    <object-name>ailesstructD2</object-name>
    <object-name>ailesstructD1</object-name>
    <object-name>ailesD3</object-name>
    <object-name>ailesD2</object-name>
    <object-name>ailesD1</object-name>
    <object-name>intcapot</object-name>
    <object-name>armature</object-name>
    <object-name>derive</object-name>
    <object-name>roueG</object-name>
    <object-name>roueD</object-name> 
    <object-name>essieu</object-name>
    <object-name>trains</object-name>
    <object-name>profondeur</object-name>
    <object-name>direction</object-name>
    <object-name>helice</object-name>
    <object-name>pate</object-name>
    <object-name>trous</object-name>
    <object-name>reservoir</object-name>
    <object-name>nervures</object-name>
    <object-name>tringleProfH</object-name>
    <object-name>tringleProfB</object-name>
    <object-name>tringleDirG</object-name>
    <object-name>tringleDirD</object-name>
    <object-name>cables</object-name>
    
    <!-- Objets transparents -->
    <object-name>vitres</object-name>
    <object-name>propdisc</object-name>
    <object-name>propblur</object-name>
  </animation>

  <animation>
    <type>material</type>
    <object-name>fuselage</object-name>
    <object-name>capot</object-name>
    <object-name>bol</object-name>
    <object-name>ailes</object-name>
    <object-name>ailesG1</object-name>
    <object-name>ailesG2</object-name>
    <object-name>ailesG3</object-name>
    <object-name>ailesstructG1</object-name>
    <object-name>ailesstructG2</object-name>
    <object-name>ailesstructG3</object-name>
    <object-name>ailesstructD3</object-name>
    <object-name>ailesstructD2</object-name>
    <object-name>ailesstructD1</object-name>
    <object-name>ailesD3</object-name>
    <object-name>ailesD2</object-name>
    <object-name>ailesD1</object-name>
    <object-name>intcapot</object-name>
    <object-name>armature</object-name>
    <object-name>derive</object-name>
    <object-name>roueG</object-name>
    <object-name>roueD</object-name> 
    <object-name>essieu</object-name>
    <object-name>trains</object-name>
    <object-name>profondeur</object-name>
    <object-name>direction</object-name>
    <object-name>helice</object-name>
    <object-name>pate</object-name>
    <object-name>trous</object-name>
    <object-name>reservoir</object-name>
    <object-name>nervures</object-name>
    <object-name>tringleProfH</object-name>
    <object-name>tringleProfB</object-name>
    <object-name>tringleDirG</object-name>
    <object-name>tringleDirD</object-name>
    <object-name>cables</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>

  <!-- working for Rembrandt -->
  <effect>
    <inherits-from>Aircraft/Deperdussin/Models/Effects/Glass/glass</inherits-from>
    <object-name>vitres</object-name>
  </effect>
  
  <effect>
    <inherits-from>Effects/model-transparent</inherits-from>
    <object-name>vitres</object-name>
  </effect>
  
  <!-- Une ombre pour OSG -->
  <model>
    <path>Aircraft/Deperdussin/Models/shadow.xml</path>
    <offsets>
      <x-m>  0.0 </x-m>
      <y-m>  0.0 </y-m>
      <z-m> -0.8 </z-m>
    </offsets>
  </model>
  
  <!-- Engine -->
  <model>
    <path>Aircraft/Deperdussin/Models/Engine/engine.xml</path>
    <offsets>
      <x-m> -2.48467 </x-m>
      <y-m>  0.00000 </y-m>
      <z-m>  0.27207 </z-m>
    </offsets>
  </model>
  
  <!-- Interieur -->
  <model>
    <path>Aircraft/Deperdussin/Models/Interior/interior.xml</path>
  </model>

  <model>
    <path>Aircraft/Deperdussin/Models/Effects/cranking/all-cranking.xml</path>
  </model>
  
  <!-- Effets sur le sol -->
  <!-- Left wheel -->
  <model>
    <path>Aircraft/Deperdussin/Models/Effects/ground/ground0.xml</path>
    <offsets>
      <x-m> -1.732 </x-m>
      <y-m> -0.662 </y-m>
      <z-m> -1.137 </z-m>
    </offsets>
  </model>
  
  <!-- Right wheel -->
  <model>
    <path>Aircraft/Deperdussin/Models/Effects/ground/ground1.xml</path>
    <offsets>
      <x-m> -1.732 </x-m>
      <y-m>  0.662 </y-m>
      <z-m> -1.137 </z-m>
    </offsets>
  </model>
  
  <!-- Rear -->
  <model>
    <path>Aircraft/Deperdussin/Models/Effects/ground/ground2.xml</path>
    <offsets>
      <x-m>  2.511 </x-m>
      <y-m>  0.000 </y-m>
      <z-m> -0.159 </z-m>
    </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>
    <object-name>moteur</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>
    <condition>
      <greater-than>
        <property>engines/engine[0]/rpm</property>
        <value> 5 </value>
      </greater-than>
    </condition>
    <property>engines/engine[0]/rpm</property>
    <factor> 1 </factor>
    <center>
      <x-m> -2.823 </x-m>
      <y-m>  0.000 </y-m>
      <z-m>  0.272 </z-m>
    </center>
    <axis>
      <x> -1 </x>
      <y>  0 </y>
      <z>  0 </z>
    </axis>
  </animation>

  <!-- Gouverne de profondeur -->
  <animation>
    <name>ProfondeurTotale</name>
    <object-name>profondeur</object-name>
    <object-name>tringleProfH</object-name>
    <object-name>tringleProfB</object-name>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>ProfondeurTotale</object-name>
    <property>surface-positions/elevator-pos-norm</property>
    <factor>11</factor>
    <center>
      <x-m> 2.521 </x-m>
      <y-m> 0.000 </y-m>
      <z-m> 0.349 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 1 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>tringleProfH</object-name>
    <property>surface-positions/elevator-pos-norm</property>
    <factor>-11</factor>
    <center>
      <x-m> 2.545 </x-m>
      <y-m> 0.000 </y-m>
      <z-m> 0.473 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 1 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>tringleProfB</object-name>
    <property>surface-positions/elevator-pos-norm</property>
    <factor> -11 </factor>
    <center>
      <x-m> 2.546 </x-m>
      <y-m> 0.000 </y-m>
      <z-m> 0.222 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 1 </y>
      <z> 0 </z>
    </axis>
  </animation>

  <!-- Gouverne de direction -->
  <animation>
    <name>DirectionTotale</name>
    <object-name>direction</object-name>
    <object-name>tringleDirG</object-name>
    <object-name>tringleDirD</object-name>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>DirectionTotale</object-name>
    <property>surface-positions/rudder-pos-norm</property>
    <factor> 20 </factor>
    <center>
      <x-m> 2.559 </x-m>
      <y-m> 0.000 </y-m>
      <z-m> 0.522 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation> 

  <animation>
    <type>rotate</type>
    <object-name>tringleDirG</object-name>
    <property>surface-positions/rudder-pos-norm</property>
    <factor> -20 </factor>
    <center>
      <x-m>  2.527 </x-m>
      <y-m> -0.082 </y-m>
      <z-m>  0.524 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation> 

  <animation>
    <type>rotate</type>
    <object-name>tringleDirD</object-name>
    <property>surface-positions/rudder-pos-norm</property>
    <factor> -20 </factor>
    <center>
      <x-m> 2.527 </x-m>
      <y-m> 0.082 </y-m>
      <z-m> 0.524 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation> 

  <!-- Gauchissement des ailes -->
  <!-- Gauche -->
  <animation>
    <name>AileronGaucheComplet</name>
    <object-name>ailesstructG1</object-name>
    <object-name>ailesstructG2</object-name>
    <object-name>ailesstructG3</object-name>
    <object-name>ailesG1</object-name>
    <object-name>ailesG2</object-name>
    <object-name>ailesG3</object-name>
  </animation>
  
  <animation>
    <type>rotate</type>
    <object-name>AileronGaucheComplet</object-name>
    <property>surface-positions/left-aileron-pos-norm</property>
    <factor> 1.5 </factor>
    <axis>
      <x1-m> -2.01671 </x1-m>
      <y1-m> -3.32329 </y1-m>
      <z1-m>  0.55941 </z1-m>
      <x2-m> -0.66029 </x2-m>
      <y2-m> -0.92333 </y2-m>
      <z2-m>  0.41689 </z2-m>
    </axis>
  </animation>
  
  <animation>
    <name>SousAileronGauche1</name>
    <object-name>ailesstructG2</object-name>
    <object-name>ailesstructG3</object-name>
    <object-name>ailesG2</object-name>
    <object-name>ailesG3</object-name>
  </animation>
  
  <animation>
    <type>rotate</type>
    <object-name>SousAileronGauche1</object-name>
    <property>surface-positions/left-aileron-pos-norm</property>
    <factor> 2.5 </factor>
    <axis>
      <x1-m> -1.49648 </x1-m>
      <y1-m> -3.27166 </y1-m>
      <z1-m>  0.52384 </z1-m>
      <x2-m> -0.66029 </x2-m>
      <y2-m> -1.79206 </y2-m>
      <z2-m>  0.41689 </z2-m>
    </axis>
  </animation>
  
  <animation>
    <name>SousAileronGauche2</name>
    <object-name>ailesstructG3</object-name>
    <object-name>ailesG3</object-name>
  </animation>
  
  <animation>
    <type>rotate</type>
    <object-name>SousAileronGauche2</object-name>
    <property>surface-positions/left-aileron-pos-norm</property>
    <factor> 3.5 </factor>
    <axis>
      <x1-m> -1.04268 </x1-m>
      <y1-m> -3.22128 </y1-m>
      <z1-m>  0.48343 </z1-m>
      <x2-m> -0.66029 </x2-m>
      <y2-m> -2.53436 </y2-m>
      <z2-m>  0.41689 </z2-m>
    </axis>
  </animation>
  
  <!-- Droit -->
  <animation>
    <name>AileronDroitComplet</name>
    <object-name>ailesstructD1</object-name>
    <object-name>ailesstructD2</object-name>
    <object-name>ailesstructD3</object-name>
    <object-name>ailesD1</object-name>
    <object-name>ailesD2</object-name>
    <object-name>ailesD3</object-name>
  </animation>
  
  <animation>
    <type>rotate</type>
    <object-name>AileronDroitComplet</object-name>
    <property>surface-positions/right-aileron-pos-norm</property>
    <factor> 1.5 </factor>
    <axis>
      <x1-m> -0.66029 </x1-m>
      <y1-m>  0.92333 </y1-m>
      <z1-m>  0.41689 </z1-m>
      <x2-m> -2.01671 </x2-m>
      <y2-m>  3.32329 </y2-m>
      <z2-m>  0.55941 </z2-m>
    </axis>
  </animation>
  
  <animation>
    <name>SousAileronDroit1</name>
    <object-name>ailesstructD2</object-name>
    <object-name>ailesstructD3</object-name>
    <object-name>ailesD2</object-name>
    <object-name>ailesD3</object-name>
  </animation>
  
  <animation>
    <type>rotate</type>
    <object-name>SousAileronDroit1</object-name>
    <property>surface-positions/right-aileron-pos-norm</property>
    <factor> 2.5 </factor>
    <axis>
      <x1-m> -0.66029 </x1-m>
      <y1-m>  1.79206 </y1-m>
      <z1-m>  0.41689 </z1-m>
      <x2-m> -1.49648 </x2-m>
      <y2-m>  3.27166 </y2-m>
      <z2-m>  0.52384 </z2-m>
    </axis>
  </animation>
  
  <animation>
    <name>SousAileronDroit2</name>
    <object-name>ailesstructD3</object-name>
    <object-name>ailesD3</object-name>
  </animation>
  
  <animation>
    <type>rotate</type>
    <object-name>SousAileronDroit2</object-name>
    <property>surface-positions/right-aileron-pos-norm</property>
    <factor> 3.5 </factor>
    <axis>
      <x1-m> -0.66029 </x1-m>
      <y1-m>  2.53436 </y1-m>
      <z1-m>  0.41689 </z1-m>
      <x2-m> -1.04268 </x2-m>
      <y2-m>  3.22128 </y2-m>
      <z2-m>  0.48343 </z2-m>
    </axis>
  </animation>
  
  <!-- Rotation des roues lors du roulage -->
  <animation>
    <type>spin</type>
    <object-name>roueG</object-name>
    <property>/gear/gear[0]/rollspeed-ms</property>
    <factor> 30 </factor>
    <center>
      <x-m> -1.732 </x-m>
      <y-m> -0.662 </y-m>
      <z-m> -0.777 </z-m>
    </center>
    <axis>
      <x>  0 </x>
      <y> -1 </y>
      <z>  0 </z>
    </axis>
  </animation>

  <animation>
    <type>spin</type>
    <object-name>roueD</object-name>
    <property>/gear/gear[1]/rollspeed-ms</property>
    <factor> 30 </factor>
    <center>
      <x-m> -1.732 </x-m>
      <y-m>  0.662 </y-m>
      <z-m> -0.777 </z-m>
    </center>
    <axis>
      <x>  0 </x>
      <y> -1 </y>
      <z>  0 </z>
    </axis>
  </animation>

</PropertyList>
