Removed a bunch of obsolete code:

*Obsolete, as of: 6fdaf4c400
This commit is contained in:
ulteq 2015-04-25 13:34:47 +02:00
parent b053a641d9
commit eca7657ffa
8 changed files with 54 additions and 74 deletions

View File

@ -20,16 +20,6 @@ GVAR(WindInfoStart) = time;
GVAR(Protractor) = false; GVAR(Protractor) = false;
GVAR(ProtractorStart) = time; GVAR(ProtractorStart) = time;
// Those are only used in the pure sqf version (extension free PFH)
GVAR(SimulationPrecision) = 2;
GVAR(WindEnabled) = true;
GVAR(SpinDriftEnabled) = true;
GVAR(CoriolisEnabled) = true;
GVAR(EoetvoesEnabled) = true;
GVAR(AdvancedAirDragEnabled) = true;
GVAR(TransonicRegionEnabled) = true;
GVAR(AtmosphericDensitySimulationEnabled) = true;
GVAR(currentGrid) = 0; GVAR(currentGrid) = 0;
GVAR(INIT_MESSAGE_ENABLED) = false; GVAR(INIT_MESSAGE_ENABLED) = false;

View File

@ -120,23 +120,21 @@ _dragModel = 1;
_ballisticCoefficients = []; _ballisticCoefficients = [];
_velocityBoundaries = []; _velocityBoundaries = [];
_atmosphereModel = "ICAO"; _atmosphereModel = "ICAO";
if (GVAR(AdvancedAirDragEnabled)) then { if (isNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_dragModel")) then {
if (isNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_dragModel")) then { _dragModel = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_dragModel");
_dragModel = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_dragModel"); if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then {
if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then { _dragModel = 1;
_dragModel = 1;
};
};
if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_ballisticCoefficients")) then {
_ballisticCoefficients = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_ballisticCoefficients");
};
if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_velocityBoundaries")) then {
_velocityBoundaries = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_velocityBoundaries");
};
if (isText(configFile >> "cfgAmmo" >> _ammo >> "ACE_standardAtmosphere")) then {
_atmosphereModel = getText(configFile >> "cfgAmmo" >> _ammo >> "ACE_standardAtmosphere");
}; };
}; };
if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_ballisticCoefficients")) then {
_ballisticCoefficients = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_ballisticCoefficients");
};
if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_velocityBoundaries")) then {
_velocityBoundaries = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_velocityBoundaries");
};
if (isText(configFile >> "cfgAmmo" >> _ammo >> "ACE_standardAtmosphere")) then {
_atmosphereModel = getText(configFile >> "cfgAmmo" >> _ammo >> "ACE_standardAtmosphere");
};
GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000; GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000;

View File

