<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
	<path>dr400.ac</path>
	<nasal>
		<load>
			<![CDATA[
				var livery_update = aircraft.livery_update.new("Aircraft/DR400-Ecoflyer/Models/Liveries");
				
				var rplyer = cmdarg();
				
				rplayer.getNode( "gear/gear[0]/rollspeed-ms" ).alias( 				rplayer.getNode("sim/multiplay/generic/float[ 0 ]") );
				rplayer.getNode( "gear/gear[1]/rollspeed-ms" ).alias( 				rplayer.getNode("sim/multiplay/generic/float[ 1 ]") );
				rplayer.getNode( "gear/gear[2]/rollspeed-ms" ).alias( 				rplayer.getNode("sim/multiplay/generic/float[ 2 ]") );
				rplayer.getNode( "fdm/jsbsim/doors/canopy-pos-norm" ).alias( 			rplayer.getNode("sim/multiplay/generic/float[ 3 ]") );
				rplayer.getNode( "systems/electrical/outputs/strobe-light-norm" ).alias( 	rplayer.getNode("sim/multiplay/generic/float[ 4 ]") );
				rplayer.getNode( "systems/electrical/outputs/nav-lights-norm" ).alias( 		rplayer.getNode("sim/multiplay/generic/float[ 5 ]") );
				rplayer.getNode( "systems/electrical/outputs/taxi-light-norm" ).alias( 		rplayer.getNode("sim/multiplay/generic/float[ 6 ]") );
				rplayer.getNode( "systems/electrical/outputs/landing-light-norm" ).alias( 	rplayer.getNode("sim/multiplay/generic/float[ 7 ]") );
				
			]]>
		</load>
		<unload>
			<![CDATA[
				livery_update.stop();
				
				rplayer.getNode( "gear/gear[0]/rollspeed-ms" ).unalias();
				rplayer.getNode( "gear/gear[1]/rollspeed-ms" ).unalias();
				rplayer.getNode( "gear/gear[2]/rollspeed-ms" ).unalias();
				rplayer.getNode( "fdm/jsbsim/doors/canopy-pos-norm" ).unalias();
				rplayer.getNode( "systems/electrical/outputs/strobe-light-norm" ).unalias();
				rplayer.getNode( "systems/electrical/outputs/nav-lights-norm" ).unalias();
				rplayer.getNode( "systems/electrical/outputs/taxi-light-norm" ).unalias();
				rplayer.getNode( "systems/electrical/outputs/landing-light-norm" ).unalias();
			]]>
		</unload>
	</nasal>
	<!-- Livery Animation -->
	<animation>
		<type>material</type>
		<object-name>flaps</object-name>
		<object-name>aileron.R</object-name>
		<object-name>aileron.L</object-name>
		<object-name>wings</object-name>
		<object-name>fuselage</object-name>
		<object-name>canopy.frame</object-name>
		<object-name>baggage_door</object-name>
		<object-name>prop</object-name>
		<object-name>spinner</object-name>
		<object-name>rudder</object-name>
		<object-name>hstab</object-name>
		<object-name>wheelfairingF</object-name>
		<object-name>gearF</object-name>
		<object-name>wheelfairingL</object-name>
		<object-name>gearL</object-name>
		<object-name>wheelfairingR</object-name>
		<object-name>gearR</object-name>
		<object-name>aileronacL</object-name>
		<object-name>aileronacR</object-name>
		<property-base>sim/model/livery</property-base>
		<texture-prop>texture</texture-prop>
		<texture>dr400.png</texture>
	</animation>
	<animation>
		<type>material</type>
		<object-name>canopy.glass</object-name>
		<object-name>windows</object-name>
		<ambient>
			<red>0.2</red>
			<green>0.2</green>
			<blue>0.2</blue>
		</ambient>
	</animation>
	<!-- All transparent objects -->
	<animation>
		<type>noshadow</type>
		<object-name>canopy.glass</object-name>
		<object-name>windows</object-name>
		<object-name>propdisc</object-name>
		<object-name>propblur</object-name>
	</animation>
	<animation>
		<type>shader</type>
		<shader>chrome</shader>
		<texture>Aircraft/DR400-Ecoflyer/Models/Effects/glass_shader.png</texture>
		<object-name>canopy.glass</object-name>
		<object-name>windows</object-name>
		<object-name>propdisc</object-name>
		<object-name>propblur</object-name>
	</animation>
	<effect>
		<inherits-from>Effects/glass</inherits-from>
		<object-name>canopy.glass</object-name>
		<object-name>windows</object-name>
		<object-name>propdisc</object-name>
		<object-name>propblur</object-name>
	</effect>
	<effect>
		<inherits-from>Effects/exterior/fuselage</inherits-from>
		<object-name>flaps</object-name>
		<object-name>aileron.R</object-name>
		<object-name>aileron.L</object-name>
		<object-name>wings</object-name>
		<object-name>fuselage</object-name>
		<object-name>canopy.frame</object-name>
		<object-name>baggage_door</object-name>
		<object-name>prop</object-name>
		<object-name>spinner</object-name>
		<object-name>rudder</object-name>
		<object-name>hstab</object-name>
		<object-name>wheelfairingF</object-name>
		<object-name>gearF</object-name>
		<object-name>wheelfairingL</object-name>
		<object-name>gearL</object-name>
		<object-name>wheelfairingR</object-name>
		<object-name>gearR</object-name>
		<object-name>aileronacL</object-name>
		<object-name>aileronacR</object-name>
		<object-name>strobe.light.base</object-name>
		<object-name>lights</object-name>
		<object-name>ringL</object-name>
	</effect>
	<model>
		<path>Interior/interior.xml</path>
	</model>
	
	<!-- PROPELLER ANIMATION-->	
	<!-- Select propdisc, propblur or prop based on RPM -->
	<animation>
		<type>select</type>
		<object-name>propdisc</object-name>
		<condition>
			<greater-than>
				<property>engines/engine[0]/rpm</property>
				<value>1900</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>500</value>
				</greater-than>
				<less-than>
					<property>engines/engine[0]/rpm</property>
					<value>2000</value>
				</less-than>
			</and>
		</condition>
	</animation>
	<animation>
		<type>select</type>
		<object-name>prop</object-name>
		<condition>
			<less-than>
				<property>engines/engine[0]/rpm</property>
				<value>600</value>
			</less-than>
		</condition>
	</animation>
	<animation>
		<type>spin</type>
		<object-name>propdisc</object-name>
		<object-name>propblur</object-name>
		<object-name>prop</object-name>
		<property>engines/engine[0]/rpm</property>
		<factor> 1 </factor>
		<center>
			<y-m>  0.000 </y-m>
			<z-m>  0.100492 </z-m>
		</center>
		<axis>
			<x> -1.000 </x>
			<y>  0.000 </y>
			<z>  0.000 </z>
		</axis>
	</animation>
	<!-- FLIGHT CONTROL SURFACES -->
	<!-- Horizontal Stabilizer / Elevator -->
	<animation>
		<type>rotate</type>
		<object-name>hstab</object-name>
		<object-name>trimtab</object-name>
		<property>surface-positions/elevator-pos-norm</property>
		<interpolation>
			<entry>
				<ind> -0.75 </ind>
				<dep> -12.0 </dep>
			</entry>
			<entry>
				<ind>  0.00 </ind>
				<dep>   0.0 </dep>
			</entry>
			<entry>
				<ind>  0.75 </ind>
				<dep>   9.5 </dep>
			</entry>
		</interpolation>
		<center>
			<x-m> 2.529 </x-m>
			<y-m> 0.000 </y-m>
			<z-m> 0.303 </z-m>
		</center>
		<axis>
			<y> 1 </y>
		</axis>
	</animation>
	<!-- Rudder -->
	<animation>
		<type>rotate</type>
		<object-name>rudder</object-name>
		<property>surface-positions/rudder-pos-norm</property>
		<interpolation>
			<entry>
				<ind> -0.75 </ind>
				<dep> -25.0 </dep>
			</entry>
			<entry>
				<ind>  0.00 </ind>
				<dep>   0.0 </dep>
			</entry>
			<entry>
				<ind>  0.75 </ind>
				<dep>  25.0 </dep>
			</entry>
		</interpolation>
		<axis>
			<x1-m>  2.992 </x1-m>
			<y1-m>  0.000 </y1-m>
			<z1-m> -0.050 </z1-m>
			<x2-m>  3.157 </x2-m>
			<y2-m>  0.000 </y2-m>
			<z2-m>  1.374 </z2-m>
		</axis>
	</animation>
	<!-- Ailerons -->
	<animation>
		<type>rotate</type>
		<object-name>aileron.L</object-name>
		<property>surface-positions/left-aileron-pos-norm</property>
		<factor>-15</factor>
		<axis>
			<x1-m> -0.452 </x1-m>
			<y1-m> -2.873 </y1-m>
			<z1-m> -0.322 </z1-m>
			<x2-m> -0.952 </x2-m>
			<y2-m> -4.275 </y2-m>
			<z2-m>  0.033 </z2-m>
		</axis>
	</animation>
	<animation>
		<type>rotate</type>
		<object-name>aileron.R</object-name>
		<property>surface-positions/right-aileron-pos-norm</property>
		<factor>15</factor>
		<axis>
			<x1-m> -0.452 </x1-m>
			<y1-m>  2.873 </y1-m>
			<z1-m> -0.322 </z1-m>
			<x2-m> -0.952 </x2-m>
			<y2-m>  4.275 </y2-m>
			<z2-m>  0.033 </z2-m>
		</axis>
	</animation>
	<!-- Flaps -->
	<animation>
		<type>rotate</type>
		<object-name>flaps</object-name>
		<property>surface-positions/flap-pos-norm</property>
		<factor>60.0</factor>
		<center>
			<x-m> -0.216 </x-m>
			<y-m>  0.000 </y-m>
			<z-m> -0.412 </z-m>
		</center>
		<axis>
			<x> 0.000 </x>
			<y> 1.000 </y>
			<z> 0.000 </z>
		</axis>
	</animation>
	<!-- GEAR ANIMATION -->
	<!-- Compression -->
	<animation>
		<type>translate</type>
		<object-name>wheelF</object-name>
		<object-name>wheelfairingF</object-name>
		<property>gear/gear[0]/compression-norm</property>
		<factor>0.3048</factor>
		<axis>
			<x>0.01</x>
			<z>1</z>
		</axis>
	</animation>
	<animation>
		<type>translate</type>
		<object-name>wheelL</object-name>
		<object-name>wheelfairingL</object-name>
		<property>gear/gear[1]/compression-norm</property>
		<factor>0.3048</factor>
		<axis>
			<x>0.01</x>
			<z>1</z>
		</axis>
	</animation>
	<animation>
		<type>translate</type>
		<object-name>wheelR</object-name>
		<object-name>wheelfairingR</object-name>
		<property>gear/gear[2]/compression-norm</property>
		<factor>0.3048</factor>
		<axis>
			<x>0.01</x>
			<z>1</z>
		</axis>
	</animation>
	<!-- Front Wheel Steering -->
	<animation>
		<type>rotate</type>
		<object-name>gearF</object-name>
		<object-name>wheelF</object-name>
		<object-name>wheelfairingF</object-name>
		<property>surface-positions/rudder-pos-norm</property>
		<factor> -25.0 </factor>
		<axis>
			<x1-m>-2.39263</x1-m>
			<y1-m>0.110762</y1-m>
			<z1-m>-0.638726</z1-m>
			<x2-m>-2.36334</x2-m>
			<y2-m>0.110762</y2-m>
			<z2-m>-0.306205</z2-m>
		</axis>
	</animation>
	<!-- Wheel spinning -->
	<animation>
		<type>spin</type>
		<object-name>wheelF</object-name>
		<property>gear/gear[0]/rollspeed-ms</property>
		<factor> 15 </factor>
		<center>
			<x-m> -2.49986 </x-m>
			<z-m> -0.833628 </z-m>
		</center>
		<axis>
			<y> -1 </y>
		</axis>
	</animation>
	<animation>
		<type>spin</type>
		<object-name>wheelL</object-name>
		<property>gear/gear[1]/rollspeed-ms</property>
		<factor> 15 </factor>
		<center>
			<x-m> -0.951304 </x-m>
			<z-m> -0.855146 </z-m>
		</center>
		<axis>
			<y> -1 </y>
		</axis>
	</animation>
	<animation>
		<type>spin</type>
		<object-name>wheelR</object-name>
		<property>gear/gear[2]/rollspeed-ms</property>
		<factor> 15 </factor>
		<center>
			<x-m> -0.951304 </x-m>
			<z-m> -0.855146 </z-m>
		</center>
		<axis>
			<y> -1 </y>
		</axis>
	</animation>
	<!-- CANOPY -->
	<animation>
		<name>canopyfull</name>
		<object-name>canopy.frame</object-name>
		<object-name>canopy.glass</object-name>
	</animation>
	<animation>
		<type>pick</type>
		<object-name>canopy.frame</object-name>
		<action>
			<button>0</button>
			<binding>
				<command>property-cycle</command>
				<property>fdm/jsbsim/doors/canopy-cmd</property>
				<value>1</value>
				<value>0</value>
			</binding>
		</action>
	</animation>
	<animation>
		<type>translate</type>
		<object-name>canopyfull</object-name>
		<property>fdm/jsbsim/doors/canopy-pos-norm</property>
		<interpolation>
			<entry>
				<ind> 0.12 </ind>
				<dep> 0.00 </dep>
			</entry>
			<entry>
				<ind> 1.00 </ind>
				<dep> 0.80 </dep>
			</entry>
		</interpolation>
		<axis>
			<x> -1.000 </x>
			<y>  0.000 </y>
			<z>  0.000 </z>
		</axis>
	</animation>
	<!-- AIRCRAFT EXTERIOR LIGHTING -->
	<model>
		<path>dr400-lights.xml</path>
	</model>
	
	
</PropertyList>
