Well thats an easy part to understand, I am interested in aircraft side implementation. Do you have any info on that?
// TypeRadarWarningReceiver setup values
private RadarWarningReceiverUtils rwrUtils;
private boolean backfire;
public boolean bRadarWarning;
public boolean bMissileWarning;
private static final int RWR_GENERATION = 1;
private static final int RWR_MAX_DETECT = 16;
private static final int RWR_KEEP_SECONDS = 7;
private static final double RWR_RECEIVE_ELEVATION = 45.0D;
private static final boolean RWR_DETECT_IRMIS = false;
private static final boolean RWR_DETECT_ELEVATION = false;
private boolean bRWR_Show_Text_Warning = true;
public aircraft()
{
if(Config.cur.ini.get("Mods", "RWRTextStop", 0) > 0) bRWR_Show_Text_Warning = false;
rwrUtils = new RadarWarningReceiverUtils(this, RWR_GENERATION, RWR_MAX_DETECT, RWR_KEEP_SECONDS, RWR_RECEIVE_ELEVATION, RWR_DETECT_IRMIS, RWR_DETECT_ELEVATION, bRWR_Show_Text_Warning);
}
public RadarWarningReceiverUtils getRadarWarningReceiverUtils()
{
return rwrUtils;
}
public void myRadarSearchYou(Actor actor, String soundpreset)
{
rwrUtils.recordRadarSearched(actor, soundpreset);
}
public void myRadarLockYou(Actor actor, String soundpreset)
{
rwrUtils.recordRadarLocked(actor, soundpreset);
}
public void onAircraftLoaded()
{
super.onAircraftLoaded();
rwrUtils.onAircraftLoaded();
rwrUtils.setLockTone("aircraft.usRWRScan", "aircraft.usRWRLock", "aircraft.usRWRLaunchWarningMissileMissile", "aircraft.usRWRThreatNew");
}
public void startCockpitSounds()
{
rwrUtils.setSoundEnable(true);
}
public void stopCockpitSounds()
{
rwrUtils.stopAllRWRSounds();
}
public void update(float f)
{
rwrUtils.update();
backfire = rwrUtils.getBackfire();
bRadarWarning = rwrUtils.getRadarLockedWarning();
bMissileWarning = rwrUtils.getMissileWarning();
super.update(f);
}
RWR_GENERATION : 0=play modulate sound of radar wave, 1=play specific warning tone or
Betty voice
RWR_MAX_DETECT : maximum detecting number of missiles / radars
RWR_KEEP_SECONDS : A radar warning information is expired when this second passes from last detect
RWR_RECEIVE_ELEVATION : RWR cannot detect radar over this degree numbers; too upper or too lower
RWR_DETECT_IRMIS : true=can detect IR Homing missiles, false=cannot; true is only 2010y~ current Israel one + a few. 20th century ones=false.
RWR_DETECT_ELEVATION : RWR HUD text show elevation information Above / Level / Below .... true=can, false=cannot; USA and early USSR are false, current USSR is true.
bRWR_Show_Text_Warning : true is default for HUD text messages. To stop it for reality, write conf.ini [Mods] section line to make it false.
rwrUtils.setLockTone() : setup RWR_GENERATION=1 time warning tone or voice sound presets. (Scan radar, Lock radar, Missile coming, Threat New)
Default HUD text warning direction
sector number is 12 (in "which o'clock" text 1 ~ 12).
For older system with fewer sector numbers like early MiG-21, 8 or 4 can be set with this setup.
Or early RWRs can only detect Radar Search or Lock / but not Missile; like also early MiG-21.
rwrUtils = new RadarWarningReceiverUtils(this, RWR_GENERATION, RWR_MAX_DETECT, RWR_KEEP_SECONDS, RWR_RECEIVE_ELEVATION, RWR_DETECT_RHMIS, RWR_DETECT_IRMIS, RWR_DETECT_ELEVATION, RWR_SECTOR_NUM, bRWR_Show_Text_Warning);
RWR_DETECT_RHMIS : true or false
RWR_SECTOR_NUM : 4 or 8 or default 12 (other numbers are rounded into one of these)
For visual cockpit instruments, those 4x getter methods provide each recorded "Actor" arraylist.
ArrayList getIRmissileList();
ArrayList getRHmissileList();
ArrayList getRadarList();
ArrayList getRadarLockList();
cockpit class can calculate each actors' direction / distance after get a actor from the arraylist.
Contents of arraylists are sorted by distance from near.