Skip to content

Commit

Permalink
Radar: More filtering stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaiVChr committed Jan 17, 2022
1 parent 4f970d0 commit 53478ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions Nasal/radar/apg-68.nas
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ var AirborneRadar = {
}

foreach (me.chaff ; me.chaffList) {
if (rand() < me.chaffFilter) continue;# some chaff are filtered out.
if (rand() < me.chaffFilter or me.chaff.meters < 10000+10000*rand()) continue;# some chaff are filtered out.
me.globalToTarget = vector.Math.pitchYawVector(me.chaff.pitch, -me.chaff.bearing, [1,0,0]);

# Degrees from center of radar beam to center of chaff cloud
Expand Down Expand Up @@ -475,8 +475,8 @@ var AirborneRadar = {
me.vector_aicontacts_bleps = me.vector_aicontacts_bleps_tmp;

#lets purge the old chaff also, both seen and unseen
me.wind = getprop("environment/wind-speed-kt");
me.chaffLifetime = math.max(0, me.wind==0?25:25*(1-me.wind/50));
me.wnd = wndprop.getValue();
me.chaffLifetime = math.max(0, me.wnd==0?25:25*(1-me.wnd/50));
me.chaffList_tmp = [];
foreach(me.evilchaff ; me.chaffList) {
if (me.elapsed - me.evilchaff.releaseTime < me.chaffLifetime) {
Expand Down Expand Up @@ -3149,6 +3149,7 @@ laserOn = props.globals.getNode("controls/armament/laser-arm-dmd",1);#don't put
var datalink_power = props.globals.getNode("instrumentation/datalink/power",0);
enable_tacobject = 1;
var antennae_knob_prop = props.globals.getNode("controls/radar/antennae-knob",0);
var wndprop = props.globals.getNode("environment/wind-speed-kt",0);


# start generic radar system
Expand Down
8 changes: 5 additions & 3 deletions Nasal/radar/radar-system.nas
Original file line number Diff line number Diff line change
Expand Up @@ -1996,9 +1996,11 @@ var ECMChecker = {
return;
}
me.contact = me.vector_aicontacts[me.index];
me.chaff = me.checkChaff(me.contact);
if (me.chaff != nil) {
append(me.myChaffs, me.chaff);
if (me.contact.isVisible()) {
me.chaff = me.checkChaff(me.contact);
if (me.chaff != nil) {
append(me.myChaffs, me.chaff);
}
}

me.index += 1;
Expand Down

0 comments on commit 53478ca

Please sign in to comment.