Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes bugs in the new (macro based) mrad/moa conversion #5731

Merged
merged 2 commits into from
Nov 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions addons/atragmx/functions/fnc_calculate_truing_drop.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ if (_parseInput) then {
};
switch (_dropUnit) do {
case 0: {
_transonicDrop = MOA_TO_MRAD(_transonicDrop);
_subsonicDrop = MOA_TO_MRAD(_subsonicDrop);
_transonicDrop = MRAD_TO_MOA(_transonicDrop);
_subsonicDrop = MRAD_TO_MOA(_subsonicDrop);
};
case 2: {
_transonicDrop = _transonicDrop / 1.047;
Expand Down
7 changes: 0 additions & 7 deletions addons/atragmx/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,4 @@

#include "\z\ace\addons\main\script_macros.hpp"

#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
#define DEG_TO_MOA(d) (d * 60) // Conversion factor: 60
#define MOA_TO_DEG(d) (d / 60) // Conversion factor: 1 / 60
#define DEG_TO_MRAD(d) (d * 17.45329252) // Conversion factor: (50 * PI) / 9
#define MRAD_TO_DEG(d) (d / 17.45329252) // Conversion factor: 9 / (50 * PI)

#define ATRAGMX_PROFILE_NAMESPACE_VERSION 2.2
2 changes: 0 additions & 2 deletions addons/ballistics/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@
#endif

#include "\z\ace\addons\main\script_macros.hpp"

#define MOA_TO_RAD(d) (d * 0.00029088) // Conversion factor: PI / 10800
9 changes: 9 additions & 0 deletions addons/main/script_macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,13 @@
#define TRACE_10(MESSAGE,A,B,C,D,E,F,G,H,I,J) /* disabled */
#endif

// 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
#define DEG_TO_MOA(d) ((d) * 60) // Conversion factor: 60
#define MOA_TO_DEG(d) ((d) / 60) // Conversion factor: 1 / 60
#define DEG_TO_MRAD(d) ((d) * 17.45329252) // Conversion factor: (50 * PI) / 9
#define MRAD_TO_DEG(d) ((d) / 17.45329252) // Conversion factor: 9 / (50 * PI)
#define MOA_TO_RAD(d) ((d) * 0.00029088) // Conversion factor: PI / 10800

#include "script_debug.hpp"
7 changes: 0 additions & 7 deletions addons/rangecard/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,3 @@
#endif

#include "\z\ace\addons\main\script_macros.hpp"

#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
#define DEG_TO_MOA(d) (d * 60) // Conversion factor: 60
#define MOA_TO_DEG(d) (d / 60) // Conversion factor: 1 / 60
#define DEG_TO_MRAD(d) (d * 17.45329252) // Conversion factor: (50 * PI) / 9
#define MRAD_TO_DEG(d) (d / 17.45329252) // Conversion factor: 9 / (50 * PI)
2 changes: 0 additions & 2 deletions addons/scopes/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,4 @@
#define DEBUG_SETTINGS DEBUG_SETTINGS_SCOPES
#endif

#define MRAD_TO_DEG(d) (d / 17.45329252) // Conversion factor: 9 / (50 * PI)

#include "\z\ace\addons\main\script_macros.hpp"