@ -54,7 +54,7 @@ if (!GVAR(atmosphereModeTBH)) then {
private ["_bulletLength", "_stabilityFactor"]; private ["_bulletLength", "_stabilityFactor"];
_bulletLength = 1.8; _bulletLength = 1.8;
_stabilityFactor = 1.5; _stabilityFactor = 1.5;
if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,SpinDriftEnabled), false])) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
if (_bulletDiameter > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { if (_bulletDiameter > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then {
_stabilityFactor = [_bulletDiameter / 10 / 2.54, _bulletLength, _bulletMass * 15.4323584, _barrelTwist / 2.54, _muzzleVelocity, _temperature, _barometricPressure] call EFUNC(advanced_ballistics,calculateStabilityFactor); _stabilityFactor = [_bulletDiameter / 10 / 2.54, _bulletLength, _bulletMass * 15.4323584, _barrelTwist / 2.54, _muzzleVelocity, _temperature, _barometricPressure] call EFUNC(advanced_ballistics,calculateStabilityFactor);
}; };

View File

@ -106,7 +106,7 @@ private ["_wind1", "_wind2", "_windDrift"];
_wind1 = [cos(270 - _windDirection * 30) * _windSpeed1, sin(270 - _windDirection * 30) * _windSpeed1, 0]; _wind1 = [cos(270 - _windDirection * 30) * _windSpeed1, sin(270 - _windDirection * 30) * _windSpeed1, 0];
_wind2 = [cos(270 - _windDirection * 30) * _windSpeed2, sin(270 - _windDirection * 30) * _windSpeed2, 0]; _wind2 = [cos(270 - _windDirection * 30) * _windSpeed2, sin(270 - _windDirection * 30) * _windSpeed2, 0];
_windDrift = 0; _windDrift = 0;
if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
_bc = [_bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel] call EFUNC(advanced_ballistics,calculateAtmosphericCorrection); _bc = [_bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel] call EFUNC(advanced_ballistics,calculateAtmosphericCorrection);
}; };
@ -117,7 +117,7 @@ _speedAverage = 0;
private ["_eoetvoesMultiplier"]; private ["_eoetvoesMultiplier"];
_eoetvoesMultiplier = 0; _eoetvoesMultiplier = 0;
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,EoetvoesEnabled), false]) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
_eoetvoesMultiplier = 2 * (0.0000729 * _muzzleVelocity / -9.80665) * cos(_latitude) * sin(_directionOfFire); _eoetvoesMultiplier = 2 * (0.0000729 * _muzzleVelocity / -9.80665) * cos(_latitude) * sin(_directionOfFire);
}; };
@ -142,14 +142,12 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do {
_trueSpeed = vectorMagnitude _trueVelocity; _trueSpeed = vectorMagnitude _trueVelocity;
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false]) then { _drag = if (missionNamespace getVariable [QEGVAR(advanced_ballistics,extensionAvailable), false]) then {
_drag = if (missionNamespace getVariable [QEGVAR(advanced_ballistics,extensionAvailable), false]) then { parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3", _dragModel, _bc, _trueSpeed]))
parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3", _dragModel, _bc, _trueSpeed])) } else {
} else { ([_dragModel, _bc, _trueSpeed] call EFUNC(advanced_ballistics,calculateRetardation))
([_dragModel, _bc, _trueSpeed] call EFUNC(advanced_ballistics,calculateRetardation))
};
_bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (-1 * _drag);
}; };
_bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (-1 * _drag);
} else { } else {
_bulletAccel = _trueVelocity vectorMultiply (_trueSpeed * _airFriction); _bulletAccel = _trueVelocity vectorMultiply (_trueSpeed * _airFriction);
}; };
@ -177,23 +175,20 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do {
_kineticEnergy = _kineticEnergy * 0.737562149; _kineticEnergy = _kineticEnergy * 0.737562149;
if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (_bulletPos select 1) > 0) then { if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (_bulletPos select 1) > 0) then {
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,CoriolisEnabled), false]) then { // Coriolis
_horizontalDeflection = 0.0000729 * ((_bulletPos select 1) ^ 2) * sin(_latitude) / _speedAverage; _horizontalDeflection = 0.0000729 * ((_bulletPos select 1) ^ 2) * sin(_latitude) / _speedAverage;
_horizontalCoriolis = - atan(_horizontalDeflection / (_bulletPos select 1)); _horizontalCoriolis = - atan(_horizontalDeflection / (_bulletPos select 1));
_windage1 = _windage1 + _horizontalCoriolis; _windage1 = _windage1 + _horizontalCoriolis;
_windage2 = _windage2 + _horizontalCoriolis; _windage2 = _windage2 + _horizontalCoriolis;
}; // Eoetvoes
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,EoetvoesEnabled), false]) then { _verticalDeflection = (_bulletPos select 2) * _eoetvoesMultiplier;
_verticalDeflection = (_bulletPos select 2) * _eoetvoesMultiplier; _verticalCoriolis = - atan(_verticalDeflection / (_bulletPos select 1));
_verticalCoriolis = - atan(_verticalDeflection / (_bulletPos select 1)); _elevation = _elevation + _verticalCoriolis;
_elevation = _elevation + _verticalCoriolis; // Spin drift
}; _spinDeflection = _twistDirection * 0.0254 * 1.25 * (_stabilityFactor + 1.2) * _TOF ^ 1.83;
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,SpinDriftEnabled), false]) then { _spinDrift = - atan(_spinDeflection / (_bulletPos select 1));
_spinDeflection = _twistDirection * 0.0254 * 1.25 * (_stabilityFactor + 1.2) * _TOF ^ 1.83; _windage1 = _windage1 + _spinDrift;
_spinDrift = - atan(_spinDeflection / (_bulletPos select 1)); _windage2 = _windage2 + _spinDrift;
_windage1 = _windage1 + _spinDrift;
_windage2 = _windage2 + _spinDrift;
};
}; };
GVAR(rangeCardData) set [_n, [_range, _elevation * 60, [_windage1 * 60, _windage2 * 60], _lead, _TOF, _bulletSpeed, _kineticEnergy]]; GVAR(rangeCardData) set [_n, [_range, _elevation * 60, [_windage1 * 60, _windage2 * 60], _lead, _TOF, _bulletSpeed, _kineticEnergy]];
@ -217,23 +212,20 @@ _kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2));
_kineticEnergy = _kineticEnergy * 0.737562149; _kineticEnergy = _kineticEnergy * 0.737562149;
if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (_bulletPos select 1) > 0) then { if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (_bulletPos select 1) > 0) then {
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,CoriolisEnabled), false]) then { // Coriolis
_horizontalDeflection = 0.0000729 * ((_bulletPos select 1) ^ 2) * sin(_latitude) / _speedAverage; _horizontalDeflection = 0.0000729 * ((_bulletPos select 1) ^ 2) * sin(_latitude) / _speedAverage;
_horizontalCoriolis = - atan(_horizontalDeflection / (_bulletPos select 1)); _horizontalCoriolis = - atan(_horizontalDeflection / (_bulletPos select 1));
_windage1 = _windage1 + _horizontalCoriolis; _windage1 = _windage1 + _horizontalCoriolis;
_windage2 = _windage2 + _horizontalCoriolis; _windage2 = _windage2 + _horizontalCoriolis;
}; // Eoetvoes
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,EoetvoesEnabled), false]) then { _verticalDeflection = (_bulletPos select 2) * _eoetvoesMultiplier;
_verticalDeflection = (_bulletPos select 2) * _eoetvoesMultiplier; _verticalCoriolis = - atan(_verticalDeflection / (_bulletPos select 1));
_verticalCoriolis = - atan(_verticalDeflection / (_bulletPos select 1)); _elevation = _elevation + _verticalCoriolis;
_elevation = _elevation + _verticalCoriolis; // Spin drift
}; _spinDeflection = _twistDirection * 0.0254 * 1.25 * (_stabilityFactor + 1.2) * _TOF ^ 1.83;
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,SpinDriftEnabled), false]) then { _spinDrift = - atan(_spinDeflection / (_bulletPos select 1));
_spinDeflection = _twistDirection * 0.0254 * 1.25 * (_stabilityFactor + 1.2) * _TOF ^ 1.83; _windage1 = _windage1 + _spinDrift;
_spinDrift = - atan(_spinDeflection / (_bulletPos select 1)); _windage2 = _windage2 + _spinDrift;
_windage1 = _windage1 + _spinDrift;
_windage2 = _windage2 + _spinDrift;
};
}; };
[_elevation * 60, [_windage1 * 60, _windage2 * 60], _lead, _TOF, _bulletSpeed, _kineticEnergy, _verticalCoriolis * 60, _horizontalCoriolis * 60, _spinDrift * 60] [_elevation * 60, [_windage1 * 60, _windage2 * 60], _lead, _TOF, _bulletSpeed, _kineticEnergy, _verticalCoriolis * 60, _horizontalCoriolis * 60, _spinDrift * 60]

