Advanced Ballistics - Drag model revamp & Spin drift correction (#5566)

* Advanced Ballistics - Drag model revamp
- Moved away from using the drag tables from the GNU exterior ballistics library
- The drag functions are now based off this data from JBM Ballistics: http://www.jbmballistics.com/ballistics/downloads/text/
- The differences are minor, but some players might still appreciate the additional authenticity

* The Mach number is now calculated in relation to the air temperature.

* Improved speed of sound calculation accuracy.

* Advanced Ballistics - DLL update

* Advanced Ballistics - Added drag function reference (JBM Ballistics)

* Advanced Ballistics - Fixed calculation error in the spin drift simulation
- The error was introduced with this PR (https://github.com/acemod/ACE3/pull/4708)

* More descriptive variable names

* Minor performance optimizations

* Fixed some minor issues

* DLL rebuild

* Utilize new 'toFixed' script command
- Small performance improvement

* Fixed a typo

* Use correct reference speed for the drag compensation

* Updated all 'airFriction' values to match the new drag model

* 'Default' atmosphere now equals the ICAO standard atmosphere

* Update reference humidity to meet the ICAO standard
This commit is contained in:
ulteq 2017-10-06 20:05:20 +02:00 committed by PabstMirror
parent d5aeec11ea
commit be482ea097
18 changed files with 322 additions and 408 deletions

Binary file not shown.

Binary file not shown.

View File

@ -15,8 +15,6 @@
*/
#include "script_component.hpp"
private _aceTimeSecond = floor CBA_missionTime;
{
_x params ["_bullet","_caliber","_bulletTraceVisible","_index"];
@ -33,7 +31,7 @@ private _aceTimeSecond = floor CBA_missionTime;
drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""];
};
_bullet setVelocity (_bulletVelocity vectorAdd (parseSimpleArray ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, _aceTimeSecond, CBA_missionTime - _aceTimeSecond])));
_bullet setVelocity (_bulletVelocity vectorAdd (parseSimpleArray ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, CBA_missionTime toFixed 6])));
};
nil
} count +GVAR(allBullets);

View File

@ -20,7 +20,7 @@
TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret);
// Parameterization
private ["_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletLength", "_barrelTwist", "_stabilityFactor", "_aceTimeSecond", "_barrelVelocityShift", "_ammoTemperatureVelocityShift"];
private ["_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletLength", "_barrelTwist", "_stabilityFactor", "_barrelVelocityShift", "_ammoTemperatureVelocityShift"];
_abort = false;
@ -113,8 +113,7 @@ if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) th
GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000;
_aceTimeSecond = floor CBA_missionTime;
"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _muzzleVelocity, _transonicStabilityCoef, getPosASL _projectile, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), overcast, _aceTimeSecond, CBA_missionTime - _aceTimeSecond];
"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _muzzleVelocity, _transonicStabilityCoef, getPosASL _projectile, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), overcast, CBA_missionTime toFixed 6];
GVAR(allBullets) pushBack [_projectile, _caliber, _bulletTraceVisible, GVAR(currentbulletID)];

View File

@ -29,7 +29,8 @@ private _distance = 0;
while {_velocity > _thresholdVelocity} do {
private _bc = GVAR(targetSolutionInput) select 14;
private _dragModel = GVAR(targetSolutionInput) select 15;
private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3", _dragModel, _bc, _velocity]));
private _temperature = GVAR(targetSolutionInput) select 5;
private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3:%4", _dragModel, _bc, _velocity, _temperature]));
_distance = _distance + _velocity * __DELTA_T;
_velocity = _velocity - (_drag * __DELTA_T);
};

View File

