mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
AB and Kestrel: Move macros from defines.h to script_component
This commit is contained in:
parent
57c526c04d
commit
c827c72412
@ -1,11 +0,0 @@
|
||||
#define GRAVITY 9.80665
|
||||
#define ABSOLUTE_ZERO_IN_CELSIUS -273.15
|
||||
#define KELVIN(t) (t - ABSOLUTE_ZERO_IN_CELSIUS)
|
||||
#define CELSIUS(t) (t + ABSOLUTE_ZERO_IN_CELSIUS)
|
||||
#define UNIVERSAL_GAS_CONSTANT 8.314
|
||||
#define WATER_VAPOR_MOLAR_MASS 0.018016
|
||||
#define DRY_AIR_MOLAR_MASS 0.028964
|
||||
#define SPECIFIC_GAS_CONSTANT_DRY_AIR 287.058
|
||||
#define STD_AIR_DENSITY_ICAO 1.22498
|
||||
#define STD_AIR_DENSITY_ASM 1.20885
|
||||
#define GET_TEMPERATURE_AT_HEIGHT(h) (EGVAR(weather,currentTemperature) - 0.0065 * (h))
|
@ -15,7 +15,6 @@
|
||||
* None
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "defines.h"
|
||||
|
||||
private ["_temperature", "_pressure", "_relativeHumidity"];
|
||||
_temperature = _this select 0; // in C
|
||||
@ -30,7 +29,7 @@ if (_relativeHumidity > 0) then {
|
||||
_pSat = 6.1078 * 10 ^ ((7.5 * _temperature) / (_temperature + 237.3));
|
||||
_vaporPressure = _relativeHumidity * _pSat;
|
||||
_partialPressure = _pressure - _vaporPressure;
|
||||
|
||||
|
||||
(_partialPressure * DRY_AIR_MOLAR_MASS + _vaporPressure * WATER_VAPOR_MOLAR_MASS) / (UNIVERSAL_GAS_CONSTANT * KELVIN(_temperature))
|
||||
} else {
|
||||
_pressure / (SPECIFIC_GAS_CONSTANT_DRY_AIR * KELVIN(_temperature))
|
||||
|
@ -16,7 +16,6 @@
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "defines.h"
|
||||
|
||||
private ["_ballisticCoefficient", "_temperature", "_pressure", "_relativeHumidity", "_atmosphereModel", "_airDensity"];
|
||||
_ballisticCoefficient = _this select 0;
|
||||
|
@ -18,7 +18,6 @@
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "defines.h"
|
||||
|
||||
private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_abort", "_index", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_atmosphereModel", "_bulletMass", "_bulletLength", "_bulletTranslation", "_airFriction", "_dragModel", "_velocityBoundaryData", "_muzzleVelocity", "_muzzleVelocityCoef", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_bulletWeight", "_barrelTwist", "_twistDirection", "_stabilityFactor", "_transonicStabilityCoef", "_ACE_Elevation", "_ACE_Windage", "_ID"];
|
||||
_unit = _this select 0;
|
||||
@ -153,17 +152,17 @@ if (GVAR(AdvancedAirDragEnabled)) then {
|
||||
|
||||
#ifdef USE_ADVANCEDBALLISTICS_DLL
|
||||
GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000;
|
||||
|
||||
|
||||
"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 _bullet, EGVAR(weather,Latitude), EGVAR(weather,currentTemperature), EGVAR(weather,Altitude), EGVAR(weather,currentHumidity), overcast, floor(time), time - floor(time)];
|
||||
|
||||
|
||||
[{
|
||||
private ["_index", "_bullet", "_caliber", "_bulletTraceVisible", "_bulletVelocity", "_bulletPosition"];
|
||||
EXPLODE_4_PVT(_this select 0,_bullet,_caliber,_bulletTraceVisible,_index);
|
||||
|
||||
|
||||
if (!alive _bullet) exitWith {
|
||||
[_this select 1] call cba_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
|
||||
_bulletVelocity = velocity _bullet;
|
||||
_bulletPosition = getPosASL _bullet;
|
||||
|
||||
|
@ -11,4 +11,16 @@
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_ADVANCEDBALLISTICS
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
#define GRAVITY 9.80665
|
||||
#define ABSOLUTE_ZERO_IN_CELSIUS -273.15
|
||||
#define KELVIN(t) (t - ABSOLUTE_ZERO_IN_CELSIUS)
|
||||
#define CELSIUS(t) (t + ABSOLUTE_ZERO_IN_CELSIUS)
|
||||
#define UNIVERSAL_GAS_CONSTANT 8.314
|
||||
#define WATER_VAPOR_MOLAR_MASS 0.018016
|
||||
#define DRY_AIR_MOLAR_MASS 0.028964
|
||||
#define SPECIFIC_GAS_CONSTANT_DRY_AIR 287.058
|
||||
#define STD_AIR_DENSITY_ICAO 1.22498
|
||||
#define STD_AIR_DENSITY_ASM 1.20885
|
||||
#define GET_TEMPERATURE_AT_HEIGHT(h) (EGVAR(weather,currentTemperature) - 0.0065 * (h))
|
||||
|
@ -1 +0,0 @@
|
||||
#define GET_TEMPERATURE_AT_HEIGHT(h) (EGVAR(weather,currentTemperature) - 0.0065 * (h))
|
@ -13,7 +13,6 @@
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "defines.h"
|
||||
|
||||
private ["_playerDir", "_windSpeed", "_windDir", "_crosswind", "_headwind", "_humidity", "_temperature", "_humidity", "_barometricPressure", "_altitude"];
|
||||
|
||||
@ -40,7 +39,7 @@ if (GVAR(MinAvgMaxMode) == 1) then {
|
||||
{
|
||||
GVAR(ENTRIES) set [_x, (GVAR(ENTRIES) select _x) + 1];
|
||||
} forEach [1, 2, 3];
|
||||
|
||||
|
||||
// Wind SPD
|
||||
_windSpeed = call FUNC(measureWindSpeed);
|
||||
GVAR(MIN) set [1, (GVAR(MIN) select 1) min abs(_windSpeed)];
|
||||
|
@ -13,7 +13,6 @@
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "defines.h"
|
||||
|
||||
private ["_playerDir", "_textTop", "_textCenterBig", "_textCenterLine1Left", "_textCenterLine2Left", "_textCenterLine3Left", "_textCenterLine1Right", "_textCenterLine2Right", "_textCenterLine3Right", "_textInfoLine1", "_textInfoLine2", "_temperature", "_humidity", "_windSpeed", "_windDir", "_newWindSpeed", "_windSource", "_height"];
|
||||
|
||||
@ -57,7 +56,7 @@ switch (GVAR(Menu)) do {
|
||||
_textCenterLine3Left = "Max";
|
||||
_textCenterLine1Right = "N/A";
|
||||
_textCenterLine2Right = "N/A";
|
||||
_textCenterLine3Right = "N/A";
|
||||
_textCenterLine3Right = "N/A";
|
||||
};
|
||||
};
|
||||
case 1: { // Wind SPD
|
||||
|
@ -13,7 +13,6 @@
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "defines.h"
|
||||
|
||||
private ["_playerDir", "_windSpeed", "_windDir"];
|
||||
|
||||
|
@ -9,4 +9,6 @@
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_KESTREL4500
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
#define GET_TEMPERATURE_AT_HEIGHT(h) (EGVAR(weather,currentTemperature) - 0.0065 * (h))
|
||||
|
Loading…
Reference in New Issue
Block a user