mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
043b3907fe
Co-authored-by: Pepijn Holster <pgaholster@gmail.com> Co-authored-by: PabstMirror <pabstmirror@gmail.com> Co-authored-by: LorenLuke <LukeLLL@aol.com> Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
29 lines
790 B
Plaintext
29 lines
790 B
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: LorenLuke
|
|
* Calculates the muzzleVelocity change with advanced calculations.
|
|
*
|
|
* Arguments:
|
|
* 0: Initial Muzzle velocity; meters/second <NUMBER>
|
|
* 1: Temperature; degrees Celsius <NUMBER>
|
|
* 2: Atmospheric Density; kg/(meters^3) <NUMBER>
|
|
*
|
|
* Return Value:
|
|
* Adjusted Muzzle Velocity; Meters <NUMBER>
|
|
*
|
|
* Example:
|
|
* [200, 15, 1.225] call ace_artilleryTables_fnc_calculateMuzzleVelocity
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_muzzleVelocity", "_temperature", "_airDensity"];
|
|
|
|
// Calculate air density
|
|
private _relativeDensity = _airDensity / 1.225;
|
|
private _newMuzzleVelocityCoefficient = (((_temperature + 273.13) / 288.13 - 1) / 40 + 1);
|
|
|
|
private _newMuzzleVelocity = _muzzleVelocity * _newMuzzleVelocityCoefficient;
|
|
|
|
_newMuzzleVelocity
|