View File

@ -54,7 +54,7 @@ if (!GVAR(atmosphereModeTBH)) then {
private ["_bulletLength", "_stabilityFactor"]; private ["_bulletLength", "_stabilityFactor"];
_bulletLength = 1.8; _bulletLength = 1.8;
_stabilityFactor = 1.5; _stabilityFactor = 1.5;
if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,SpinDriftEnabled), false])) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
if (_bulletDiameter > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { if (_bulletDiameter > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then {
_stabilityFactor = [_bulletDiameter / 10 / 2.54, _bulletLength, _bulletMass * 15.4323584, _barrelTwist / 2.54, _muzzleVelocity, _temperature, _barometricPressure] call EFUNC(advanced_ballistics,calculateStabilityFactor); _stabilityFactor = [_bulletDiameter / 10 / 2.54, _bulletLength, _bulletMass * 15.4323584, _barrelTwist / 2.54, _muzzleVelocity, _temperature, _barometricPressure] call EFUNC(advanced_ballistics,calculateStabilityFactor);
}; };

View File

@ -60,7 +60,7 @@ private ["_boreHeight", "_bulletMass", "_bulletDiameter", "_airFriction", "_rifl
_boreHeight = parseNumber(ctrlText 120000); _boreHeight = parseNumber(ctrlText 120000);
_bulletMass = parseNumber(ctrlText 120010); _bulletMass = parseNumber(ctrlText 120010);
_bulletDiameter = parseNumber(ctrlText 120020); _bulletDiameter = parseNumber(ctrlText 120020);
if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
_airFriction = 0.1 max parseNumber(ctrlText 120030) min 2; _airFriction = 0.1 max parseNumber(ctrlText 120030) min 2;
} else { } else {
_airFriction = parseNumber(ctrlText 120030) / -1000; _airFriction = parseNumber(ctrlText 120030) / -1000;
@ -87,7 +87,7 @@ GVAR(workingMemory) set [5, _boreHeight];
GVAR(workingMemory) set [12, _bulletMass]; GVAR(workingMemory) set [12, _bulletMass];
GVAR(workingMemory) set [13, _bulletDiameter]; GVAR(workingMemory) set [13, _bulletDiameter];
GVAR(workingMemory) set [14, _rifleTwist]; GVAR(workingMemory) set [14, _rifleTwist];
if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
GVAR(workingMemory) set [15, _airFriction]; GVAR(workingMemory) set [15, _airFriction];
} else { } else {
GVAR(workingMemory) set [4, _airFriction]; GVAR(workingMemory) set [4, _airFriction];

View File

@ -26,7 +26,7 @@ if (GVAR(currentUnit) != 2) then {
} else { } else {
ctrlSetText [110, Str(Round(GVAR(workingMemory) select 12))]; ctrlSetText [110, Str(Round(GVAR(workingMemory) select 12))];
}; };
if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
ctrlSetText [120, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; ctrlSetText [120, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)];
} else { } else {
ctrlSetText [120, Str(Round((GVAR(workingMemory) select 4) * -1000 * 1000) / 1000)]; ctrlSetText [120, Str(Round((GVAR(workingMemory) select 4) * -1000 * 1000) / 1000)];

View File

@ -32,7 +32,7 @@ if (GVAR(currentUnit) != 2) then {
} else { } else {
ctrlSetText [120020, Str(Round((GVAR(workingMemory) select 13) * 1000) / 1000)]; ctrlSetText [120020, Str(Round((GVAR(workingMemory) select 13) * 1000) / 1000)];
}; };
if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
ctrlSetText [120030, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; ctrlSetText [120030, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)];
} else { } else {
ctrlSetText [120030, Str(Round((GVAR(workingMemory) select 4) * -1000 * 1000) / 1000)]; ctrlSetText [120030, Str(Round((GVAR(workingMemory) select 4) * -1000 * 1000) / 1000)];