Setup of Hitch Position#
For the visualization of the tow rope, it is advantageous if a hitch position is defined for the AI tow plane.
To set the hitch position for the AI aircraft, add the following code to the top of the aircraft-ai.xml file:
<?xml version="1.0"?>
<PropertyList>
<nasal>
<load>
var acNode = cmdarg(); # "/ai/models/aircraft"
acNode.getNode("sim/hitches/aerotow/local-pos-x", true).setDoubleValue(x); # forward
acNode.getNode("sim/hitches/aerotow/local-pos-y", true).setDoubleValue(y); # left
acNode.getNode("sim/hitches/aerotow/local-pos-z", true).setDoubleValue(z); # up
</load>
<unload>
acNode.getNode("sim/hitches").remove();
</unload>
</nasal>
<!-- Rest of content here -->
</PropertyList>
In place of x (forward), y (left), z (up), enter appropriate values for the hitch position. The units are meters.
That’s it! The tow rope ends at the defined position.