From c9ad2b279dadf55993cea3e3369be6504ca90dc7 Mon Sep 17 00:00:00 2001 From: ulteq Date: Tue, 7 Apr 2015 21:46:43 +0200 Subject: [PATCH] Commented all advanced ballistics functions --- .../functions/fnc_calculateAirDensity.sqf | 16 +++++++++++++++ ..._calculateAmmoTemperatureVelocityShift.sqf | 15 ++++++++++++++ .../fnc_calculateAtmosphericCorrection.sqf | 17 ++++++++++++++++ ...fnc_calculateBarrelLengthVelocityShift.sqf | 16 +++++++++++++++ .../fnc_calculateHellmannExponent.sqf | 13 ++++++++++++ .../functions/fnc_calculateRetardation.sqf | 16 +++++++++++++++ .../fnc_calculateRoughnessLength.sqf | 13 ++++++++++++ .../fnc_calculateStabilityFactor.sqf | 20 +++++++++++++++++++ .../functions/fnc_calculateWindSpeed.sqf | 13 ++++++++++++ .../functions/fnc_displayProtractor.sqf | 11 ++++++++++ .../functions/fnc_handleFired.sqf | 6 ++---- .../weather/functions/fnc_displayWindInfo.sqf | 11 ++++++++++ 12 files changed, 163 insertions(+), 4 deletions(-) diff --git a/addons/advanced_ballistics/functions/fnc_calculateAirDensity.sqf b/addons/advanced_ballistics/functions/fnc_calculateAirDensity.sqf index 723d7a0e52..27ac3d368f 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAirDensity.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAirDensity.sqf @@ -1,3 +1,19 @@ +/* + * Author: Ruthberg + * + * Displays a wind info (colored arrow) in the top left corner of the screen + * + * Arguments: + * 0: temperature - degrees celcius + * 1: pressure - hPa + * 2: relativeHumidity - value between 0.0 and 1.0 + * + * Return Value: + * 0: density of air - kg * m^(-3) + * + * Return value: + * None + */ #include "script_component.hpp" #include "defines.h" diff --git a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf index 8a586760cd..ae9bd9f60e 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf @@ -1,3 +1,18 @@ +/* + * Author: Ruthberg + * + * Calculates the ammo temperature induced muzzle velocity shift + * + * Arguments: + * 0: ammo - classname + * 1: temperature - degrees celcius + * + * Return Value: + * 0: muzzle velocity shift - m/s + * + * Return value: + * None + */ #include "script_component.hpp" private ["_ammo", "_temperature", "_muzzleVelocityTable", "_muzzleVelocityShift", "_temperatureIndexA", "_temperatureIndexB", "_temperatureRatio"]; diff --git a/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf b/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf index 800fa2cd81..cdf762f4cf 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf @@ -1,3 +1,20 @@ +/* + * Author: Ruthberg + * + * Calculates the atmospherically corrected ballistic coefficient + * + * Arguments: + * 0: ballistic coefficient - G1-G7 + * 1: temperature - degrees celcius + * 2: pressure - hPa + * 3: relativeHumidity - value between 0.0 and 1.0 + * 4: atmosphereModel - ICAO or ASM + * + * Return Value: + * corrected ballistic coefficient + * + * Public: No + */ #include "script_component.hpp" #include "defines.h" diff --git a/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf b/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf index a24dd3d3cc..ef3a84ad59 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf @@ -1,3 +1,19 @@ +/* + * Author: Ruthberg + * + * Calculates the muzzle velocity shift caused by different barrel lengths + * + * Arguments: + * 0: ammo - classname + * 0: weapon - classname + * 1: muzzle velocity - m/s + * + * Return Value: + * 0: muzzle velocity shift - m/s + * + * Return value: + * None + */ #include "script_component.hpp" private ["_ammo", "_weapon", "_barrelLength", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocity", "_lowerIndex", "_upperIndex", "_barrelLengthRatio", "_muzzleVelocityNew"]; diff --git a/addons/advanced_ballistics/functions/fnc_calculateHellmannExponent.sqf b/addons/advanced_ballistics/functions/fnc_calculateHellmannExponent.sqf index e319272a0e..7e5cb51d7f 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateHellmannExponent.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateHellmannExponent.sqf @@ -1,3 +1,16 @@ +/* + * Author: Ruthberg + * + * Calculates the terrain hellmann exponent at a given world position + * + * Arguments: + * 0: _this - world position + * + * Return Value: + * 0: hellmann exponent + * + * Public: No + */ #include "script_component.hpp" private ["_hellmann_exponents", "_hellmann_index", "_windSource", "_nearObjects", "_isWater"]; diff --git a/addons/advanced_ballistics/functions/fnc_calculateRetardation.sqf b/addons/advanced_ballistics/functions/fnc_calculateRetardation.sqf index 338ec89cd2..b3db918db7 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateRetardation.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateRetardation.sqf @@ -1,3 +1,19 @@ +/* + * Author: Ruthberg + * + * Calculates the retardation of the bullet + * + * Arguments: + * 0: drag model - 1-7 + * 1: drag coefficient - bc + * 2: velocity - m/s + * + * Return Value: + * 0: retardation - m/(s^2) + * + * Return value: + * None + */ #include "script_component.hpp" // Source: GNU Exterior Ballistics diff --git a/addons/advanced_ballistics/functions/fnc_calculateRoughnessLength.sqf b/addons/advanced_ballistics/functions/fnc_calculateRoughnessLength.sqf index f2865a1526..6dde210cdd 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateRoughnessLength.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateRoughnessLength.sqf @@ -1,3 +1,16 @@ +/* + * Author: Ruthberg + * + * Calculates the terrain roughness length at a given world position + * + * Arguments: + * 0: _this - world position + * + * Return Value: + * 0: roughness length + * + * Public: No + */ #include "script_component.hpp" private ["_roughness_lengths", "_windSource", "_nearBuildings", "_isWater"]; diff --git a/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf b/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf index 1f524b85ca..f9b92e0d5b 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf @@ -1,3 +1,23 @@ +/* + * Author: Ruthberg + * + * Calculates the stability factor of a bullet + * + * Arguments: + * 0: caliber - inches + * 1: bullet length - inches + * 2: bullet mass - grains + * 3: barrel twist - inches + * 4: muzzle velocity shift - m/s + * 5: temperature - degrees celcius + * 6: barometric Pressure - hPA + * + * Return Value: + * 0: stability factor + * + * Public: No + */ + private ["_caliber", "_bulletLength", "_bulletMass", "_barrelTwist", "_muzzleVelocity", "_temperature", "_barometricPressure", "_l", "_t", "_stabilityFactor"]; _caliber = _this select 0; _bulletLength = _this select 1; diff --git a/addons/advanced_ballistics/functions/fnc_calculateWindSpeed.sqf b/addons/advanced_ballistics/functions/fnc_calculateWindSpeed.sqf index 8905d457a3..de2a0b64ab 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateWindSpeed.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateWindSpeed.sqf @@ -1,3 +1,16 @@ +/* + * Author: Ruthberg + * + * Calculates the true wind speed at a given world position + * + * Arguments: + * 0: _this - world position + * + * Return Value: + * 0: wind speed - m/s + * + * Public: No + */ #include "script_component.hpp" private ["_windSpeed", "_windDir", "_height", "_newWindSpeed", "_windSource", "_roughnessLength"]; diff --git a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf index 91218e7818..4449a89a28 100644 --- a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf +++ b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf @@ -1,3 +1,14 @@ +/* + * Author: Ruthberg + * + * Displays a protractor in the top left corner of the screen + * + * Argument: + * None + * + * Return value: + * None + */ #include "script_component.hpp" #define __dsp (uiNamespace getVariable "RscProtractor") diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index e4f7bb8b80..750cd67c18 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -1,6 +1,7 @@ /* * Author: Glowbal, Ruthberg - * Handles wind deflection for projectiles. + * + * Handles advanced ballistics for (BulletBase) projectiles * * Arguments: * 0: unit - Object the event handler is assigned to @@ -14,9 +15,6 @@ * Return Value: * Nothing * - * Example: - * [clientFiredBIS-XEH] call ace_winddeflection_fnc_handleFired - * * Public: No */ #include "script_component.hpp" diff --git a/addons/weather/functions/fnc_displayWindInfo.sqf b/addons/weather/functions/fnc_displayWindInfo.sqf index 894fc4b904..e32bd0e530 100644 --- a/addons/weather/functions/fnc_displayWindInfo.sqf +++ b/addons/weather/functions/fnc_displayWindInfo.sqf @@ -1,3 +1,14 @@ +/* + * Author: Ruthberg + * + * Displays a wind info (colored arrow) in the top left corner of the screen + * + * Argument: + * None + * + * Return value: + * None + */ #include "script_component.hpp" #define __dsp (uiNamespace getVariable "RscWindIntuitive")