2018-09-02 19:58:05 +00:00
|
|
|
var particle_effects_loop = func {
|
|
|
|
|
|
|
|
#particle effect colors
|
2019-05-15 18:14:04 +00:00
|
|
|
var alt = getprop("/position/altitude-agl-m");
|
2018-09-02 19:58:05 +00:00
|
|
|
var land = getprop("/fdm/jsbsim/ground/solid");
|
|
|
|
var red_diffuse = getprop("/rendering/scene/diffuse/red");
|
|
|
|
var snowlevel = getprop("/environment/snow-level-m");
|
2019-05-15 18:14:04 +00:00
|
|
|
var winter = getprop("/sim/startup/season-winter");
|
|
|
|
|
|
|
|
var friction = getprop("/fdm/jsbsim/ground/rolling_friction-factor");
|
|
|
|
var bumpiness = getprop("/fdm/jsbsim/ground/bumpiness");
|
|
|
|
var smooth_surface = 0;
|
|
|
|
|
|
|
|
if (friction == 1 or friction == .25 and bumpiness == 0) {
|
|
|
|
smooth_surface = 1;
|
|
|
|
}
|
2018-09-02 19:58:05 +00:00
|
|
|
|
|
|
|
if (land) {
|
2019-05-15 18:14:04 +00:00
|
|
|
if (alt > snowlevel or smooth_surface or winter) {
|
2018-09-02 19:58:05 +00:00
|
|
|
setprop("/sim/model/c172p/lighting/particles/redcombinedstart", red_diffuse*.8);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/greencombinedstart", red_diffuse*.8);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/bluecombinedstart", red_diffuse*.8);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/redcombinedend", red_diffuse*.9);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/greencombinedend", red_diffuse*.9);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/bluecombinedend", red_diffuse*.9);
|
|
|
|
} else {
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/redcombinedstart", red_diffuse*.89);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/greencombinedstart", red_diffuse*.76);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/bluecombinedstart", red_diffuse*.57);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/redcombinedend", red_diffuse*.99);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/greencombinedend", red_diffuse*.86);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/bluecombinedend", red_diffuse*.67);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/redcombinedstart", red_diffuse*.90);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/greencombinedstart", red_diffuse*.95);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/bluecombinedstart", red_diffuse*.93);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/redcombinedend", red_diffuse*.92);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/greencombinedend", red_diffuse*.98);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/bluecombinedend", red_diffuse*.95);
|
|
|
|
}
|
|
|
|
|
|
|
|
#smoke and damage smoke
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/redsmokestart", red_diffuse*.10);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/greensmokestart", red_diffuse*.10);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/bluesmokestart", red_diffuse*.10);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/redsmokeend", red_diffuse*.7);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/greensmokeend", red_diffuse*.7);
|
|
|
|
setprop("/sim/model/c172p/lighting/particles/bluesmokeend", red_diffuse*.85);
|
|
|
|
}
|
|
|
|
|