| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
|
| 3 |
<PropertyList> |
| 4 |
|
| 5 |
<path>towbar.ac</path> |
| 6 |
<nopreview/> |
| 7 |
|
| 8 |
<animation> |
| 9 |
<type>material</type> |
| 10 |
<object-name>Towbar</object-name> |
| 11 |
</animation> |
| 12 |
|
| 13 |
<effect> |
| 14 |
<inherits-from>Effects/model-combined</inherits-from> |
| 15 |
<reflection-enabled>1</reflection-enabled> |
| 16 |
<object-name>Towbar</object-name> |
| 17 |
</effect> |
| 18 |
|
| 19 |
<animation> |
| 20 |
<type>select</type> |
| 21 |
<object-name>Towbar</object-name> |
| 22 |
<condition> |
| 23 |
<property>fdm/jsbsim/external_reactions/towbar/attached</property> |
| 24 |
</condition> |
| 25 |
</animation> |
| 26 |
<animation> |
| 27 |
<type>translate</type> |
| 28 |
<object-name>Towbar</object-name> |
| 29 |
<property>gear/gear[0]/compression-norm</property> |
| 30 |
<factor>0.30</factor> |
| 31 |
<axis> |
| 32 |
<x>0.3</x> |
| 33 |
<y>0</y> |
| 34 |
<z>1.0</z> |
| 35 |
</axis> |
| 36 |
</animation> |
| 37 |
|
| 38 |
<animation> |
| 39 |
<type>rotate</type> |
| 40 |
<object-name>Towbar</object-name> |
| 41 |
<property>fdm/jsbsim/fcs/steer-pos-deg</property> |
| 42 |
<axis> |
| 43 |
<x>0</x> |
| 44 |
<y>0</y> |
| 45 |
<z>-1</z> |
| 46 |
</axis> |
| 47 |
<center> |
| 48 |
<x-m>-0.1892</x-m> |
| 49 |
<y-m>0.0000</y-m> |
| 50 |
<z-m>-0.7450</z-m> |
| 51 |
</center> |
| 52 |
</animation> |
| 53 |
|
| 54 |
<animation> |
| 55 |
<type>pick</type> |
| 56 |
<object-name>Towbar</object-name> |
| 57 |
<action> |
| 58 |
<button>0</button> |
| 59 |
<repeatable>true</repeatable> |
| 60 |
<interval-sec>0.1</interval-sec> |
| 61 |
|
| 62 |
|
| 63 |
<binding> |
| 64 |
<condition> |
| 65 |
<equals> |
| 66 |
<property>fdm/jsbsim/external_reactions/towbar/mouse-handling/x</property> |
| 67 |
<value>0</value> |
| 68 |
</equals> |
| 69 |
</condition> |
| 70 |
<command>property-assign</command> |
| 71 |
<property>fdm/jsbsim/external_reactions/towbar/mouse-handling/x</property> |
| 72 |
<property>devices/status/mice/mouse/x</property> |
| 73 |
</binding> |
| 74 |
<binding> |
| 75 |
<condition> |
| 76 |
<equals> |
| 77 |
<property>fdm/jsbsim/external_reactions/towbar/mouse-handling/y</property> |
| 78 |
<value>0</value> |
| 79 |
</equals> |
| 80 |
</condition> |
| 81 |
<command>property-assign</command> |
| 82 |
<property>fdm/jsbsim/external_reactions/towbar/mouse-handling/y</property> |
| 83 |
<property>devices/status/mice/mouse/y</property> |
| 84 |
</binding> |
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
<binding> |
| 89 |
<command>nasal</command> |
| 90 |
<script><![CDATA[ |
| 91 |
var p = "fdm/jsbsim/external_reactions/towbar/magnitude"; |
| 92 |
var old_y = getprop("fdm/jsbsim/external_reactions/towbar/mouse-handling/y"); |
| 93 |
var cur_y = getprop("devices/status/mice/mouse/y"); |
| 94 |
var old_p = getprop(p) or 0; |
| 95 |
var factor = 0.5; |
| 96 |
var diff = (cur_y - old_y) * factor; |
| 97 |
var tgt = old_p + diff; |
| 98 |
if (tgt > 100) tgt = 100; |
| 99 |
if (tgt < -100) tgt = -100; |
| 100 |
setprop(p, tgt); |
| 101 |
]]></script> |
| 102 |
</binding> |
| 103 |
|
| 104 |
|
| 105 |
<binding> |
| 106 |
<command>nasal</command> |
| 107 |
<script><![CDATA[ |
| 108 |
var p = "fdm/jsbsim/external_reactions/towbar/steer-deg"; |
| 109 |
var old_x = getprop("fdm/jsbsim/external_reactions/towbar/mouse-handling/x"); |
| 110 |
var cur_x = getprop("devices/status/mice/mouse/x"); |
| 111 |
var old_p = getprop(p) or 0; |
| 112 |
var factor = -0.25; |
| 113 |
var diff = (cur_x - old_x) * factor; |
| 114 |
var tgt = old_p + diff; |
| 115 |
if (tgt > 30) tgt = 30; |
| 116 |
if (tgt < -30) tgt = -30; |
| 117 |
setprop(p, tgt); |
| 118 |
]]></script> |
| 119 |
</binding> |
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
<binding> |
| 125 |
<command>property-assign</command> |
| 126 |
<property>fdm/jsbsim/external_reactions/towbar/mouse-handling/x</property> |
| 127 |
<property>devices/status/mice/mouse/x</property> |
| 128 |
</binding> |
| 129 |
<binding> |
| 130 |
<command>property-assign</command> |
| 131 |
<property>fdm/jsbsim/external_reactions/towbar/mouse-handling/y</property> |
| 132 |
<property>devices/status/mice/mouse/y</property> |
| 133 |
</binding> |
| 134 |
|
| 135 |
<mod-up> |
| 136 |
<binding> |
| 137 |
<command>property-assign</command> |
| 138 |
<property>fdm/jsbsim/external_reactions/towbar/magnitude</property> |
| 139 |
<value type="double">0</value> |
| 140 |
</binding> |
| 141 |
|
| 142 |
|
| 143 |
<binding> |
| 144 |
<command>property-assign</command> |
| 145 |
<property>fdm/jsbsim/external_reactions/towbar/mouse-handling/x</property> |
| 146 |
<value>0</value> |
| 147 |
</binding> |
| 148 |
<binding> |
| 149 |
<command>property-assign</command> |
| 150 |
<property>fdm/jsbsim/external_reactions/towbar/mouse-handling/y</property> |
| 151 |
<property>devices/status/mice/mouse/y</property> |
| 152 |
<value>0</value> |
| 153 |
</binding> |
| 154 |
</mod-up> |
| 155 |
</action> |
| 156 |
</animation> |
| 157 |
|
| 158 |
</PropertyList> |