Engine: Changed to back wheel drive

This commit is contained in:
Sidi Liang 2020-06-06 20:48:37 +08:00
parent 6a649ffddc
commit b4ecb9cbe1
No known key found for this signature in database
GPG Key ID: 79F0A6B20B72F42F
1 changed files with 15 additions and 12 deletions

View File

@ -202,26 +202,29 @@ engine_1.engineSwitch.switchDisconnect();
followme.circuit_1.addUnitToSeries(0, followme.Cable.new(5, 0.008));
var outputForce = func(force){
if(props.getNode("/",1).getValue("/fdm/jsbsim/gear/unit/compression-ft") > 0){
props.getNode("/",1).setValue("/fdm/jsbsim/external_reactions/FL/magnitude", force/4);
}else{
props.getNode("/",1).setValue("/fdm/jsbsim/external_reactions/FL/magnitude", 0);
}
#Changed to rear wheel drive before firguring out how to make sure that
#forces on the front wheel changes its direction to make sure it's the same as the wheel
if(props.getNode("/",1).getValue("/fdm/jsbsim/gear/unit[1]/compression-ft") > 0){
props.getNode("/",1).setValue("/fdm/jsbsim/external_reactions/FR/magnitude", force/4);
}else{
props.getNode("/",1).setValue("/fdm/jsbsim/external_reactions/FR/magnitude", 0);
}
#if(props.getNode("/",1).getValue("/fdm/jsbsim/gear/unit/compression-ft") > 0){
# props.getNode("/",1).setValue("/fdm/jsbsim/external_reactions/FL/magnitude", force/4);
#}else{
# props.getNode("/",1).setValue("/fdm/jsbsim/external_reactions/FL/magnitude", 0);
#}
#if(props.getNode("/",1).getValue("/fdm/jsbsim/gear/unit[1]/compression-ft") > 0){
# props.getNode("/",1).setValue("/fdm/jsbsim/external_reactions/FR/magnitude", force/4);
#}else{
# props.getNode("/",1).setValue("/fdm/jsbsim/external_reactions/FR/magnitude", 0);
#}
if(props.getNode("/",1).getValue("/fdm/jsbsim/gear/unit[2]/compression-ft") > 0){
props.getNode("/",1).setValue("/fdm/jsbsim/external_reactions/BL/magnitude", force/4);
props.getNode("/",1).setValue("/fdm/jsbsim/external_reactions/BL/magnitude", force/2);
}else{
props.getNode("/",1).setValue("/fdm/jsbsim/external_reactions/BL/magnitude", 0);
}
if(props.getNode("/",1).getValue("/fdm/jsbsim/gear/unit[3]/compression-ft") > 0){
props.getNode("/",1).setValue("/fdm/jsbsim/external_reactions/BR/magnitude", force/4);
props.getNode("/",1).setValue("/fdm/jsbsim/external_reactions/BR/magnitude", force/2);
}else{
props.getNode("/",1).setValue("/fdm/jsbsim/external_reactions/FR/magnitude", 0);
}