4 changed files with 86 additions and 0 deletions
@ -0,0 +1,42 @@
@@ -0,0 +1,42 @@
|
||||
var launchCatapult = func { |
||||
# time on catapult = 1/10 sec |
||||
# speed when leaving catapult = 50 km/h ? |
||||
var countdownRunning = 1; |
||||
var count = 5; |
||||
var countdown = func { |
||||
if (countdownRunning) { |
||||
if (count != 0) { |
||||
setprop("/sim/screen/white",count); |
||||
count = count - 1; |
||||
settimer(countdown, 1); |
||||
} |
||||
else { |
||||
countdownRunning = 0; |
||||
setprop("/sim/screen/yellow","Go!"); |
||||
launch(); |
||||
var launchPad = aircraft.door.new("/sim/model/X100/launch-pad", 0.2); |
||||
launchPad.toggle(); |
||||
} |
||||
} |
||||
} |
||||
countdown(); |
||||
|
||||
var launchRunning = 1; |
||||
var magnitude = 230; # lbs, unrealisticly high, because the FDM is wrong |
||||
var launch = func { |
||||
if (launchRunning) { |
||||
if (magnitude == 0){ |
||||
launchRunning = 0; |
||||
|
||||
# remove launcher contact points |
||||
setprop("/fdm/jsbsim/contact/unit[6]/pos-norm",0); |
||||
setprop("/fdm/jsbsim/contact/unit[7]/pos-norm",0); |
||||
setprop("/fdm/jsbsim/contact/unit[8]/pos-norm",0); |
||||
} |
||||
setprop("/fdm/jsbsim/external_reactions/catapult/magnitude",magnitude); |
||||
print (magnitude); |
||||
magnitude = 0; |
||||
settimer(launch, 0.1); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue