Update Heating / Cooling physics numbers

Attempting to update numbers based on real physics.
Effects will increase heat generated per shot and decrease cooling
- ~1.333x increased heating
- ~1.45x less cooling
This commit is contained in:
PabstMirror 2015-12-28 21:01:56 -06:00
parent 415402b5ad
commit 462e37e6d1
2 changed files with 13 additions and 3 deletions

View File

@ -31,7 +31,10 @@ if (_bulletMass == 0) then {
// If the bullet mass is not configured, estimate it
_bulletMass = 3.4334 + 0.5171 * (getNumber (configFile >> "CfgAmmo" >> _ammo >> "hit") + getNumber (configFile >> "CfgAmmo" >> _ammo >> "caliber"));
};
private _energyIncrement = 3 * 0.000375 * _bulletMass * (vectorMagnitudeSqr velocity _projectile);
//https://en.wikipedia.org/wiki/Physics_of_firearms - Projectile motion is roughly equal to Barrel heat
//Muzzle Engergy = 1/2 * m * v^2 (1/2 * 0.001 g/kg * bulletMass (grams) * v^2)
//Multiple by 3 becase we only calc every 3rd bullet: (3 * 1/2 * 0.001) = 0.0015
private _energyIncrement = 0.0015 * _bulletMass * (vectorMagnitudeSqr velocity _projectile);
TRACE_2("heat",_bulletMass,_energyIncrement);

View File

@ -30,12 +30,19 @@ private _barrelMass = 0.50 * (getNumber (configFile >> "CfgWeapons" >> _weapon >
_fnc_cooling = {
params ["_temperature", "_barrelMass", "_totalTime"];
TRACE_3("cooling",_temperature,_barrelMass,_totalTime);
// If a long time passed since the last shot, there's no need to calculate anything; the weapon should be cool
if (_totalTime > 1800) exitWith {0};
private _barrelSurface = _barrelMass / 7850 / 0.003;
//AR-15 (0.00570m bullet diameter) (barrel diameter usually 0.75" or 0.008255m radius)
//Steel Denisty = 7850 m^3 / kg
//Area of a cylinder (2/r)*(Pi * r^3 + V) - for a 0.008255m radius barrel -> Area = 210(1/meters) * Volume
//Adjusted volume for being hollowed out is ~1.1x
//So Area = 210 * 1.1 * (mass / 7850) = mass * 0.029427 (for steel near that diameter)
private _barrelSurface = _barrelMass * 0.029427;
TRACE_4("cooling",_temperature,_totalTime,_barrelMass,_barrelSurface);
private _time = 0;
while {true} do {