mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Gravity correction
* ArmA is using 9.8066
This commit is contained in:
parent
1997edb62e
commit
fb0a60b018
@ -16,7 +16,6 @@
|
||||
|
||||
#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)
|
||||
|
@ -58,7 +58,7 @@ private _bulletPos = [0, 0, 0];
|
||||
private _bulletVelocity = [0, 0, 0];
|
||||
private _bulletAccel = [0, 0, 0];
|
||||
private _bulletSpeed = 0;
|
||||
private _gravity = [0, sin(_scopeBaseAngle + _inclinationAngle) * -9.80665, cos(_scopeBaseAngle + _inclinationAngle) * -9.80665];
|
||||
private _gravity = [0, sin(_scopeBaseAngle + _inclinationAngle) * -GRAVITY, cos(_scopeBaseAngle + _inclinationAngle) * -GRAVITY];
|
||||
private _deltaT = 1 / _simSteps;
|
||||
|
||||
private _elevation = 0;
|
||||
@ -95,7 +95,7 @@ if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) t
|
||||
|
||||
private _eoetvoesMultiplier = 0;
|
||||
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
|
||||
_eoetvoesMultiplier = 2 * (0.0000729 * _muzzleVelocity / -9.80665) * cos(_latitude) * sin(_directionOfFire);
|
||||
_eoetvoesMultiplier = 2 * (0.0000729 * _muzzleVelocity / -GRAVITY) * cos(_latitude) * sin(_directionOfFire);
|
||||
};
|
||||
|
||||
_bulletPos set [0, 0];
|
||||
|
@ -109,6 +109,8 @@
|
||||
#define TRACE_10(MESSAGE,A,B,C,D,E,F,G,H,I,J) /* disabled */
|
||||
#endif
|
||||
|
||||
#define GRAVITY 9.8066
|
||||
|
||||
// Angular unit conversion
|
||||
#define MRAD_TO_MOA(d) ((d) * 3.43774677) // Conversion factor: 54 / (5 * PI)
|
||||
#define MOA_TO_MRAD(d) ((d) * 0.29088821) // Conversion factor: (5 * PI) / 54
|
||||
|
@ -46,7 +46,7 @@ private _bulletPos = [0, 0, 0];
|
||||
private _bulletVelocity = [0, 0, 0];
|
||||
private _bulletAccel = [0, 0, 0];
|
||||
private _bulletSpeed = 0;
|
||||
private _gravity = [0, sin(_scopeBaseAngle) * -9.80665, cos(_scopeBaseAngle) * -9.80665];
|
||||
private _gravity = [0, sin(_scopeBaseAngle) * -GRAVITY, cos(_scopeBaseAngle) * -GRAVITY];
|
||||
private _deltaT = 1 / _simSteps;
|
||||
private _speedOfSound = 0;
|
||||
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
|
||||
|
@ -1 +1 @@
|
||||
#include "\z\ace\addons\rangecard\script_component.hpp"
|
||||
#include "\z\ace\addons\rangecard\script_component.hpp"
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#define DT_ZERO 0.02
|
||||
#define DT_SIMULATION 0.005
|
||||
#define GRAVITY 9.80665f
|
||||
#define GRAVITY 9.8066f
|
||||
#define DEGREES(X) (X * 180 / M_PI)
|
||||
#define ABSOLUTE_ZERO_IN_CELSIUS -273.15f
|
||||
#define KELVIN(t) (t - ABSOLUTE_ZERO_IN_CELSIUS)
|
||||
|
@ -61,7 +61,7 @@ double traceBullet(double initSpeed, double airFriction, double angle, double an
|
||||
posX += velX * simulationStep * 0.5;
|
||||
posY += velY * simulationStep * 0.5;
|
||||
velX += simulationStep * (velX * velMag * airFriction);
|
||||
velY += simulationStep * (velY * velMag * airFriction - 9.80665);
|
||||
velY += simulationStep * (velY * velMag * airFriction - 9.8066);
|
||||
posX += velX * simulationStep * 0.5;
|
||||
posY += velY * simulationStep * 0.5;
|
||||
if (posX >= posTargetX) { break; }
|
||||
|
Loading…
Reference in New Issue
Block a user