@ -118,7 +118,7 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do {
_trueSpeed = vectorMagnitude _trueVelocity;
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3", _dragModel, _bc, _trueSpeed]));
private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3:%4", _dragModel, _bc, _trueSpeed, _temperature]));
_bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (-1 * _drag);
} else {
_bulletAccel = _trueVelocity vectorMultiply (_trueSpeed * _airFriction);

View File

@ -51,7 +51,7 @@ GVAR(atmosphereModeTBH) = true;
GVAR(altitude) = 0;
GVAR(temperature) = 15;
GVAR(barometricPressure) = 1013.25;
GVAR(relativeHumidity) = 0.5;
GVAR(relativeHumidity) = 0.0;
GVAR(latitude) = [38, 38, 38, 38];
GVAR(directionOfFire) = [0, 0, 0, 0];

View File

@ -34,49 +34,49 @@ if (_resetGunList) then {
// Profile Name, Muzzle Velocity, Zero Range, Scope Base Angle, AirFriction, Bore Height, Scope Unit, Scope Click Unit, Scope Click Number, Maximum Elevation, Dialed Elevation, Dialed Windage, Mass, Bullet Diameter, Rifle Twist, BC, Drag Model, Atmosphere Model, Muzzle Velocity vs. Temperature Interpolation, C1 Ballistic Coefficient vs. Distance Interpolation, Persistent
GVAR(gunList) = [["12.7x108mm" , 812, 100, 0.0666557, -0.00063800, 3.81, 0, 2, 10, 120, 0, 0, 48.28, 12.7, 38.10, 0.630, 1, "ASM" , [[-15,793],[0,800],[10,807],[15,812],[25,826],[30,835],[35,846]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["12.7x99mm AMAX" , 852, 100, 0.0615965, -0.00036645, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 38.10, 1.050, 1, "ASM" , [[-15,833],[0,840],[10,847],[15,852],[25,866],[30,875],[35,886]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["12.7x99mm" , 892, 100, 0.0588284, -0.00057503, 3.81, 0, 2, 10, 120, 0, 0, 41.92, 12.7, 38.10, 0.670, 1, "ASM" , [[-15,873],[0,880],[10,887],[15,892],[25,906],[30,915],[35,926]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["12.7x99mm AMAX" , 852, 100, 0.0615965, -0.00037397, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 38.10, 1.050, 1, "ASM" , [[-15,833],[0,840],[10,847],[15,852],[25,866],[30,875],[35,886]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["12.7x99mm" , 892, 100, 0.0588284, -0.00058679, 3.81, 0, 2, 10, 120, 0, 0, 41.92, 12.7, 38.10, 0.670, 1, "ASM" , [[-15,873],[0,880],[10,887],[15,892],[25,906],[30,915],[35,926]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["12.7x54mm" , 299, 100, 0.3406920, -0.00019268, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 24.13, 1.050, 1, "ASM" , [[-15,297],[0,298],[10,299],[15,299],[25,301],[30,302],[35,303]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["12.7x54mm" , 299, 100, 0.3406920, -0.00019568, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 24.13, 1.050, 1, "ASM" , [[-15,297],[0,298],[10,299],[15,299],[25,301],[30,302],[35,303]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
[".50 Beowulf" , 562, 100, 0.1262000, -0.00202645, 3.81, 0, 2, 10, 120, 0, 0, 21.71, 12.7, 50.80, 0.210, 1, "ASM" , [[-15,560],[0,561],[10,562],[15,562],[25,564],[30,565],[35,566]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
[".50 Beowulf" , 562, 100, 0.1262000, -0.00205896, 3.81, 0, 2, 10, 120, 0, 0, 21.71, 12.7, 50.80, 0.210, 1, "ASM" , [[-15,560],[0,561],[10,562],[15,562],[25,564],[30,565],[35,566]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
[".408 CheyTac 305gr", 1059, 100, 0.0482146, -0.00063655, 3.81, 0, 2, 10, 120, 0, 0, 19.76, 10.4, 33.02, 0.569, 1, "ICAO", [[-15,1040],[0,1047],[10,1054],[15,1059],[25,1073],[30,1082],[35,1093]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
[".408 CheyTac 419gr", 859, 100, 0.0611842, -0.00044958, 3.81, 0, 2, 10, 120, 0, 0, 27.15, 10.4, 33.02, 0.866, 1, "ICAO", [[-15,840],[0,847],[10,854],[15,859],[25,873],[30,882],[35,893]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
[".408 CheyTac 305gr", 1059, 100, 0.0482146, -0.00065414, 3.81, 0, 2, 10, 120, 0, 0, 19.76, 10.4, 33.02, 0.569, 1, "ICAO", [[-15,1040],[0,1047],[10,1054],[15,1059],[25,1073],[30,1082],[35,1093]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
[".408 CheyTac 419gr", 859, 100, 0.0611842, -0.00046249, 3.81, 0, 2, 10, 120, 0, 0, 27.15, 10.4, 33.02, 0.866, 1, "ICAO", [[-15,840],[0,847],[10,854],[15,859],[25,873],[30,882],[35,893]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["9.3×64mm" , 862, 100, 0.0627652, -0.00108571, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 9.30, 35.56, 0.368, 1, "ASM" , [[-15,843],[0,850],[10,857],[15,862],[25,876],[30,885],[35,896]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["9.3×64mm" , 862, 100, 0.0627652, -0.00110727, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 9.30, 35.56, 0.368, 1, "ASM" , [[-15,843],[0,850],[10,857],[15,862],[25,876],[30,885],[35,896]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
[".338LM 250gr" , 872, 100, 0.0604821, -0.00059133, 3.81, 0, 2, 10, 120, 0, 0, 16.20, 8.58, 25.40, 0.645, 1, "ICAO", [[-15,853],[0,860],[10,867],[15,872],[25,886],[30,895],[35,906]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
[".338LM 300gr" , 792, 100, 0.0685883, -0.00052190, 3.81, 0, 2, 10, 120, 0, 0, 19.44, 8.58, 25.40, 0.759, 1, "ICAO", [[-15,773],[0,780],[10,787],[15,792],[25,806],[30,815],[35,826]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
[".338LM API526" , 872, 100, 0.0602535, -0.00069611, 3.81, 0, 2, 10, 120, 0, 0, 16.39, 8.58, 25.40, 0.580, 1, "ICAO", [[-15,853],[0,860],[10,867],[15,872],[25,886],[30,895],[35,906]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
[".338LM 250gr" , 872, 100, 0.0604821, -0.00060841, 3.81, 0, 2, 10, 120, 0, 0, 16.20, 8.58, 25.40, 0.645, 1, "ICAO", [[-15,853],[0,860],[10,867],[15,872],[25,886],[30,895],[35,906]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
[".338LM 300gr" , 792, 100, 0.0685883, -0.00053585, 3.81, 0, 2, 10, 120, 0, 0, 19.44, 8.58, 25.40, 0.759, 1, "ICAO", [[-15,773],[0,780],[10,787],[15,792],[25,806],[30,815],[35,826]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
[".338LM API526" , 872, 100, 0.0602535, -0.00069220, 3.81, 0, 2, 10, 120, 0, 0, 16.39, 8.58, 25.40, 0.580, 1, "ICAO", [[-15,853],[0,860],[10,867],[15,872],[25,886],[30,895],[35,906]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
[".300WM Mk248 Mod0" , 857, 100, 0.0621425, -0.00070530, 3.81, 0, 2, 10, 120, 0, 0, 12.31, 7.80, 25.40, 0.537, 1, "ICAO", [[-15,838],[0,845],[10,852],[15,857],[25,871],[30,880],[35,891]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
[".300WM Mk248 Mod1" , 839, 100, 0.0637038, -0.00061188, 3.81, 0, 2, 10, 120, 0, 0, 14.26, 7.80, 25.40, 0.619, 1, "ICAO", [[-15,820],[0,827],[10,834],[15,839],[25,853],[30,862],[35,873]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
[".300WM Berger OTM" , 792, 100, 0.0686968, -0.00053733, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 7.80, 25.40, 0.715, 1, "ICAO", [[-15,773],[0,780],[10,787],[15,792],[25,806],[30,815],[35,826]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
[".300WM Mk248 Mod0" , 857, 100, 0.0621425, -0.00072468, 3.81, 0, 2, 10, 120, 0, 0, 12.31, 7.80, 25.40, 0.537, 1, "ICAO", [[-15,838],[0,845],[10,852],[15,857],[25,871],[30,880],[35,891]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
[".300WM Mk248 Mod1" , 839, 100, 0.0637038, -0.00063027, 3.81, 0, 2, 10, 120, 0, 0, 14.26, 7.80, 25.40, 0.619, 1, "ICAO", [[-15,820],[0,827],[10,834],[15,839],[25,853],[30,862],[35,873]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
[".300WM Berger OTM" , 792, 100, 0.0686968, -0.00055262, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 7.80, 25.40, 0.715, 1, "ICAO", [[-15,773],[0,780],[10,787],[15,792],[25,806],[30,815],[35,826]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["7.62x54mmR" , 812, 100, 0.0678441, -0.00100023, 3.81, 0, 2, 10, 120, 0, 0, 9.849, 7.92, 24.13, 0.400, 1, "ICAO", [[-15,793],[0,800],[10,807],[15,812],[25,826],[30,835],[35,846]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["7.62x54mmR" , 812, 100, 0.0678441, -0.00102329, 3.81, 0, 2, 10, 120, 0, 0, 9.849, 7.92, 24.13, 0.400, 1, "ICAO", [[-15,793],[0,800],[10,807],[15,812],[25,826],[30,835],[35,846]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["7.62x51mm M80" , 802, 100, 0.0690229, -0.00100957, 3.81, 0, 2, 10, 120, 0, 0, 9.461, 7.82, 25.40, 0.398, 1, "ICAO", [[-15,783],[0,790],[10,797],[15,802],[25,816],[30,825],[35,836]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["7.62x51mm M118LR" , 757, 100, 0.0739989, -0.00082828, 3.81, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.482, 1, "ICAO", [[-15,738],[0,745],[10,752],[15,757],[25,771],[30,780],[35,791]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["7.62x51mm Mk316" , 781, 100, 0.0709422, -0.00082029, 3.81, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.483, 1, "ICAO", [[-15,777],[0,778],[10,779],[15,781],[25,783],[30,785],[35,787]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["7.62x51mm Mk319" , 900, 100, 0.0593025, -0.00102338, 3.81, 0, 2, 10, 120, 0, 0, 8.424, 7.82, 25.40, 0.377, 1, "ICAO", [[-15,898],[0,899],[10,900],[15,900],[25,902],[30,903],[35,904]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["7.62x51mm M993" , 912, 100, 0.0585007, -0.00107148, 3.81, 0, 2, 10, 120, 0, 0, 8.230, 7.82, 25.40, 0.359, 1, "ICAO", [[-15,893],[0,900],[10,907],[15,912],[25,926],[30,935],[35,946]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["7.62x51mm Subsonic", 314, 100, 0.3168140, -0.00049899, 3.81, 0, 2, 10, 120, 0, 0, 12.96, 7.82, 25.40, 0.502, 1, "ICAO", [[-15,312],[0,313],[10,314],[15,314],[25,316],[30,317],[35,318]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["7.62x51mm M80" , 802, 100, 0.0690229, -0.00103711, 3.81, 0, 2, 10, 120, 0, 0, 9.461, 7.82, 25.40, 0.398, 1, "ICAO", [[-15,783],[0,790],[10,797],[15,802],[25,816],[30,825],[35,836]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["7.62x51mm M118LR" , 757, 100, 0.0739989, -0.00085157, 3.81, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.482, 1, "ICAO", [[-15,738],[0,745],[10,752],[15,757],[25,771],[30,780],[35,791]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["7.62x51mm Mk316" , 781, 100, 0.0709422, -0.00084311, 3.81, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.483, 1, "ICAO", [[-15,777],[0,778],[10,779],[15,781],[25,783],[30,785],[35,787]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["7.62x51mm Mk319" , 900, 100, 0.0593025, -0.00104515, 3.81, 0, 2, 10, 120, 0, 0, 8.424, 7.82, 25.40, 0.377, 1, "ICAO", [[-15,898],[0,899],[10,900],[15,900],[25,902],[30,903],[35,904]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["7.62x51mm M993" , 912, 100, 0.0585007, -0.00109390, 3.81, 0, 2, 10, 120, 0, 0, 8.230, 7.82, 25.40, 0.359, 1, "ICAO", [[-15,893],[0,900],[10,907],[15,912],[25,926],[30,935],[35,946]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["7.62x51mm Subsonic", 314, 100, 0.3168140, -0.00060194, 3.81, 0, 2, 10, 120, 0, 0, 12.96, 7.82, 25.40, 0.502, 1, "ICAO", [[-15,312],[0,313],[10,314],[15,314],[25,316],[30,317],[35,318]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["7.62x39mm" , 708, 100, 0.0846559, -0.00151621, 3.81, 0, 2, 10, 120, 0, 0, 7.970, 7.82, 25.40, 0.275, 1, "ICAO", [[-15,689],[0,696],[10,703],[15,708],[25,722],[30,731],[35,742]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["7.62x39mm" , 708, 100, 0.0846559, -0.00154815, 3.81, 0, 2, 10, 120, 0, 0, 7.970, 7.82, 25.40, 0.275, 1, "ICAO", [[-15,689],[0,696],[10,703],[15,708],[25,722],[30,731],[35,742]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["6.5x39mm" , 766, 100, 0.0725986, -0.00075308, 3.81, 0, 2, 10, 120, 0, 0, 7.970, 6.71, 22.86, 0.524, 1, "ICAO", [[-15,747],[0,754],[10,761],[15,766],[25,780],[30,789],[35,800]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["6.5x47mm Lapua" , 767, 100, 0.0722256, -0.00067037, 3.81, 0, 2, 10, 120, 0, 0, 9.007, 6.71, 22.86, 0.577, 1, "ICAO", [[-15,748],[0,755],[10,762],[15,767],[25,781],[30,790],[35,801]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["6.5mm Creedmor" , 822, 100, 0.0655022, -0.00060887, 3.81, 0, 2, 10, 120, 0, 0, 9.072, 6.71, 22.86, 0.632, 1, "ICAO", [[-15,803],[0,810],[10,817],[15,822],[25,836],[30,845],[35,856]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["6.5x39mm" , 766, 100, 0.0725986, -0.00077363, 3.81, 0, 2, 10, 120, 0, 0, 7.970, 6.71, 22.86, 0.524, 1, "ICAO", [[-15,747],[0,754],[10,761],[15,766],[25,780],[30,789],[35,800]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["6.5x47mm Lapua" , 767, 100, 0.0722256, -0.00069003, 3.81, 0, 2, 10, 120, 0, 0, 9.007, 6.71, 22.86, 0.577, 1, "ICAO", [[-15,748],[0,755],[10,762],[15,767],[25,781],[30,790],[35,801]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["6.5mm Creedmor" , 822, 100, 0.0655022, -0.00062437, 3.81, 0, 2, 10, 120, 0, 0, 9.072, 6.71, 22.86, 0.632, 1, "ICAO", [[-15,803],[0,810],[10,817],[15,822],[25,836],[30,845],[35,856]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["5.8x42mm DBP87" , 942, 100, 0.0566639, -0.00117956, 3.81, 0, 2, 10, 120, 0, 0, 4.150, 5.99, 24.40, 0.313, 1, "ICAO", [[-15,923],[0,930],[10,937],[15,942],[25,956],[30,965],[35,976]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["5.8x42mm DBP87" , 942, 100, 0.0566639, -0.00121087, 3.81, 0, 2, 10, 120, 0, 0, 4.150, 5.99, 24.40, 0.313, 1, "ICAO", [[-15,923],[0,930],[10,937],[15,942],[25,956],[30,965],[35,976]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["5.56x45mm M855" , 862, 100, 0.0635456, -0.00126466, 3.81, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.302, 1, "ASM" , [[-15,843],[0,849],[10,857],[15,862],[25,876],[30,885],[35,898]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["5.56x45mm Mk262" , 812, 100, 0.0682606, -0.00109563, 3.81, 0, 2, 10, 120, 0, 0, 4.990, 5.70, 17.78, 0.361, 1, "ASM" , [[-15,793],[0,800],[10,807],[15,812],[25,826],[30,835],[35,846]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["5.56x45mm Mk318" , 872, 100, 0.0624569, -0.00123318, 3.81, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.307, 1, "ASM" , [[-15,853],[0,860],[10,867],[15,872],[25,886],[30,895],[35,906]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["5.56x45mm M995" , 861, 100, 0.0635355, -0.00123272, 3.81, 0, 2, 10, 120, 0, 0, 4.536, 5.70, 17.78, 0.310, 1, "ASM" , [[-15,842],[0,849],[10,856],[15,861],[25,875],[30,884],[35,895]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["5.56x45mm M855" , 862, 100, 0.0635456, -0.00130094, 3.81, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.302, 1, "ASM" , [[-15,843],[0,849],[10,857],[15,862],[25,876],[30,885],[35,898]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["5.56x45mm Mk262" , 812, 100, 0.0682606, -0.00111805, 3.81, 0, 2, 10, 120, 0, 0, 4.990, 5.70, 17.78, 0.361, 1, "ASM" , [[-15,793],[0,800],[10,807],[15,812],[25,826],[30,835],[35,846]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["5.56x45mm Mk318" , 872, 100, 0.0624569, -0.00125880, 3.81, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.307, 1, "ASM" , [[-15,853],[0,860],[10,867],[15,872],[25,886],[30,895],[35,906]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["5.56x45mm M995" , 861, 100, 0.0635355, -0.00126182, 3.81, 0, 2, 10, 120, 0, 0, 4.536, 5.70, 17.78, 0.310, 1, "ASM" , [[-15,842],[0,849],[10,856],[15,861],[25,875],[30,884],[35,895]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
["5.45x39mm 7N6M" , 727, 100, 0.0801269, -0.00116278, 3.81, 0, 2, 10, 120, 0, 0, 3.428, 5.59, 16.00, 0.336, 1, "ICAO", [[-15,708],[0,715],[10,722],[15,727],[25,741],[30,750],[35,761]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true]];
["5.45x39mm 7N6M" , 727, 100, 0.0801269, -0.00119458, 3.81, 0, 2, 10, 120, 0, 0, 3.428, 5.59, 16.00, 0.336, 1, "ICAO", [[-15,708],[0,715],[10,722],[15,727],[25,741],[30,750],[35,761]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true]];
[] call FUNC(clear_user_data);
profileNamespace setVariable ["ACE_ATragMX_gunList", GVAR(gunList)];

View File

@ -19,7 +19,7 @@ GVAR(atmosphereModeTBH) = true;
GVAR(altitude) = 0;
GVAR(temperature) = 15;
GVAR(barometricPressure) = 1013.25;
GVAR(relativeHumidity) = 0.5;
GVAR(relativeHumidity) = 0.0;
[] call FUNC(update_atmo_selection);
[] call FUNC(update_atmosphere);

View File

@ -23,7 +23,7 @@ GVAR(atmosphereModeTBH) = profileNamespace getVariable ["ACE_ATragMX_atmosphereM
GVAR(altitude) = -1000 max (profileNamespace getVariable ["ACE_ATragMX_altitude", 0]) min 20000;
GVAR(temperature) = -50 max (profileNamespace getVariable ["ACE_ATragMX_temperature", 15]) min 160;
GVAR(barometricPressure) = 340 max (profileNamespace getVariable ["ACE_ATragMX_barometricPressure", 1013.25]) min 1350;
GVAR(relativeHumidity) = 0 max (profileNamespace getVariable ["ACE_ATragMX_relativeHumidity", 0.5]) min 1;
GVAR(relativeHumidity) = 0 max (profileNamespace getVariable ["ACE_ATragMX_relativeHumidity", 0.0]) min 1;
GVAR(showWind2) = profileNamespace getVariable ["ACE_ATragMX_showWind2", false];
GVAR(showCoriolis) = profileNamespace getVariable ["ACE_ATragMX_showCoriolis", true];

View File

@ -16,4 +16,4 @@
#include "\z\ace\addons\main\script_macros.hpp"
#define ATRAGMX_PROFILE_NAMESPACE_VERSION 2.0
#define ATRAGMX_PROFILE_NAMESPACE_VERSION 2.1

View File

@ -7,7 +7,7 @@ class CfgAmmo {
};
class B_556x45_Ball : BulletBase {
airFriction=-0.00126466;
airFriction=-0.00130094;
tracerScale = 1;
tracerStartTime=0.073; // M856 tracer burns out to 800m
tracerEndTime=1.57123; // Time in seconds calculated with ballistics calculator
@ -23,7 +23,7 @@ class CfgAmmo {
ACE_barrelLengths[]={210.82, 238.76, 269.24, 299.72, 330.2, 360.68, 391.16, 419.1, 449.58, 480.06, 508.0, 609.6};
};
class ACE_556x45_Ball_Mk262 : B_556x45_Ball {
airFriction=-0.00109563;
airFriction=-0.00111805;
ACE_caliber=5.69;
ACE_bulletLength=23.012;
ACE_bulletMass=4.9896;
@ -36,7 +36,7 @@ class CfgAmmo {
ACE_barrelLengths[]={190.5, 368.3, 457.2, 508.0};
};
class ACE_556x45_Ball_Mk318 : B_556x45_Ball {
airFriction=-0.00123318;
airFriction=-0.0012588;
ACE_caliber=5.69;
ACE_bulletLength=23.012;
ACE_bulletMass=4.0176;
@ -49,7 +49,7 @@ class CfgAmmo {
ACE_barrelLengths[]={254.0, 393.7, 508.0};
};
class ACE_556x45_Ball_M995_AP : B_556x45_Ball {
airFriction=-0.00123272;
airFriction=-0.00126182;
caliber=1.6;
ACE_caliber=5.69;
ACE_bulletLength=23.012;
@ -67,7 +67,7 @@ class CfgAmmo {
nvgOnly = 1;
};
class B_545x39_Ball_F : BulletBase {
airFriction=-0.00116278;
airFriction=-0.00119458;
ACE_caliber=5.588;
ACE_bulletLength=21.59;
ACE_bulletMass=3.42792;
@ -83,7 +83,7 @@ class CfgAmmo {
tracerScale = 0.5;
};
class B_580x42_Ball_F: BulletBase {
airFriction=-0.00117956;
airFriction=-0.00121087;
ACE_caliber=5.9944;
ACE_bulletLength=24.2;
ACE_bulletMass=4.15;
@ -96,7 +96,7 @@ class CfgAmmo {
ACE_barrelLengths[]={369.0, 463.0, 600.0};
};
class B_65x39_Caseless : BulletBase {
airFriction=-0.00075308;
airFriction=-0.00077363;
tracerScale = 1.1; //1.0;
ACE_caliber=6.706;
ACE_bulletLength=32.893;
@ -118,7 +118,7 @@ class CfgAmmo {
nvgOnly = 1;
};
class ACE_65x47_Ball_Scenar: B_65x39_Caseless {
airFriction=-0.00067037;
airFriction=-0.00069003;
caliber=0.9;
ACE_caliber=6.706;
ACE_bulletLength=34.646;
@ -132,7 +132,7 @@ class CfgAmmo {
ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4};
};
class ACE_65_Creedmor_Ball: B_65x39_Caseless {
airFriction=-0.00060887;
airFriction=-0.00062437;
caliber=1.1;
ACE_caliber=6.706;
ACE_bulletLength=36.22;
@ -150,7 +150,7 @@ class CfgAmmo {
tracerScale = 1.1; //1.0;
};
class B_762x51_Ball : BulletBase {
airFriction=-0.00100957;
airFriction=-0.00103711;
tracerScale = 1.2; //0.6;
tracerStartTime=0.073; // Based on the British L5A1 which burns out to 1000m
tracerEndTime=2.15957; // Time in seconds calculated with ballistics calculator
@ -170,7 +170,7 @@ class CfgAmmo {
nvgOnly = 1;
};
class ACE_762x51_Ball_M118LR : B_762x51_Ball {
airFriction=-0.00082828;
airFriction=-0.00085157;
caliber=1.8;
hit=16;
typicalSpeed=790;
@ -186,7 +186,7 @@ class CfgAmmo {
ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4};
};
class ACE_762x51_Ball_Mk316_Mod_0 : B_762x51_Ball {
airFriction=-0.00082029;
airFriction=-0.00084311;
caliber=1.8;
hit=16;
typicalSpeed=790;
@ -202,7 +202,7 @@ class CfgAmmo {
ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4};
};
class ACE_762x51_Ball_Mk319_Mod_0 : B_762x51_Ball {
airFriction=-0.00102338;
airFriction=-0.00104515;
caliber=1.5;
hit=14;
typicalSpeed=900;
@ -218,7 +218,7 @@ class CfgAmmo {
ACE_barrelLengths[]={330.2, 406.4, 508.0};
};
class ACE_762x51_Ball_M993_AP : B_762x51_Ball {
airFriction=-0.00107148;
airFriction=-0.0010939;
caliber=2.2;
hit=11;
typicalSpeed=910;
@ -234,7 +234,7 @@ class CfgAmmo {
ACE_barrelLengths[]={330.2, 406.4, 508.0};
};
class ACE_762x51_Ball_Subsonic : B_762x51_Ball {
airFriction=-0.00049899;
airFriction=-0.00060194;
caliber=1;
hit=6;
typicalSpeed=320;
@ -250,7 +250,7 @@ class CfgAmmo {
ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4};
};
class ACE_762x67_Ball_Mk248_Mod_0 : B_762x51_Ball {
airFriction=-0.00070530;
airFriction=-0.00072468;
caliber=1.8;
hit=17;
typicalSpeed=900;
@ -266,7 +266,7 @@ class CfgAmmo {
ACE_barrelLengths[]={508.0, 609.6, 660.4};
};
class ACE_762x67_Ball_Mk248_Mod_1 : B_762x51_Ball {
airFriction=-0.00061188;
airFriction=-0.00063027;
caliber=1.9;
hit=18;
typicalSpeed=867;
@ -282,7 +282,7 @@ class CfgAmmo {
ACE_barrelLengths[]={508.0, 609.6, 660.4};
};
class ACE_762x67_Ball_Berger_Hybrid_OTM : B_762x51_Ball {
airFriction=-0.00053733;
airFriction=-0.00055262;
caliber=2.0;
hit=19;
typicalSpeed=853;
@ -298,7 +298,7 @@ class CfgAmmo {
ACE_barrelLengths[]={508.0, 609.6, 660.4};
};
class B_762x54_Ball: B_762x51_Ball {
airFriction=-0.00100023;
airFriction=-0.00102329;
ACE_caliber=7.925;
ACE_bulletLength=28.956;
ACE_bulletMass=9.8496;
@ -312,7 +312,7 @@ class CfgAmmo {
};
class B_762x54_Tracer_Green;
class ACE_762x54_Ball_7T2 : B_762x54_Tracer_Green {
airFriction=-0.00103989;
airFriction=-0.00106104;
typicalSpeed=800;
tracerStartTime=0.073; // Based on the 7T2 which burns three seconds
tracerEndTime=3;
@ -328,7 +328,7 @@ class CfgAmmo {
ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4};
};
class B_762x39_Ball_F : BulletBase {
airFriction=-0.00151621;
airFriction=-0.00154815;
ACE_caliber=7.823;
ACE_bulletLength=28.956;
ACE_bulletMass=7.9704;
@ -341,7 +341,7 @@ class CfgAmmo {
ACE_barrelLengths[]={254.0, 414.02, 508.0};
};
class B_9x21_Ball : BulletBase {
airFriction=-0.00208292;
airFriction=-0.00211064;
tracerScale = 0.5;
ACE_caliber=9.042;
ACE_bulletLength=15.494;
@ -358,7 +358,7 @@ class CfgAmmo {
tracerScale = 0.5;
};
class ACE_9x19_Ball : B_9x21_Ball {
airFriction=-0.0019835;
airFriction=-0.00201185;
ACE_caliber=9.017;
ACE_bulletLength=15.494;
ACE_bulletMass=8.0352;
@ -371,7 +371,7 @@ class CfgAmmo {
ACE_barrelLengths[]={101.6, 127.0, 228.6};
};
class B_93x64_Ball : BulletBase {
airFriction=-0.00108571;
airFriction=-0.00110727;
ACE_caliber=9.296;
ACE_bulletLength=34.29;
ACE_bulletMass=14.904;
@ -385,7 +385,7 @@ class CfgAmmo {
};
class B_408_Ball : BulletBase {
timeToLive=10;
airFriction=-0.00044958;
airFriction=-0.00046249;
tracerScale = 1.3;
ACE_caliber=10.363;
ACE_bulletLength=55.1942;
@ -401,7 +401,7 @@ class CfgAmmo {
};
class ACE_408_Ball : BulletBase {
timeToLive=10;
airFriction=-0.00063655;
airFriction=-0.00065414;
typicalSpeed=1067;
tracerScale = 1.3;
ACE_caliber=10.363;
@ -418,7 +418,7 @@ class CfgAmmo {
};
class B_338_Ball : BulletBase {
timeToLive=10;
airFriction=-0.00059133;
airFriction=-0.00060841;
ACE_caliber=8.585;
ACE_bulletLength=39.573;
ACE_bulletMass=16.2;
@ -431,7 +431,7 @@ class CfgAmmo {
ACE_barrelLengths[]={508.0, 660.4, 711.2};
};
class B_338_NM_Ball : BulletBase {
airFriction=-0.00052201;
airFriction=-0.00053639;
ACE_caliber=8.585;
ACE_bulletLength=43.18;
ACE_bulletMass=19.44;
@ -445,7 +445,7 @@ class CfgAmmo {
};
class ACE_338_Ball : B_338_Ball {
timeToLive=10;
airFriction=-0.00052190;
airFriction=-0.00053585;
typicalSpeed=826;
ACE_caliber=8.585;
ACE_bulletLength=43.18;
@ -460,7 +460,7 @@ class CfgAmmo {
};
class ACE_338_Ball_API526 : B_338_Ball {
timeToLive=10;
airFriction=-0.00069611;
airFriction=-0.0006922;
caliber=2.8;
typicalSpeed=895;
ACE_caliber=8.585;
@ -478,7 +478,7 @@ class CfgAmmo {
tracerScale = 1.3; //1.2;
};
class B_127x54_Ball : BulletBase {
airFriction=-0.00019268;
airFriction=-0.00019568;
tracerScale = 1.3;//
ACE_caliber=12.954;
ACE_bulletLength=64.516;
@ -493,7 +493,7 @@ class CfgAmmo {
};
class B_127x99_Ball : BulletBase {
timeToLive=10;
airFriction=-0.00057503;
airFriction=-0.00058679;
tracerScale = 1.3; //1.2;
ACE_caliber=12.954;
ACE_bulletLength=58.674;
@ -508,7 +508,7 @@ class CfgAmmo {
};
class ACE_127x99_API : B_127x99_Ball {
timeToLive=10;
airFriction=-0.00057503;
airFriction=-0.00058679;
tracerScale = 1.3;//
hit=25;
caliber=4.0;
@ -525,7 +525,7 @@ class CfgAmmo {
};
class ACE_127x99_Ball_AMAX : B_127x99_Ball {
timeToLive=10;
airFriction=-0.00036645;
airFriction=-0.00037397;
caliber=3.0;
ACE_caliber=12.954;
ACE_bulletLength=64.516;
@ -540,7 +540,7 @@ class CfgAmmo {
};
class B_127x108_Ball : BulletBase {
timeToLive=10;
airFriction=-0.00063800;
airFriction=-0.00065098;
tracerScale = 1.3; //1.5;
ACE_caliber=12.979;
ACE_bulletLength=64.008;
@ -554,7 +554,7 @@ class CfgAmmo {
ACE_barrelLengths[]={728.98};
};
class B_45ACP_Ball : BulletBase {
airFriction=-0.00081221;
airFriction=-0.00082143;
tracerScale = 0.6;
ACE_caliber=11.481;
ACE_bulletLength=17.272;
@ -568,7 +568,7 @@ class CfgAmmo {
ACE_barrelLengths[]={101.6, 127.0, 228.6};
};
class B_50BW_Ball_F : BulletBase {
airFriction=-0.00202645;
airFriction=-0.00205896;
ACE_caliber=12.7;
ACE_bulletLength=24.13;
ACE_bulletMass=21.7076;

View File

@ -103,7 +103,7 @@ while {_TOF < 6 && (_bulletPos select 1) < _targetRange} do {
_trueSpeed = vectorMagnitude _trueVelocity;
if (_useABConfig) then {
private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3", _dragModel, _bc, _trueSpeed]));
private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3:%4", _dragModel, _bc, _trueSpeed, _temperature]));
_bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (-1 * _drag);
} else {
_bulletAccel = _trueVelocity vectorMultiply (_trueSpeed * _airFriction * _airFrictionCoef);

View File

@ -50,7 +50,7 @@ class ACE_Settings {
};
class GVAR(zeroReferenceHumidity) {
typeName = "SCALAR";
value = 0.5;
value = 0.0;
displayName = CSTRING(zeroReferenceHumidity_displayName);
description = CSTRING(zeroReferenceHumidity_description);
};

View File

@ -74,7 +74,7 @@ class CfgVehicles {
displayName = CSTRING(zeroReferenceHumidity_DisplayName);
description = CSTRING(zeroReferenceHumidity_Description);
typeName = "NUMBER";
defaultValue = 0.5;
defaultValue = 0.0;
};
class deduceBarometricPressureFromTerrainAltitude {
displayName = CSTRING(deduceBarometricPressureFromTerrainAltitude_DisplayName);

View File

@ -15,4 +15,4 @@
*/
#include "script_component.hpp"
(331.3 + (0.6 * _this))
(331.3 * sqrt(1 + (_this / 273.15)))

View File

@ -7,7 +7,6 @@
#include <random>
#include <cmath>
#define DELTA_T 0.02f
#define GRAVITY 9.80665f
#define DEGREES(X) (X * 180 / M_PI)
@ -21,6 +20,9 @@
#define SPECIFIC_GAS_CONSTANT_DRY_AIR 287.058f
#define STD_AIR_DENSITY_ICAO 1.22498f
#define STD_AIR_DENSITY_ASM 1.20885f
#define BC_CONVERSION_FACTOR 0.00068418f
#define SPEED_OF_SOUND(t) (331.3 * std::sqrt(1 + t / 273.15f))
#define SPEED_OF_SOUND_AT_15C 340.275
struct Bullet {
double airFriction;
@ -37,6 +39,7 @@ struct Bullet {
double twistDirection;
double transonicStabilityCoef;
double muzzleVelocity;
double bulletSpeed;
std::vector<double> origin;
double latitude;
double temperature;
@ -114,117 +117,35 @@ double calculateAtmosphericCorrection(double ballisticCoefficient, double temper
}
}
double calculateRetard(int DragFunction, double DragCoefficient, double Velocity) {
double vel = Velocity * 3.2808399;
double val = -1;
double A = -1;
double M = -1;
// Drag Functions from: http://www.jbmballistics.com/ballistics/downloads/text/
const std::vector<double> dragCoefficientsG1 = { 0.2629, 0.2558, 0.2487, 0.2413, 0.2344, 0.2278, 0.2214, 0.2155, 0.2104, 0.2061, 0.2032, 0.2020, 0.2034, 0.2165, 0.2230, 0.2313, 0.2417, 0.2546, 0.2706, 0.2901, 0.3136, 0.3415, 0.3734, 0.4084, 0.4448, 0.4805, 0.5136, 0.5427, 0.5677, 0.5883, 0.6053, 0.6191, 0.6393, 0.6518, 0.6589, 0.6621, 0.6625, 0.6607, 0.6573, 0.6528, 0.6474, 0.6413, 0.6347, 0.6280, 0.6210, 0.6141, 0.6072, 0.6003, 0.5934, 0.5867, 0.5804, 0.5743, 0.5685, 0.5630, 0.5577, 0.5527, 0.5481, 0.5438, 0.5397, 0.5325, 0.5264, 0.5211, 0.5168, 0.5133, 0.5105, 0.5084, 0.5067, 0.5054, 0.5040, 0.5030, 0.5022, 0.5016, 0.5010, 0.5006, 0.4998, 0.4995, 0.4992, 0.4990, 0.4988 };
const std::vector<double> machNumbersG1 = { 0.00, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.70, 0.725, 0.75, 0.775, 0.80, 0.825, 0.85, 0.875, 0.90, 0.925, 0.95, 0.975, 1.0, 1.025, 1.05, 1.075, 1.10, 1.125, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, 2.30, 2.35, 2.40, 2.45, 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.20, 4.40, 4.60, 4.80, 5.00 };
const std::vector<double> dragCoefficientsG2 = { 0.2303, 0.2298, 0.2287, 0.2271, 0.2251, 0.2227, 0.2196, 0.2156, 0.2107, 0.2048, 0.1980, 0.1905, 0.1828, 0.1758, 0.1702, 0.1669, 0.1664, 0.1667, 0.1682, 0.1711, 0.1761, 0.1831, 0.2004, 0.2589, 0.3492, 0.3983, 0.4075, 0.4103, 0.4114, 0.4106, 0.4089, 0.4068, 0.4046, 0.4021, 0.3966, 0.3904, 0.3835, 0.3759, 0.3678, 0.3594, 0.3512, 0.3432, 0.3356, 0.3282, 0.3213, 0.3149, 0.3089, 0.3033, 0.2982, 0.2933, 0.2889, 0.2846, 0.2806, 0.2768, 0.2731, 0.2696, 0.2663, 0.2632, 0.2602, 0.2572, 0.2543, 0.2515, 0.2487, 0.2460, 0.2433, 0.2408, 0.2382, 0.2357, 0.2333, 0.2309, 0.2262, 0.2217, 0.2173, 0.2132, 0.2091, 0.2052, 0.2014, 0.1978, 0.1944, 0.1912, 0.1851, 0.1794, 0.1741, 0.1693, 0.1648 };
const std::vector<double> machNumbersG2 = { 0.00, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.775, 0.80, 0.825, 0.85, 0.875, 0.90, 0.925, 0.95, 0.975, 1.0, 1.025, 1.05, 1.075, 1.10, 1.125, 1.15, 1.175, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, 2.30, 2.35, 2.40, 2.45, 2.50, 2.55, 2.60, 2.65, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.20, 4.40, 4.60, 4.80, 5.00 };
const std::vector<double> dragCoefficientsG5 = { 0.1710, 0.1719, 0.1727, 0.1732, 0.1734, 0.1730, 0.1718, 0.1696, 0.1668, 0.1637, 0.1603, 0.1566, 0.1529, 0.1497, 0.1473, 0.1463, 0.1489, 0.1583, 0.1672, 0.1815, 0.2051, 0.2413, 0.2884, 0.3379, 0.3785, 0.4032, 0.4147, 0.4201, 0.4278, 0.4338, 0.4373, 0.4392, 0.4403, 0.4406, 0.4401, 0.4386, 0.4362, 0.4328, 0.4286, 0.4237, 0.4182, 0.4121, 0.4057, 0.3991, 0.3926, 0.3861, 0.3800, 0.3741, 0.3684, 0.3630, 0.3578, 0.3529, 0.3481, 0.3435, 0.3391, 0.3349, 0.3269, 0.3194, 0.3125, 0.3060, 0.2999, 0.2942, 0.2889, 0.2838, 0.2790, 0.2745, 0.2703, 0.2662, 0.2624, 0.2588, 0.2553, 0.2488, 0.2429, 0.2376, 0.2326, 0.2280 };
const std::vector<double> machNumbersG5 = { 0.00, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.875, 0.90, 0.925, 0.95, 0.975, 1.0, 1.025, 1.05, 1.075, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, 2.30, 2.35, 2.40, 2.45, 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.20, 4.40, 4.60, 4.80, 5.00 };
const std::vector<double> dragCoefficientsG6 = { 0.2617, 0.2553, 0.2491, 0.2432, 0.2376, 0.2324, 0.2278, 0.2238, 0.2205, 0.2177, 0.2155, 0.2138, 0.2126, 0.2121, 0.2122, 0.2132, 0.2154, 0.2194, 0.2229, 0.2297, 0.2449, 0.2732, 0.3141, 0.3597, 0.3994, 0.4261, 0.4402, 0.4465, 0.4490, 0.4497, 0.4494, 0.4482, 0.4464, 0.4441, 0.4390, 0.4336, 0.4279, 0.4221, 0.4162, 0.4102, 0.4042, 0.3981, 0.3919, 0.3855, 0.3788, 0.3721, 0.3652, 0.3583, 0.3515, 0.3447, 0.3381, 0.3314, 0.3249, 0.3185, 0.3122, 0.3060, 0.3000, 0.2941, 0.2883, 0.2772, 0.2668, 0.2574, 0.2487, 0.2407, 0.2333, 0.2265, 0.2202, 0.2144, 0.2089, 0.2039, 0.1991, 0.1947, 0.1905, 0.1866, 0.1794, 0.1730, 0.1673, 0.1621, 0.1574 };
const std::vector<double> machNumbersG6 = { 0.00, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.875, 0.90, 0.925, 0.95, 0.975, 1.0, 1.025, 1.05, 1.075, 1.10, 1.125, 1.15, 1.175, 1.20, 1.225, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, 2.30, 2.35, 2.40, 2.45, 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.20, 4.40, 4.60, 4.80, 5.00 };
const std::vector<double> dragCoefficientsG7 = { 0.1198, 0.1197, 0.1196, 0.1194, 0.1193, 0.1194, 0.1194, 0.1194, 0.1193, 0.1193, 0.1194, 0.1193, 0.1194, 0.1197, 0.1202, 0.1207, 0.1215, 0.1226, 0.1242, 0.1266, 0.1306, 0.1368, 0.1464, 0.1660, 0.2054, 0.2993, 0.3803, 0.4015, 0.4043, 0.4034, 0.4014, 0.3987, 0.3955, 0.3884, 0.3810, 0.3732, 0.3657, 0.3580, 0.3440, 0.3376, 0.3315, 0.3260, 0.3209, 0.3160, 0.3117, 0.3078, 0.3042, 0.3010, 0.2980, 0.2951, 0.2922, 0.2892, 0.2864, 0.2835, 0.2807, 0.2779, 0.2752, 0.2725, 0.2697, 0.2670, 0.2643, 0.2615, 0.2588, 0.2561, 0.2533, 0.2506, 0.2479, 0.2451, 0.2424, 0.2368, 0.2313, 0.2258, 0.2205, 0.2154, 0.2106, 0.2060, 0.2017, 0.1975, 0.1935, 0.1861, 0.1793, 0.1730, 0.1672, 0.1618 };
const std::vector<double> machNumbersG7 = { 0.0, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.725, 0.75, 0.775, 0.80, 0.825, 0.85, 0.875, 0.90, 0.925, 0.95, 0.975, 1.0, 1.025, 1.05, 1.075, 1.10, 1.125, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, 2.30, 2.35, 2.40, 2.45, 2.50, 2.55, 2.60, 2.65, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.20, 4.40, 4.60, 4.80, 5.00 };
const std::vector<double> dragCoefficientsG8 = { 0.2105, 0.2105, 0.2104, 0.2104, 0.2103, 0.2103, 0.2103, 0.2103, 0.2103, 0.2102, 0.2102, 0.2102, 0.2102, 0.2102, 0.2103, 0.2103, 0.2104, 0.2104, 0.2105, 0.2106, 0.2109, 0.2183, 0.2571, 0.3358, 0.4068, 0.4378, 0.4476, 0.4493, 0.4477, 0.4450, 0.4419, 0.4353, 0.4283, 0.4208, 0.4133, 0.4059, 0.3986, 0.3915, 0.3845, 0.3777, 0.3710, 0.3645, 0.3581, 0.3519, 0.3458, 0.3400, 0.3343, 0.3288, 0.3234, 0.3182, 0.3131, 0.3081, 0.3032, 0.2983, 0.2937, 0.2891, 0.2845, 0.2802, 0.2720, 0.2642, 0.2569, 0.2499, 0.2432, 0.2368, 0.2308, 0.2251, 0.2197, 0.2147, 0.2101, 0.2058, 0.2019, 0.1983, 0.1950, 0.1890, 0.1837, 0.1791, 0.1750, 0.1713 };
const std::vector<double> machNumbersG8 = { 0.00, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.825, 0.85, 0.875, 0.90, 0.925, 0.95, 0.975, 1.0, 1.025, 1.05, 1.075, 1.10, 1.125, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, 2.30, 2.35, 2.40, 2.45, 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.20, 4.40, 4.60, 4.80, 5.00 };
switch (DragFunction) {
case 1:
if (vel> 4230) { A = 1.477404177730177e-04; M = 1.9565; }
else if (vel> 3680) { A = 1.920339268755614e-04; M = 1.925; }
else if (vel> 3450) { A = 2.894751026819746e-04; M = 1.875; }
else if (vel> 3295) { A = 4.349905111115636e-04; M = 1.825; }
else if (vel> 3130) { A = 6.520421871892662e-04; M = 1.775; }
else if (vel> 2960) { A = 9.748073694078696e-04; M = 1.725; }
else if (vel> 2830) { A = 1.453721560187286e-03; M = 1.675; }
else if (vel> 2680) { A = 2.162887202930376e-03; M = 1.625; }
else if (vel> 2460) { A = 3.209559783129881e-03; M = 1.575; }
else if (vel> 2225) { A = 3.904368218691249e-03; M = 1.55; }
else if (vel> 2015) { A = 3.222942271262336e-03; M = 1.575; }
else if (vel> 1890) { A = 2.203329542297809e-03; M = 1.625; }
else if (vel> 1810) { A = 1.511001028891904e-03; M = 1.675; }
else if (vel> 1730) { A = 8.609957592468259e-04; M = 1.75; }
else if (vel> 1595) { A = 4.086146797305117e-04; M = 1.85; }
else if (vel> 1520) { A = 1.954473210037398e-04; M = 1.95; }
else if (vel> 1420) { A = 5.431896266462351e-05; M = 2.125; }
else if (vel> 1360) { A = 8.847742581674416e-06; M = 2.375; }
else if (vel> 1315) { A = 1.456922328720298e-06; M = 2.625; }
else if (vel> 1280) { A = 2.419485191895565e-07; M = 2.875; }
else if (vel> 1220) { A = 1.657956321067612e-08; M = 3.25; }
else if (vel> 1185) { A = 4.745469537157371e-10; M = 3.75; }
else if (vel> 1150) { A = 1.379746590025088e-11; M = 4.25; }
else if (vel> 1100) { A = 4.070157961147882e-13; M = 4.75; }
else if (vel> 1060) { A = 2.938236954847331e-14; M = 5.125; }
else if (vel> 1025) { A = 1.228597370774746e-14; M = 5.25; }
else if (vel> 980) { A = 2.916938264100495e-14; M = 5.125; }
else if (vel> 945) { A = 3.855099424807451e-13; M = 4.75; }
else if (vel> 905) { A = 1.185097045689854e-11; M = 4.25; }
else if (vel> 860) { A = 3.566129470974951e-10; M = 3.75; }
else if (vel> 810) { A = 1.045513263966272e-08; M = 3.25; }
else if (vel> 780) { A = 1.291159200846216e-07; M = 2.875; }
else if (vel> 750) { A = 6.824429329105383e-07; M = 2.625; }
else if (vel> 700) { A = 3.569169672385163e-06; M = 2.375; }
else if (vel> 640) { A = 1.839015095899579e-05; M = 2.125; }
else if (vel> 600) { A = 5.71117468873424e-05; M = 1.950; }
else if (vel> 550) { A = 9.226557091973427e-05; M = 1.875; }
else if (vel> 250) { A = 9.337991957131389e-05; M = 1.875; }
else if (vel> 100) { A = 7.225247327590413e-05; M = 1.925; }
else if (vel> 65) { A = 5.792684957074546e-05; M = 1.975; }
else if (vel> 0) { A = 5.206214107320588e-05; M = 2.000; }
break;
const std::vector<std::vector<double>> dragCoefficients = { {}, dragCoefficientsG1, dragCoefficientsG2, {}, {}, dragCoefficientsG5, dragCoefficientsG6, dragCoefficientsG7, dragCoefficientsG8, {} };
const std::vector<std::vector<double>> machNumbers = { {}, machNumbersG1, machNumbersG2, {},{}, machNumbersG5, machNumbersG6, machNumbersG7, machNumbersG8,{} };
case 2:
if (vel> 1674) { A = .0079470052136733; M = 1.36999902851493; }
else if (vel> 1172) { A = 1.00419763721974e-03; M = 1.65392237010294; }
else if (vel> 1060) { A = 7.15571228255369e-23; M = 7.91913562392361; }
else if (vel> 949) { A = 1.39589807205091e-10; M = 3.81439537623717; }
else if (vel> 670) { A = 2.34364342818625e-04; M = 1.71869536324748; }
else if (vel> 335) { A = 1.77962438921838e-04; M = 1.76877550388679; }
else if (vel> 0) { A = 5.18033561289704e-05; M = 1.98160270524632; }
break;
case 5:
if (vel> 1730) { A = 7.24854775171929e-03; M = 1.41538574492812; }
else if (vel> 1228) { A = 3.50563361516117e-05; M = 2.13077307854948; }
else if (vel> 1116) { A = 1.84029481181151e-13; M = 4.81927320350395; }
else if (vel> 1004) { A = 1.34713064017409e-22; M = 7.8100555281422; }
else if (vel> 837) { A = 1.03965974081168e-07; M = 2.84204791809926; }
else if (vel> 335) { A = 1.09301593869823e-04; M = 1.81096361579504; }
else if (vel> 0) { A = 3.51963178524273e-05; M = 2.00477856801111; }
break;
case 6:
if (vel> 3236) { A = 0.0455384883480781; M = 1.15997674041274; }
else if (vel> 2065) { A = 7.167261849653769e-02; M = 1.10704436538885; }
else if (vel> 1311) { A = 1.66676386084348e-03; M = 1.60085100195952; }
else if (vel> 1144) { A = 1.01482730119215e-07; M = 2.9569674731838; }
else if (vel> 1004) { A = 4.31542773103552e-18; M = 6.34106317069757; }
else if (vel> 670) { A = 2.04835650496866e-05; M = 2.11688446325998; }
else if (vel> 0) { A = 7.50912466084823e-05; M = 1.92031057847052; }
break;
case 7:
if (vel> 4200) { A = 1.29081656775919e-09; M = 3.24121295355962; }
else if (vel> 3000) { A = 0.0171422231434847; M = 1.27907168025204; }
else if (vel> 1470) { A = 2.33355948302505e-03; M = 1.52693913274526; }
else if (vel> 1260) { A = 7.97592111627665e-04; M = 1.67688974440324; }
else if (vel> 1110) { A = 5.71086414289273e-12; M = 4.3212826264889; }
else if (vel> 960) { A = 3.02865108244904e-17; M = 5.99074203776707; }
else if (vel> 670) { A = 7.52285155782535e-06; M = 2.1738019851075; }
else if (vel> 540) { A = 1.31766281225189e-05; M = 2.08774690257991; }
else if (vel> 0) { A = 1.34504843776525e-05; M = 2.08702306738884; }
break;
case 8:
if (vel> 3571) { A = .0112263766252305; M = 1.33207346655961; }
else if (vel> 1841) { A = .0167252613732636; M = 1.28662041261785; }
else if (vel> 1120) { A = 2.20172456619625e-03; M = 1.55636358091189; }
else if (vel> 1088) { A = 2.0538037167098e-16; M = 5.80410776994789; }
else if (vel> 976) { A = 5.92182174254121e-12; M = 4.29275576134191; }
else if (vel> 0) { A = 4.3917343795117e-05; M = 1.99978116283334; }
break;
default:
break;
double calculateRetard(int DragFunction, double DragCoefficient, double Velocity, double Mach) {
int idx = std::max(0, std::min(DragFunction, 9));
double m = Velocity / Mach;
for (int i = 0; i < machNumbers[idx].size(); i++) {
if (machNumbers[idx][i] >= m) {
int previousIdx = std::max(0, i - 1);
double previousDragCoefficient = dragCoefficients[idx][previousIdx];
double previousMachNumber = machNumbers[idx][previousIdx];
double cd = previousDragCoefficient + (dragCoefficients[idx][i] - previousDragCoefficient) * (m - previousMachNumber) / (machNumbers[idx][i] - previousMachNumber);
return BC_CONVERSION_FACTOR * (cd / DragCoefficient) * std::pow(Velocity, 2);
}
if (A != -1 && M != -1 && vel > 0 && vel < 10000) {
val = A * pow(vel, M) / DragCoefficient;
val = val / 3.2808399;
return val;
}
return 0.0;
@ -309,7 +230,7 @@ double calculateZeroAngle(double zeroRange, double muzzleVelocity, double boreHe
v = std::sqrt(vx*vx + vy*vy);
double retard = calculateRetard(dragModel, ballisticCoefficient, v);
double retard = calculateRetard(dragModel, ballisticCoefficient, v, SPEED_OF_SOUND_AT_15C);
double ax = vx / v * -retard;
double ay = vy / v * -retard;
ax += gx;
@ -366,13 +287,15 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function)
double ballisticCoefficient = 1.0;
int dragModel = 1;
double velocity = 0.0;
double temperature = 15.0;
double retard = 0.0;
dragModel = strtol(strtok_s(NULL, ":", &next_token), NULL, 10);
ballisticCoefficient = strtod(strtok_s(NULL, ":", &next_token), NULL);
velocity = strtod(strtok_s(NULL, ":", &next_token), NULL);
temperature = strtod(strtok_s(NULL, ":", &next_token), NULL);
retard = calculateRetard(dragModel, ballisticCoefficient, velocity);
retard = calculateRetard(dragModel, ballisticCoefficient, velocity, SPEED_OF_SOUND(temperature));
// int n = sprintf(output, "%f", retard);
outputStr << retard;
@ -460,7 +383,6 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function)
humidity = strtod(strtok_s(NULL, ":", &next_token), NULL);
overcast = strtod(strtok_s(NULL, ":", &next_token), NULL);
tickTime = strtod(strtok_s(NULL, ":", &next_token), NULL);
tickTime += strtod(strtok_s(NULL, ":", &next_token), NULL);
while (index >= bulletDatabase.size()) {
Bullet bullet;
@ -476,6 +398,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function)
bulletDatabase[index].twistDirection = twistDirection;
bulletDatabase[index].transonicStabilityCoef = transonicStabilityCoef;
bulletDatabase[index].muzzleVelocity = muzzleVelocity;
bulletDatabase[index].bulletSpeed = muzzleVelocity;
bulletDatabase[index].origin = origin;
bulletDatabase[index].latitude = latitude / 180 * M_PI;
bulletDatabase[index].temperature = temperature;
@ -522,7 +445,6 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function)
wind[2] = strtod(strtok_s(NULL, ",", &token), NULL);
heightAGL = strtod(strtok_s(NULL, ":", &next_token), NULL);
tickTime = strtod(strtok_s(NULL, ":", &next_token), NULL);
tickTime += strtod(strtok_s(NULL, ":", &next_token), NULL);
if (bulletDatabase[index].randSeed == 0) {
int angle = (int)round(atan2(velocity[0], velocity[1]) * 360 / M_PI);
@ -545,24 +467,18 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function)
double drag = 0.0;
double accelRef[3] = { 0.0, 0.0, 0.0 };
double accel[3] = { 0.0, 0.0, 0.0 };
double TOF = 0.0;
double deltaT = 0.0;
double bulletSpeed;
double TOF = tickTime - bulletDatabase[index].startTime;
double deltaT = tickTime - bulletDatabase[index].lastFrame;
double trueVelocity[3] = { 0.0, 0.0, 0.0 };
double trueSpeed = 0.0;
double temperature = 0.0;
double pressure = 1013.25;
double temperature = bulletDatabase[index].temperature - 0.0065 * position[2];
double pressure = (1013.25 - 10 * bulletDatabase[index].overcast) * pow(1 - (0.0065 * (bulletDatabase[index].altitude + position[2])) / (KELVIN(temperature) + 0.0065 * bulletDatabase[index].altitude), 5.255754495);
double windSpeed = 0.0;
double windAttenuation = 1.0;
double velocityOffset[3] = { 0.0, 0.0, 0.0 };
TOF = tickTime - bulletDatabase[index].startTime;
deltaT = tickTime - bulletDatabase[index].lastFrame;
bulletDatabase[index].lastFrame = tickTime;
bulletSpeed = sqrt(pow(velocity[0], 2) + pow(velocity[1], 2) + pow(velocity[2], 2));
windSpeed = sqrt(pow(wind[0], 2) + pow(wind[1], 2) + pow(wind[2], 2));
if (windSpeed > 0.1) {
double windSourceTerrain[3];
@ -610,9 +526,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function)
trueVelocity[2] = velocity[2] - wind[2];
trueSpeed = sqrt(pow(trueVelocity[0], 2) + pow(trueVelocity[1], 2) + pow(trueVelocity[2], 2));
double speedOfSound = 331.3 + (0.6 * temperature);
double transonicSpeed = 394 + (0.6 * temperature);
if (bulletDatabase[index].transonicStabilityCoef < 1.0f && bulletSpeed < transonicSpeed && bulletSpeed > speedOfSound) {
if (bulletDatabase[index].transonicStabilityCoef < 1.0f && trueSpeed - 60 < SPEED_OF_SOUND(temperature) && trueSpeed > SPEED_OF_SOUND(temperature)) {
std::uniform_real_distribution<double> distribution(-10.0, 10.0);
double coef = 1.0f - bulletDatabase[index].transonicStabilityCoef;
@ -628,15 +542,12 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function)
bulletDatabase[index].bcDegradation *= pow(0.993, coef);
};
temperature = bulletDatabase[index].temperature - 0.0065 * position[2];
pressure = (1013.25 - 10 * bulletDatabase[index].overcast) * pow(1 - (0.0065 * (bulletDatabase[index].altitude + position[2])) / (273.15 + temperature + 0.0065 * bulletDatabase[index].altitude), 5.255754495);
if (bulletDatabase[index].ballisticCoefficients.size() == bulletDatabase[index].velocityBoundaries.size() + 1) {
dragRef = deltaT * bulletDatabase[index].airFriction * bulletSpeed * bulletSpeed;
dragRef = deltaT * bulletDatabase[index].airFriction * bulletDatabase[index].bulletSpeed * bulletDatabase[index].bulletSpeed;
accelRef[0] = (velocity[0] / bulletSpeed) * dragRef;
accelRef[1] = (velocity[1] / bulletSpeed) * dragRef;
accelRef[2] = (velocity[2] / bulletSpeed) * dragRef;
accelRef[0] = (velocity[0] / bulletDatabase[index].bulletSpeed) * dragRef;
accelRef[1] = (velocity[1] / bulletDatabase[index].bulletSpeed) * dragRef;
accelRef[2] = (velocity[2] / bulletDatabase[index].bulletSpeed) * dragRef;
velocityOffset[0] -= accelRef[0];
velocityOffset[1] -= accelRef[1];
@ -644,7 +555,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function)
ballisticCoefficient = bulletDatabase[index].ballisticCoefficients[0];
for (int i = (int)bulletDatabase[index].velocityBoundaries.size() - 1; i >= 0; i = i - 1) {
if (bulletSpeed < bulletDatabase[index].velocityBoundaries[i]) {
if (trueSpeed < bulletDatabase[index].velocityBoundaries[i]) {
ballisticCoefficient = bulletDatabase[index].ballisticCoefficients[i + 1];
break;
}
@ -652,7 +563,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function)
ballisticCoefficient = calculateAtmosphericCorrection(ballisticCoefficient, temperature, pressure, bulletDatabase[index].humidity, bulletDatabase[index].atmosphereModel);
ballisticCoefficient *= bulletDatabase[index].bcDegradation;
drag = deltaT * calculateRetard(bulletDatabase[index].dragModel, ballisticCoefficient, trueSpeed);
drag = deltaT * calculateRetard(bulletDatabase[index].dragModel, ballisticCoefficient, trueSpeed, SPEED_OF_SOUND(temperature));
accel[0] = (trueVelocity[0] / trueSpeed) * drag;
accel[1] = (trueVelocity[1] / trueSpeed) * drag;
accel[2] = (trueVelocity[2] / trueSpeed) * drag;
@ -665,11 +576,11 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function)
double airFriction = bulletDatabase[index].airFriction * airDensity / STD_AIR_DENSITY_ICAO;
if (airFriction != bulletDatabase[index].airFriction || windSpeed > 0) {
dragRef = deltaT * bulletDatabase[index].airFriction * bulletSpeed * bulletSpeed;
dragRef = deltaT * bulletDatabase[index].airFriction * bulletDatabase[index].bulletSpeed * bulletDatabase[index].bulletSpeed;
accelRef[0] = (velocity[0] / bulletSpeed) * dragRef;
accelRef[1] = (velocity[1] / bulletSpeed) * dragRef;
accelRef[2] = (velocity[2] / bulletSpeed) * dragRef;
accelRef[0] = (velocity[0] / bulletDatabase[index].bulletSpeed) * dragRef;
accelRef[1] = (velocity[1] / bulletDatabase[index].bulletSpeed) * dragRef;
accelRef[2] = (velocity[2] / bulletDatabase[index].bulletSpeed) * dragRef;
velocityOffset[0] -= accelRef[0];
velocityOffset[1] -= accelRef[1];
@ -688,11 +599,11 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function)
if (TOF > 0) {
double bulletDir = atan2(velocity[0], velocity[1]);
double r1 = pow(TOF - deltaT, 0.17);
double r2 = pow(TOF, 0.17);
double spinAccel = bulletDatabase[index].twistDirection * (0.0482251 * (bulletDatabase[index].stabilityFactor + 1.2)) / ((r1 + r2) / 2.0f);
velocityOffset[0] += sin(bulletDir + M_PI / 2) * spinAccel * deltaT;
velocityOffset[1] += cos(bulletDir + M_PI / 2) * spinAccel * deltaT;
double driftAccel = bulletDatabase[index].twistDirection * (0.0482251 * (bulletDatabase[index].stabilityFactor + 1.2)) / pow(TOF, 0.17);
double driftVelocity = 0.0581025 *(bulletDatabase[index].stabilityFactor + 1.2) * pow(TOF, 0.83);
double dragCorrection = (driftVelocity / trueSpeed) * drag;
velocityOffset[0] += sin(bulletDir + M_PI / 2) * (driftAccel * deltaT + dragCorrection);
velocityOffset[1] += cos(bulletDir + M_PI / 2) * (driftAccel * deltaT + dragCorrection);
}
double lat = bulletDatabase[index].latitude;
@ -704,6 +615,11 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function)
velocityOffset[1] += accel[1] * deltaT;
velocityOffset[2] += accel[2] * deltaT;
velocity[0] += velocityOffset[0];
velocity[1] += velocityOffset[1];
velocity[2] += velocityOffset[2];
bulletDatabase[index].bulletSpeed = sqrt(pow(velocity[0], 2) + pow(velocity[1], 2) + pow(velocity[2], 2));
outputStr << "[" << velocityOffset[0] << "," << velocityOffset[1] << "," << velocityOffset[2] << "]";
strncpy_s(output, outputSize, outputStr.str().c_str(), _TRUNCATE);
EXTENSION_RETURN();

View File

@ -2,359 +2,359 @@
Ammo Class: B_556x45_Ball
MaxRanges (m): [300, 500, 500]
MuzzleVelocities (m/s): [750, 870, 910]
Max. velocity difference (m/s): 25.51
Max. drop difference (cm): 2.05
Max. tof difference (ms): 10.0
Optimal airFriction: 0.00126466
Max. Velocity diff (m/s): 26.68
Max. Drop diff (cm): 1.98
Max. Tof diff (ms): 10.5
Optimal airFriction: 0.00130094
##########################################
Ammo Class: ACE_556x45_Ball_Mk262
MaxRanges (m): [600, 600]
MuzzleVelocities (m/s): [810, 840]
Max. velocity difference (m/s): 14.9
Max. drop difference (cm): 2.67
Max. tof difference (ms): 10.0
Optimal airFriction: 0.00109563
Max. Velocity diff (m/s): 14.67
Max. Drop diff (cm): 2.58
Max. Tof diff (ms): 10.5
Optimal airFriction: 0.00111805
##########################################
Ammo Class: ACE_556x45_Ball_Mk318
MaxRanges (m): [300, 500, 500]
MuzzleVelocities (m/s): [780, 880, 950]
Max. velocity difference (m/s): 20.86
Max. drop difference (cm): 2.29
Max. tof difference (ms): 9.0
Optimal airFriction: 0.00123318
Max. Velocity diff (m/s): 21.13
Max. Drop diff (cm): 2.06
Max. Tof diff (ms): 9.5
Optimal airFriction: 0.0012588
##########################################
Ammo Class: ACE_556x45_Ball_M995_AP
MaxRanges (m): [400, 500]
MuzzleVelocities (m/s): [820, 880]
Max. velocity difference (m/s): 17.92
Max. drop difference (cm): 1.25
Max. tof difference (ms): 7.0
Optimal airFriction: 0.00123272
Max. Velocity diff (m/s): 17.28
Max. Drop diff (cm): 1.04
Max. Tof diff (ms): 6.0
Optimal airFriction: 0.00126182
##########################################
Ammo Class: B_545x39_Ball_F
MaxRanges (m): [400, 500]
MuzzleVelocities (m/s): [735, 892]
Max. velocity difference (m/s): 23.07
Max. drop difference (cm): 3.76
Max. tof difference (ms): 12.0
Optimal airFriction: 0.00116278
Max. Velocity diff (m/s): 23.85
Max. Drop diff (cm): 3.61
Max. Tof diff (ms): 12.0
Optimal airFriction: 0.00119458
##########################################
Ammo Class: B_580x42_Ball_F
MaxRanges (m): [500, 500]
MuzzleVelocities (m/s): [930, 970]
Max. velocity difference (m/s): 24.7
Max. drop difference (cm): 1.51
Max. tof difference (ms): 8.0
Optimal airFriction: 0.00117956
Max. Velocity diff (m/s): 25.65
Max. Drop diff (cm): 1.46
Max. Tof diff (ms): 8.5
Optimal airFriction: 0.00121087
##########################################
Ammo Class: B_65x39_Caseless
MaxRanges (m): [400, 800, 800]
MuzzleVelocities (m/s): [730, 800, 830]
Max. velocity difference (m/s): 22.17
Max. drop difference (cm): 4.83
Max. tof difference (ms): 16.0
Optimal airFriction: 0.00075308
Max. Velocity diff (m/s): 23.49
Max. Drop diff (cm): 4.59
Max. Tof diff (ms): 16.5
Optimal airFriction: 0.00077363
##########################################
Ammo Class: ACE_65x47_Ball_Scenar
MaxRanges (m): [500, 800]
MuzzleVelocities (m/s): [730, 830]
Max. velocity difference (m/s): 16.94
Max. drop difference (cm): 2.67
Max. tof difference (ms): 9.0
Optimal airFriction: 0.00067037
Max. Velocity diff (m/s): 17.09
Max. Drop diff (cm): 2.41
Max. Tof diff (ms): 8.0
Optimal airFriction: 0.00069003
##########################################
Ammo Class: ACE_65_Creedmor_Ball
MaxRanges (m): [600, 1000]
MuzzleVelocities (m/s): [750, 860]
Max. velocity difference (m/s): 21.08
Max. drop difference (cm): 4.29
Max. tof difference (ms): 14.0
Optimal airFriction: 0.00060887
Max. Velocity diff (m/s): 22.99
Max. Drop diff (cm): 3.82
Max. Tof diff (ms): 16.0
Optimal airFriction: 0.00062437
##########################################
Ammo Class: B_762x51_Ball
MaxRanges (m): [500, 800]
MuzzleVelocities (m/s): [700, 833]
Max. velocity difference (m/s): 27.7
Max. drop difference (cm): 6.71
Max. tof difference (ms): 23.0
Optimal airFriction: 0.00100957
Max. Velocity diff (m/s): 29.78
Max. Drop diff (cm): 6.24
Max. Tof diff (ms): 26.0
Optimal airFriction: 0.00103711
##########################################
Ammo Class: ACE_762x51_Ball_M118LR
MaxRanges (m): [600, 800]
MuzzleVelocities (m/s): [750, 795]
Max. velocity difference (m/s): 23.28
Max. drop difference (cm): 3.65
Max. tof difference (ms): 17.0
Optimal airFriction: 0.00082828
Max. Velocity diff (m/s): 24.95
Max. Drop diff (cm): 3.64
Max. Tof diff (ms): 18.0
Optimal airFriction: 0.00085157
##########################################
Ammo Class: ACE_762x51_Ball_Mk316_Mod_0
MaxRanges (m): [600, 800]
MuzzleVelocities (m/s): [780, 810]
Max. velocity difference (m/s): 23.39
Max. drop difference (cm): 3.25
Max. tof difference (ms): 16.0
Optimal airFriction: 0.00082029
Max. Velocity diff (m/s): 25.0
Max. Drop diff (cm): 3.31
Max. Tof diff (ms): 17.0
Optimal airFriction: 0.00084311
##########################################
Ammo Class: ACE_762x51_Ball_Mk319_Mod_0
MaxRanges (m): [600, 800]
MuzzleVelocities (m/s): [840, 910]
Max. velocity difference (m/s): 19.18
Max. drop difference (cm): 3.9
Max. tof difference (ms): 17.0
Optimal airFriction: 0.00102338
Max. Velocity diff (m/s): 18.56
Max. Drop diff (cm): 3.74
Max. Tof diff (ms): 17.0
Optimal airFriction: 0.00104515
##########################################
Ammo Class: ACE_762x51_Ball_M993_AP
MaxRanges (m): [600, 800]
MuzzleVelocities (m/s): [875, 930]
Max. velocity difference (m/s): 19.39
Max. drop difference (cm): 4.08
Max. tof difference (ms): 18.0
Optimal airFriction: 0.00107148
Max. Velocity diff (m/s): 18.62
Max. Drop diff (cm): 4.03
Max. Tof diff (ms): 18.0
Optimal airFriction: 0.0010939
##########################################
Ammo Class: ACE_30_06_M1_Ball
MaxRanges (m): [600, 800, 900]
MuzzleVelocities (m/s): [700, 800, 840]
Max. velocity difference (m/s): 14.56
Max. drop difference (cm): 7.89
Max. tof difference (ms): 15.0
Optimal airFriction: 0.000809
Max. Velocity diff (m/s): 14.2
Max. Drop diff (cm): 7.95
Max. Tof diff (ms): 15.0
Optimal airFriction: 0.00082645
##########################################
Ammo Class: ACE_7_Remington_Magnum_Ball
MaxRanges (m): [600, 800, 1000]
MuzzleVelocities (m/s): [720, 812, 830]
Max. velocity difference (m/s): 17.47
Max. drop difference (cm): 4.54
Max. tof difference (ms): 11.0
Optimal airFriction: 0.00056738
Max. Velocity diff (m/s): 18.9
Max. Drop diff (cm): 4.03
Max. Tof diff (ms): 11.5
Optimal airFriction: 0.00058198
##########################################
Ammo Class: ACE_243_Winchester_Ball
MaxRanges (m): [700, 900, 900]
MuzzleVelocities (m/s): [830, 900, 920]
Max. velocity difference (m/s): 22.55
Max. drop difference (cm): 4.78
Max. tof difference (ms): 13.0
Optimal airFriction: 0.00067875
Max. Velocity diff (m/s): 23.53
Max. Drop diff (cm): 4.62
Max. Tof diff (ms): 13.5
Optimal airFriction: 0.00069778
##########################################
Ammo Class: ACE_762x67_Ball_Mk248_Mod_0
MaxRanges (m): [800, 900, 900]
MuzzleVelocities (m/s): [865, 900, 924]
Max. velocity difference (m/s): 24.43
Max. drop difference (cm): 5.17
Max. tof difference (ms): 15.0
Optimal airFriction: 0.0007053
Max. Velocity diff (m/s): 25.84
Max. Drop diff (cm): 5.03
Max. Tof diff (ms): 16.0
Optimal airFriction: 0.00072468
##########################################
Ammo Class: ACE_762x67_Ball_Mk248_Mod_1
MaxRanges (m): [800, 900, 900]
MuzzleVelocities (m/s): [847, 867, 877]
Max. velocity difference (m/s): 20.16
Max. drop difference (cm): 2.99
Max. tof difference (ms): 12.0
Optimal airFriction: 0.00061188
Max. Velocity diff (m/s): 20.18
Max. Drop diff (cm): 2.7
Max. Tof diff (ms): 11.5
Optimal airFriction: 0.00063027
##########################################
Ammo Class: ACE_762x67_Ball_Berger_Hybrid_OTM
MaxRanges (m): [900, 1000, 1000]
MuzzleVelocities (m/s): [800, 853, 884]
Max. velocity difference (m/s): 19.65
Max. drop difference (cm): 8.25
Max. tof difference (ms): 16.0
Optimal airFriction: 0.00053733
Max. Velocity diff (m/s): 19.94
Max. Drop diff (cm): 8.04
Max. Tof diff (ms): 16.0
Optimal airFriction: 0.00055262
##########################################
Ammo Class: B_762x54_Ball
MaxRanges (m): [500, 800, 800]
MuzzleVelocities (m/s): [700, 820, 833]
Max. velocity difference (m/s): 14.61
Max. drop difference (cm): 5.74
Max. tof difference (ms): 15.0
Optimal airFriction: 0.00100023
Max. Velocity diff (m/s): 13.84
Max. Drop diff (cm): 5.42
Max. Tof diff (ms): 12.5
Optimal airFriction: 0.00102329
##########################################
Ammo Class: ACE_762x35_Ball
MaxRanges (m): [400, 500]
MuzzleVelocities (m/s): [620, 675]
Max. velocity difference (m/s): 4.17
Max. drop difference (cm): 1.71
Max. tof difference (ms): 4.0
Optimal airFriction: 0.00128942
Max. Velocity diff (m/s): 3.68
Max. Drop diff (cm): 1.54
Max. Tof diff (ms): 3.5
Optimal airFriction: 0.00131689
##########################################
Ammo Class: ACE_762x39_Ball
MaxRanges (m): [400, 600]
MuzzleVelocities (m/s): [650, 750]
Max. velocity difference (m/s): 13.0
Max. drop difference (cm): 3.78
Max. tof difference (ms): 8.0
Optimal airFriction: 0.00151621
Max. Velocity diff (m/s): 15.54
Max. Drop diff (cm): 3.92
Max. Tof diff (ms): 8.5
Optimal airFriction: 0.00154815
##########################################
Ammo Class: ACE_762x54_Ball_7T2
MaxRanges (m): [500, 800, 800]
MuzzleVelocities (m/s): [680, 750, 800]
Max. velocity difference (m/s): 9.79
Max. drop difference (cm): 7.89
Max. tof difference (ms): 11.0
Optimal airFriction: 0.00103989
Max. Velocity diff (m/s): 9.37
Max. Drop diff (cm): 7.72
Max. Tof diff (ms): 9.5
Optimal airFriction: 0.00106104
##########################################
Ammo Class: ACE_303_Ball
MaxRanges (m): [900, 1000]
MuzzleVelocities (m/s): [748, 765]
Max. velocity difference (m/s): 7.24
Max. drop difference (cm): 5.65
Max. tof difference (ms): 11.0
Optimal airFriction: 0.0008349
Max. Velocity diff (m/s): 6.94
Max. Drop diff (cm): 5.32
Max. Tof diff (ms): 10.5
Optimal airFriction: 0.00085117
##########################################
Ammo Class: B_93x64_Ball
MaxRanges (m): [900, 1000]
MuzzleVelocities (m/s): [850, 880]
Max. velocity difference (m/s): 11.18
Max. drop difference (cm): 9.08
Max. tof difference (ms): 15.0
Optimal airFriction: 0.00108571
Max. Velocity diff (m/s): 12.89
Max. Drop diff (cm): 8.75
Max. Tof diff (ms): 13.5
Optimal airFriction: 0.00110727
##########################################
Ammo Class: B_408_Ball
MaxRanges (m): [1600, 1600]
MuzzleVelocities (m/s): [862, 872]
Max. velocity difference (m/s): 28.15
Max. drop difference (cm): 15.97
Max. tof difference (ms): 77.0
Optimal airFriction: 0.00044958
Max. Velocity diff (m/s): 29.95
Max. Drop diff (cm): 17.04
Max. Tof diff (ms): 41.5
Optimal airFriction: 0.00046249
##########################################
Ammo Class: ACE_408_Ball
MaxRanges (m): [1200, 1200]
MuzzleVelocities (m/s): [1057, 1067]
Max. velocity difference (m/s): 37.45
Max. drop difference (cm): 7.45
Max. tof difference (ms): 56.0
Optimal airFriction: 0.00063655
Max. Velocity diff (m/s): 39.19
Max. Drop diff (cm): 7.92
Max. Tof diff (ms): 30.0
Optimal airFriction: 0.00065414
##########################################
Ammo Class: ACE_106x83mm_Ball
MaxRanges (m): [1400, 1400]
MaxRanges (m): [1500, 1500]
MuzzleVelocities (m/s): [955, 965]
Max. velocity difference (m/s): 23.44
Max. drop difference (cm): 8.93
Max. tof difference (ms): 25.0
Optimal airFriction: 0.00052047
Max. Velocity diff (m/s): 23.14
Max. Drop diff (cm): 12.44
Max. Tof diff (ms): 31.5
Optimal airFriction: 0.0005354
##########################################
Ammo Class: B_338_Ball
MaxRanges (m): [1100, 1300]
MuzzleVelocities (m/s): [880, 925]
Max. velocity difference (m/s): 31.95
Max. drop difference (cm): 9.97
Max. tof difference (ms): 33.0
Optimal airFriction: 0.00059133
Max. Velocity diff (m/s): 33.76
Max. Drop diff (cm): 10.17
Max. Tof diff (ms): 35.0
Optimal airFriction: 0.00060841
##########################################
Ammo Class: B_338_NM_Ball
MaxRanges (m): [1100, 1300]
MuzzleVelocities (m/s): [790, 820]
Max. velocity difference (m/s): 24.5
Max. drop difference (cm): 8.87
Max. tof difference (ms): 27.0
Optimal airFriction: 0.00052201
Max. Velocity diff (m/s): 26.43
Max. Drop diff (cm): 9.16
Max. Tof diff (ms): 30.0
Optimal airFriction: 0.00053639
##########################################
Ammo Class: ACE_338_Ball
MaxRanges (m): [1200, 1300]
MuzzleVelocities (m/s): [800, 830]
Max. velocity difference (m/s): 23.06
Max. drop difference (cm): 11.27
Max. tof difference (ms): 25.0
Optimal airFriction: 0.0005219
Max. Velocity diff (m/s): 24.93
Max. Drop diff (cm): 10.92
Max. Tof diff (ms): 27.0
Optimal airFriction: 0.00053585
##########################################
Ammo Class: ACE_338_Ball_API526
MaxRanges (m): [1200, 1300]
MuzzleVelocities (m/s): [880, 920]
Max. velocity difference (m/s): 17.05
Max. drop difference (cm): 14.52
Max. tof difference (ms): 29.0
Optimal airFriction: 0.00069611
Max. Velocity diff (m/s): 36.03
Max. Drop diff (cm): 18.88
Max. Tof diff (ms): 46.0
Optimal airFriction: 0.0006922
##########################################
Ammo Class: B_50BW_Ball_F
MaxRanges (m): [300, 400]
MuzzleVelocities (m/s): [510, 596]
Max. velocity difference (m/s): 29.6
Max. drop difference (cm): 2.19
Max. tof difference (ms): 18.0
Optimal airFriction: 0.00202645
Max. Velocity diff (m/s): 30.87
Max. Drop diff (cm): 2.32
Max. Tof diff (ms): 19.0
Optimal airFriction: 0.00205896
##########################################
Ammo Class: B_127x99_Ball
MaxRanges (m): [1300, 1300]
MuzzleVelocities (m/s): [895, 905]
Max. velocity difference (m/s): 19.44
Max. drop difference (cm): 9.36
Max. tof difference (ms): 24.0
Optimal airFriction: 0.00057503
Max. Velocity diff (m/s): 19.23
Max. Drop diff (cm): 9.4
Max. Tof diff (ms): 25.0
Optimal airFriction: 0.00058679
##########################################
Ammo Class: ACE_127x99_Ball_AMAX
MaxRanges (m): [1600, 1600]
MuzzleVelocities (m/s): [855, 865]
Max. velocity difference (m/s): 16.61
Max. drop difference (cm): 9.1
Max. tof difference (ms): 20.0
Optimal airFriction: 0.00036645
Max. Velocity diff (m/s): 16.89
Max. Drop diff (cm): 8.95
Max. Tof diff (ms): 21.0
Optimal airFriction: 0.00037397
##########################################
Ammo Class: B_127x108_Ball
MaxRanges (m): [1300, 1300]
MuzzleVelocities (m/s): [815, 825]
Max. velocity difference (m/s): 10.66
Max. drop difference (cm): 11.74
Max. tof difference (ms): 22.0
Optimal airFriction: 0.000638
Max. Velocity diff (m/s): 10.11
Max. Drop diff (cm): 11.57
Max. Tof diff (ms): 21.0
Optimal airFriction: 0.00065098
##########################################
Ammo Class: ACE_762x51_Ball_Subsonic
MaxRanges (m): [200, 300]
MuzzleVelocities (m/s): [305, 340]
Max. velocity difference (m/s): 7.92
Max. drop difference (cm): 3.77
Max. tof difference (ms): 9.0
Optimal airFriction: 0.00049899
Max. Velocity diff (m/s): 11.63
Max. Drop diff (cm): 6.03
Max. Tof diff (ms): 14.0
Optimal airFriction: 0.00060194
##########################################
Ammo Class: B_9x21_Ball
MaxRanges (m): [200, 300]
MuzzleVelocities (m/s): [380, 420]
Max. velocity difference (m/s): 34.77
Max. drop difference (cm): 4.7
Max. tof difference (ms): 31.0
Optimal airFriction: 0.00208292
Max. Velocity diff (m/s): 35.22
Max. Drop diff (cm): 4.66
Max. Tof diff (ms): 32.5
Optimal airFriction: 0.00211064
##########################################
Ammo Class: ACE_9x18_Ball_57N181S
MaxRanges (m): [100, 200, 200]
MuzzleVelocities (m/s): [298, 330, 350]
Max. velocity difference (m/s): 18.03
Max. drop difference (cm): 4.41
Max. tof difference (ms): 17.0
Optimal airFriction: 0.00190333
Max. Velocity diff (m/s): 17.52
Max. Drop diff (cm): 4.38
Max. Tof diff (ms): 16.5
Optimal airFriction: 0.0019192
##########################################
Ammo Class: ACE_9x19_Ball
MaxRanges (m): [100, 200, 200]
MuzzleVelocities (m/s): [340, 370, 400]
Max. velocity difference (m/s): 23.95
Max. drop difference (cm): 3.75
Max. tof difference (ms): 17.0
Optimal airFriction: 0.0019835
Max. Velocity diff (m/s): 24.28
Max. Drop diff (cm): 3.82
Max. Tof diff (ms): 17.5
Optimal airFriction: 0.00201185
##########################################
Ammo Class: ACE_10x25_Ball
MaxRanges (m): [200, 300, 300]
MuzzleVelocities (m/s): [360, 400, 430]
Max. velocity difference (m/s): 32.8
Max. drop difference (cm): 8.8
Max. tof difference (ms): 34.0
Optimal airFriction: 0.00181928
Max. Velocity diff (m/s): 33.1
Max. Drop diff (cm): 8.72
Max. Tof diff (ms): 34.5
Optimal airFriction: 0.00184252
##########################################
Ammo Class: ACE_765x17_Ball
MaxRanges (m): [100, 200, 200]
MuzzleVelocities (m/s): [282, 300, 320]
Max. velocity difference (m/s): 11.18
Max. drop difference (cm): 4.3
Max. tof difference (ms): 13.0
Optimal airFriction: 0.00163356
Max. Velocity diff (m/s): 10.61
Max. Drop diff (cm): 4.08
Max. Tof diff (ms): 12.5
Optimal airFriction: 0.00165214
##########################################
Ammo Class: B_127x54_Ball
MaxRanges (m): [500, 500]
MuzzleVelocities (m/s): [295, 305]
Max. velocity difference (m/s): 2.28
Max. drop difference (cm): 4.52
Max. tof difference (ms): 5.0
Optimal airFriction: 0.00019268
Max. Velocity diff (m/s): 2.24
Max. Drop diff (cm): 4.31
Max. Tof diff (ms): 5.0
Optimal airFriction: 0.00019568
##########################################
Ammo Class: B_45ACP_Ball
MaxRanges (m): [100, 200, 200]
MuzzleVelocities (m/s): [230, 250, 285]
Max. velocity difference (m/s): 3.5
Max. drop difference (cm): 2.99
Max. tof difference (ms): 6.0
Optimal airFriction: 0.00081221
Max. Velocity diff (m/s): 2.9
Max. Drop diff (cm): 2.87
Max. Tof diff (ms): 5.5
Optimal airFriction: 0.00082143