1
0
Fork 0

turn <power> off for cyclic control on helicopters, that is: when a

property /rotors is available at joystick driver laod time. Note that
the FDM creates /rotors *afterwards*, so it needs to be defined in the
*-set.xml file already (which is the case for all helicopters in CVS).
A simple, self-ending <rotors/> tag should do.
This commit is contained in:
mfranz 2006-10-12 13:55:15 +00:00
parent 9c52cbf4ac
commit f5544f0cb9

View file

@ -112,13 +112,19 @@ ________________________________________________________________________________
<nasal> <nasal>
<script><![CDATA[ <script><![CDATA[
data = cmdarg().getParent().getNode("data"); self = cmdarg().getParent();
data = self.getNode("data");
mode = data.getNode("mode"); mode = data.getNode("mode");
modifier = data.getNode("modifier"); modifier = data.getNode("modifier");
f1 = f2 = 0; f1 = f2 = 0;
left_brake = right_brake = 0; left_brake = right_brake = 0;
trigger = 0; trigger = 0;
if (props.globals.getNode("/rotors", 0) != nil) {
self.getNode("axis[0]/binding/power").setDoubleValue(1);
self.getNode("axis[1]/binding/power").setDoubleValue(1);
}
kbdshift = props.globals.getNode("/devices/status/keyboard/shift", 1); kbdshift = props.globals.getNode("/devices/status/keyboard/shift", 1);
kbdctrl = props.globals.getNode("/devices/status/keyboard/ctrl", 1); kbdctrl = props.globals.getNode("/devices/status/keyboard/ctrl", 1);
kbdalt = props.globals.getNode("/devices/status/keyboard/alt", 1); kbdalt = props.globals.getNode("/devices/status/keyboard/alt", 1);