mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'master' of github.com:KoffeinFlummi/ACE3
This commit is contained in:
commit
1b81a23da2
BIN
ace_fcs.dll
BIN
ace_fcs.dll
Binary file not shown.
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile"];
|
private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile","_velocityCorrection"];
|
||||||
|
|
||||||
_vehicle = _this select 0;
|
_vehicle = _this select 0;
|
||||||
_weapon = _this select 1;
|
_weapon = _this select 1;
|
||||||
@ -43,8 +43,12 @@ _offset = 0;
|
|||||||
};
|
};
|
||||||
} forEach _FCSMagazines;
|
} forEach _FCSMagazines;
|
||||||
|
|
||||||
[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, 0] call EFUNC(common,changeProjectileDirection);
|
// Correct velocity for weapons that have initVelocity
|
||||||
|
// @todo: Take into account negative initVelocities
|
||||||
|
_velocityCorrection = (vectorMagnitude velocity _projectile) -
|
||||||
|
getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
|
||||||
|
|
||||||
|
[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, _velocityCorrection] call EFUNC(common,changeProjectileDirection);
|
||||||
// Air burst missile
|
// Air burst missile
|
||||||
|
|
||||||
// handle locally only
|
// handle locally only
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// by commy2
|
// by commy2
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(lazeTarget), localize "STR_ACE_FCS_LaseTarget",
|
||||||
localize "STR_ACE_FCS_LaseTarget",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -9,7 +8,6 @@
|
|||||||
// Conditions: specific
|
// Conditions: specific
|
||||||
if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false};
|
if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false};
|
||||||
|
|
||||||
// prevent holding down
|
|
||||||
if (GETGVAR(isDownStateKey1,false)) exitWith {false};
|
if (GETGVAR(isDownStateKey1,false)) exitWith {false};
|
||||||
GVAR(isDownStateKey1) = true;
|
GVAR(isDownStateKey1) = true;
|
||||||
|
|
||||||
@ -18,13 +16,6 @@
|
|||||||
// Return false so it doesn't block the rest weapon action
|
// Return false so it doesn't block the rest weapon action
|
||||||
false
|
false
|
||||||
},
|
},
|
||||||
[15, [false, false, false]],
|
|
||||||
false,
|
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
|
||||||
localize "STR_ACE_FCS_LaseTarget",
|
|
||||||
{
|
{
|
||||||
// prevent holding down
|
// prevent holding down
|
||||||
GVAR(isDownStateKey1) = false;
|
GVAR(isDownStateKey1) = false;
|
||||||
@ -39,13 +30,9 @@
|
|||||||
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyUp);
|
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyUp);
|
||||||
false
|
false
|
||||||
},
|
},
|
||||||
[15, [false, false, false]],
|
[15, [false, false, false]], false] call cba_fnc_addKeybind; //Tab Key
|
||||||
false,
|
|
||||||
"keyup"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(adjustRangeUp), localize "STR_ACE_FCS_AdjustRangeUp",
|
||||||
localize "STR_ACE_FCS_AdjustRangeUp",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -57,13 +44,10 @@
|
|||||||
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), 50] call FUNC(adjustRange);
|
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), 50] call FUNC(adjustRange);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[201, [false, false, false]],
|
{false},
|
||||||
false,
|
[201, [false, false, false]], false] call cba_fnc_addKeybind; //PageUp Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(adjustRangDown), localize "STR_ACE_FCS_AdjustRangeDown",
|
||||||
localize "STR_ACE_FCS_AdjustRangeDown",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -75,7 +59,5 @@
|
|||||||
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -50] call FUNC(adjustRange);
|
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -50] call FUNC(adjustRange);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[209, [false, false, false]],
|
{false},
|
||||||
false,
|
[209, [false, false, false]], false] call cba_fnc_addKeybind; //PageDown Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
@ -17,14 +17,16 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
if (!hasInterface) exitWith {};
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
["ACE3", localize "STR_ACE_Goggles_WipeGlasses",
|
["ACE3", QGVAR(wipeGlasses), localize "STR_ACE_Goggles_WipeGlasses",
|
||||||
{
|
{
|
||||||
if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith {
|
if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith {
|
||||||
call FUNC(clearGlasses);
|
call FUNC(clearGlasses);
|
||||||
true
|
true
|
||||||
};
|
};
|
||||||
false
|
false
|
||||||
}, [20, true, true, false], false, "keydown"] call CALLSTACK(cba_fnc_registerKeybind);
|
},
|
||||||
|
{false},
|
||||||
|
[20, true, true, false], false] call CALLSTACK(cba_fnc_addKeybind);
|
||||||
|
|
||||||
if isNil(QGVAR(UsePP)) then {
|
if isNil(QGVAR(UsePP)) then {
|
||||||
GVAR(UsePP) = true;
|
GVAR(UsePP) = true;
|
||||||
|
@ -10,8 +10,7 @@ GVAR(flashbangPPEffectCC) = ppEffectCreate ["ColorCorrections", 4265];
|
|||||||
GVAR(flashbangPPEffectCC) ppEffectForceInNVG true;
|
GVAR(flashbangPPEffectCC) ppEffectForceInNVG true;
|
||||||
|
|
||||||
// Add keybinds
|
// Add keybinds
|
||||||
["ACE3",
|
["ACE3", QGVAR(switchGrenadeMode), localize "STR_ACE_Grenades_SwitchGrenadeMode",
|
||||||
localize "STR_ACE_Grenades_SwitchGrenadeMode",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [QEGVAR(captives,isNotEscorting)];
|
_exceptions = [QEGVAR(captives,isNotEscorting)];
|
||||||
@ -22,7 +21,5 @@ GVAR(flashbangPPEffectCC) ppEffectForceInNVG true;
|
|||||||
// Statement
|
// Statement
|
||||||
[] call FUNC(nextMode);
|
[] call FUNC(nextMode);
|
||||||
},
|
},
|
||||||
[9, [false, false, false]], //8 key
|
{false},
|
||||||
false,
|
[9, [false, false, false]], false] call cba_fnc_addKeybind; //8 Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
@ -6,30 +6,12 @@ _fnc = {
|
|||||||
};
|
};
|
||||||
addMissionEventHandler ["Draw3D", _fnc];
|
addMissionEventHandler ["Draw3D", _fnc];
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(InteractKey), "Interact Key",
|
||||||
"Interact Key",
|
|
||||||
{_this call FUNC(keyDown)},
|
{_this call FUNC(keyDown)},
|
||||||
[219, [false, false, false]],
|
|
||||||
false,
|
|
||||||
"keydown"] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
|
||||||
"Interact Key",
|
|
||||||
{_this call FUNC(keyUp)},
|
{_this call FUNC(keyUp)},
|
||||||
[219, [false, false, false]],
|
[219, [false, false, false]], false] call cba_fnc_addKeybind; //Left Windows Key
|
||||||
false,
|
|
||||||
"keyUp"] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(SelfInteractKey), "Self Actions Key",
|
||||||
"Self Actions Key",
|
|
||||||
{_this call FUNC(keyDownSelfAction)},
|
{_this call FUNC(keyDownSelfAction)},
|
||||||
[219, [false, true, false]],
|
|
||||||
false,
|
|
||||||
"keydown"] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
|
||||||
"Self Actions Key",
|
|
||||||
{_this call FUNC(keyUpSelfAction)},
|
{_this call FUNC(keyUpSelfAction)},
|
||||||
[219, [false, true, false]],
|
[219, [false, true, false]], false] call cba_fnc_addKeybind; //Left Windows Key + Ctrl/Strg
|
||||||
false,
|
|
||||||
"keyUp"] call cba_fnc_registerKeybind;
|
|
||||||
|
@ -16,8 +16,7 @@ GVAR(isOpeningDoor) = false;
|
|||||||
|
|
||||||
|
|
||||||
// Add keybinds
|
// Add keybinds
|
||||||
["ACE3",
|
["ACE3", QGVAR(openDoor), localize "STR_ACE_Interaction_OpenDoor",
|
||||||
localize "STR_ACE_Interaction_OpenDoor",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -31,10 +30,8 @@ GVAR(isOpeningDoor) = false;
|
|||||||
call EFUNC(interaction,openDoor);
|
call EFUNC(interaction,openDoor);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[57, [false, true, false]],
|
{},
|
||||||
false,
|
[57, [false, true, false]], false] call cba_fnc_addKeybind;
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3",
|
||||||
localize "STR_ACE_Interaction_OpenDoor",
|
localize "STR_ACE_Interaction_OpenDoor",
|
||||||
|
@ -18,8 +18,7 @@
|
|||||||
|
|
||||||
}] call EFUNC(common,addEventHandler);
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(climb), localize "STR_ACE_Movement_Climb",
|
||||||
localize "STR_ACE_Movement_Climb",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -31,7 +30,5 @@
|
|||||||
[ACE_player] call FUNC(climb);
|
[ACE_player] call FUNC(climb);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[47, [false, true, false]], //DIK_V + CTRL//STRG
|
{false},
|
||||||
false,
|
[47, [false, true, false]], false] call cba_fnc_addKeybind; //DIK_V + CTRL//STRG
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
@ -7,8 +7,7 @@ if (!hasInterface) exitWith {};
|
|||||||
|
|
||||||
|
|
||||||
// Add keybinds
|
// Add keybinds
|
||||||
["ACE3",
|
["ACE3", QGVAR(showNameTags), localize "STR_ACE_NameTags_ShowNames",
|
||||||
localize "STR_ACE_NameTags_ShowNames",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -20,10 +19,8 @@ if (!hasInterface) exitWith {};
|
|||||||
// Return false so it doesn't block other actions
|
// Return false so it doesn't block other actions
|
||||||
false
|
false
|
||||||
},
|
},
|
||||||
[29, [false, false, false]],
|
{false},
|
||||||
false,
|
[29, [false, false, false]], false] call cba_fnc_addKeybind; //LeftControl Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
|
|
||||||
// Draw handle
|
// Draw handle
|
||||||
|
@ -37,8 +37,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0;
|
|||||||
["playerTurretChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
["playerTurretChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
// Add keybinds
|
// Add keybinds
|
||||||
["ACE3",
|
["ACE3", QGVAR(IncreaseNVGBrightness), localize "STR_ACE_NightVision_IncreaseNVGBrightness",
|
||||||
localize "STR_ACE_NightVision_IncreaseNVGBrightness",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [QEGVAR(captives,isNotEscorting)];
|
_exceptions = [QEGVAR(captives,isNotEscorting)];
|
||||||
@ -50,13 +49,10 @@ localize "STR_ACE_NightVision_IncreaseNVGBrightness",
|
|||||||
[ACE_player, 1] call FUNC(changeNVGBrightness);
|
[ACE_player, 1] call FUNC(changeNVGBrightness);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[201, [false, false, true]], //PageUp + ALT
|
{false},
|
||||||
false,
|
[201, [false, false, true]], false] call cba_fnc_addKeybind; //PageUp + ALT
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(DecreaseNVGBrightness), localize "STR_ACE_NightVision_DecreaseNVGBrightness",
|
||||||
localize "STR_ACE_NightVision_DecreaseNVGBrightness",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [QEGVAR(captives,isNotEscorting)];
|
_exceptions = [QEGVAR(captives,isNotEscorting)];
|
||||||
@ -68,7 +64,5 @@ localize "STR_ACE_NightVision_DecreaseNVGBrightness",
|
|||||||
[ACE_player, -1] call FUNC(changeNVGBrightness);
|
[ACE_player, -1] call FUNC(changeNVGBrightness);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[209, [false, false, true]], //PageDown + ALT
|
{false},
|
||||||
false,
|
[209, [false, false, true]], false] call cba_fnc_addKeybind; //PageDown + ALT
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
if !(hasInterface) exitWith {};
|
if !(hasInterface) exitWith {};
|
||||||
|
|
||||||
// Add keybinds
|
// Add keybinds
|
||||||
["ACE3",
|
["ACE3", QGVAR(unjamWeapon), localize "STR_ACE_Overheating_UnjamWeapon",
|
||||||
localize "STR_ACE_Overheating_UnjamWeapon",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -19,7 +18,5 @@ if !(hasInterface) exitWith {};
|
|||||||
[ACE_player, currentMuzzle ACE_player, false] call FUNC(clearJam);
|
[ACE_player, currentMuzzle ACE_player, false] call FUNC(clearJam);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[19, [true, false, false]],
|
{false},
|
||||||
false,
|
[19, [true, false, false]], false] call cba_fnc_addKeybind; //R Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
if (!hasInterface) exitWith {};
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
["ACE3", localize "STR_ACE_Parachute_showAltimeter",
|
["ACE3", QGVAR(showAltimeter), localize "STR_ACE_Parachute_showAltimeter",
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
||||||
@ -28,7 +28,9 @@ if (!hasInterface) exitWith {};
|
|||||||
call FUNC(hideAltimeter);
|
call FUNC(hideAltimeter);
|
||||||
};
|
};
|
||||||
true
|
true
|
||||||
}, [24, false, false, false], false, "keydown"] call CALLSTACK(cba_fnc_registerKeybind);
|
},
|
||||||
|
{false},
|
||||||
|
[24, false, false, false], false] call CALLSTACK(cba_fnc_addKeybind);
|
||||||
|
|
||||||
GVAR(PFH) = false;
|
GVAR(PFH) = false;
|
||||||
["playerVehicleChanged",{
|
["playerVehicleChanged",{
|
||||||
|
@ -49,7 +49,7 @@ class CfgVehicles {
|
|||||||
displayName = "$STR_ACE_Parachute_NonSteerableParachute";
|
displayName = "$STR_ACE_Parachute_NonSteerableParachute";
|
||||||
//picture = "\A3\Characters_F\data\ui\icon_b_parachute_ca.paa"; // @todo
|
//picture = "\A3\Characters_F\data\ui\icon_b_parachute_ca.paa"; // @todo
|
||||||
//model = "\A3\Weapons_F\Ammoboxes\Bags\Backpack_Parachute"; // @todo
|
//model = "\A3\Weapons_F\Ammoboxes\Bags\Backpack_Parachute"; // @todo
|
||||||
backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable
|
// backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable //Bis broke this in 1.40
|
||||||
ParachuteClass = "NonSteerable_Parachute_F";
|
ParachuteClass = "NonSteerable_Parachute_F";
|
||||||
maximumLoad = 0;
|
maximumLoad = 0;
|
||||||
mass = 100;
|
mass = 100;
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
if !(hasInterface) exitWith {};
|
if !(hasInterface) exitWith {};
|
||||||
|
|
||||||
// Add keybinds
|
// Add keybinds
|
||||||
["ACE3",
|
["ACE3", QGVAR(checkAmmo), localize "STR_ACE_Reload_checkAmmo",
|
||||||
localize "STR_ACE_Reload_checkAmmo",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -18,10 +17,8 @@ if !(hasInterface) exitWith {};
|
|||||||
[ACE_player] call FUNC(checkAmmo);
|
[ACE_player] call FUNC(checkAmmo);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[19, [false, true, false]],
|
{false},
|
||||||
false,
|
[19, [false, true, false]], false] call cba_fnc_addKeybind;
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
|
|
||||||
// Listen for attempts to link ammo
|
// Listen for attempts to link ammo
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
if !(hasInterface) exitWith {};
|
if !(hasInterface) exitWith {};
|
||||||
|
|
||||||
// Add keybinds
|
// Add keybinds
|
||||||
["ACE3",
|
["ACE3", QGVAR(RestWeapon), localize "STR_ACE_Resting_RestWeapon",
|
||||||
localize "STR_ACE_Resting_RestWeapon",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -21,7 +20,5 @@ if !(hasInterface) exitWith {};
|
|||||||
// Return false so it doesn't block other actions
|
// Return false so it doesn't block other actions
|
||||||
false
|
false
|
||||||
},
|
},
|
||||||
[15, [false, false, false]],
|
{false},
|
||||||
false,
|
[15, [false, false, false]], false] call cba_fnc_addKeybind;
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
@ -6,8 +6,7 @@
|
|||||||
|
|
||||||
|
|
||||||
// Add keybinds
|
// Add keybinds
|
||||||
["ACE3",
|
["ACE3", QGVAR(safeMode), localize "STR_ACE_SafeMode_SafeMode",
|
||||||
localize "STR_ACE_SafeMode_SafeMode",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
||||||
@ -19,7 +18,5 @@
|
|||||||
[ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety);
|
[ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[41, [false, true, false]],
|
{false},
|
||||||
false,
|
[41, [false, true, false]], false] call cba_fnc_addKeybind;
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
@ -33,8 +33,7 @@ if !(hasInterface) exitWith {};
|
|||||||
|
|
||||||
|
|
||||||
// Add keybinds
|
// Add keybinds
|
||||||
["ACE3",
|
["ACE3", QGVAR(AdjustUp), localize "STR_ACE_Scopes_AdjustUp",
|
||||||
localize "STR_ACE_Scopes_AdjustUp",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -47,13 +46,10 @@ if !(hasInterface) exitWith {};
|
|||||||
[ACE_player, 0, 0.1] call FUNC(adjustScope);
|
[ACE_player, 0, 0.1] call FUNC(adjustScope);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[201, [false, false, false]],
|
{false},
|
||||||
false,
|
[201, [false, false, false]], false] call cba_fnc_addKeybind;
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(AdjustDown), localize "STR_ACE_Scopes_AdjustDown",
|
||||||
localize "STR_ACE_Scopes_AdjustDown",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -66,13 +62,10 @@ if !(hasInterface) exitWith {};
|
|||||||
[ACE_player, 0, -0.1] call FUNC(adjustScope);
|
[ACE_player, 0, -0.1] call FUNC(adjustScope);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[209, [false, false, false]],
|
{false},
|
||||||
false,
|
[209, [false, false, false]], false] call cba_fnc_addKeybind;
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(AdjustLeft), localize "STR_ACE_Scopes_AdjustLeft",
|
||||||
localize "STR_ACE_Scopes_AdjustLeft",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -85,13 +78,10 @@ if !(hasInterface) exitWith {};
|
|||||||
[ACE_player, -0.1, 0] call FUNC(adjustScope);
|
[ACE_player, -0.1, 0] call FUNC(adjustScope);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[209, [false, true, false]],
|
{false},
|
||||||
false,
|
[209, [false, true, false]], false] call cba_fnc_addKeybind;
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(AdjustRight), localize "STR_ACE_Scopes_AdjustRight",
|
||||||
localize "STR_ACE_Scopes_AdjustRight",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -104,7 +94,5 @@ if !(hasInterface) exitWith {};
|
|||||||
[ACE_player, 0.1, 0] call FUNC(adjustScope);
|
[ACE_player, 0.1, 0] call FUNC(adjustScope);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[201, [false, true, false]],
|
{false},
|
||||||
false,
|
[201, [false, true, false]], false] call cba_fnc_addKeybind;
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// by commy2
|
// by commy2
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(AzimuthKey), localize "STR_ACE_Vector_AzimuthKey",
|
||||||
localize "STR_ACE_Vector_AzimuthKey",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -17,13 +16,6 @@
|
|||||||
["azimuth"] call FUNC(onKeyDown);
|
["azimuth"] call FUNC(onKeyDown);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[15, [false, false, false]],
|
|
||||||
false,
|
|
||||||
"keydown"
|
|
||||||
] call CBA_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
|
||||||
localize "STR_ACE_Vector_AzimuthKey",
|
|
||||||
{
|
{
|
||||||
// prevent holding down
|
// prevent holding down
|
||||||
GVAR(isDownStateKey1) = false;
|
GVAR(isDownStateKey1) = false;
|
||||||
@ -36,13 +28,10 @@
|
|||||||
["azimuth"] call FUNC(onKeyUp);
|
["azimuth"] call FUNC(onKeyUp);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[15, [false, false, false]],
|
[15, [false, false, false]], false, 0] call CBA_fnc_addKeybind; //Tab Key
|
||||||
false,
|
|
||||||
"keyup"
|
|
||||||
] call CBA_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
|
||||||
localize "STR_ACE_Vector_DistanceKey",
|
["ACE3", QGVAR(DistanceKey), localize "STR_ACE_Vector_DistanceKey",
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -58,13 +47,6 @@
|
|||||||
["distance"] call FUNC(onKeyDown);
|
["distance"] call FUNC(onKeyDown);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[19, [false, false, false]],
|
|
||||||
false,
|
|
||||||
"keydown"
|
|
||||||
] call CBA_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
|
||||||
localize "STR_ACE_Vector_DistanceKey",
|
|
||||||
{
|
{
|
||||||
// prevent holding down
|
// prevent holding down
|
||||||
GVAR(isDownStateKey2) = false;
|
GVAR(isDownStateKey2) = false;
|
||||||
@ -77,7 +59,4 @@
|
|||||||
["distance"] call FUNC(onKeyUp);
|
["distance"] call FUNC(onKeyUp);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[19, [false, false, false]],
|
[19, [false, false, false]], false] call CBA_fnc_addKeybind; //R Key
|
||||||
false,
|
|
||||||
"keyup"
|
|
||||||
] call CBA_fnc_registerKeybind;
|
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
if !(hasInterface) exitWith {};
|
if !(hasInterface) exitWith {};
|
||||||
|
|
||||||
// Add keybinds
|
// Add keybinds
|
||||||
["ACE3",
|
["ACE3", QGVAR(speedLimiter), localize "STR_ACE_SpeedLimiter",
|
||||||
localize "STR_ACE_SpeedLimiter",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -19,7 +18,5 @@ if !(hasInterface) exitWith {};
|
|||||||
[ACE_player, vehicle ACE_player] call FUNC(speedLimiter);
|
[ACE_player, vehicle ACE_player] call FUNC(speedLimiter);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[211, [false, false, false]],
|
{false},
|
||||||
false,
|
[211, [false, false, false]], false] call cba_fnc_addKeybind; //DELETE Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
if !(hasInterface) exitWith {};
|
if !(hasInterface) exitWith {};
|
||||||
|
|
||||||
// Add keybinds
|
// Add keybinds
|
||||||
["ACE3",
|
["ACE3", QGVAR(SelectPistol), localize "STR_ACE_WeaponSelect_SelectPistol",
|
||||||
localize "STR_ACE_WeaponSelect_SelectPistol",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
||||||
@ -17,13 +16,10 @@ if !(hasInterface) exitWith {};
|
|||||||
[ACE_player, handgunWeapon ACE_player] call FUNC(selectWeaponMode);
|
[ACE_player, handgunWeapon ACE_player] call FUNC(selectWeaponMode);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[2, [false, false, false]],
|
{false},
|
||||||
false,
|
[2, [false, false, false]], false] call cba_fnc_addKeybind; //1 Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(SelectRifle), localize "STR_ACE_WeaponSelect_SelectRifle",
|
||||||
localize "STR_ACE_WeaponSelect_SelectRifle",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
||||||
@ -35,31 +31,10 @@ if !(hasInterface) exitWith {};
|
|||||||
[ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMode);
|
[ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMode);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[3, [false, false, false]],
|
{false},
|
||||||
false,
|
[3, [false, false, false]], false] call cba_fnc_addKeybind; //2 Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(SelectRifleMuzzle), localize "STR_ACE_WeaponSelect_SelectRifleMuzzle",
|
||||||
localize "STR_ACE_WeaponSelect_SelectLauncher",
|
|
||||||
{
|
|
||||||
// Conditions: canInteract
|
|
||||||
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
|
||||||
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
|
||||||
// Conditions: specific
|
|
||||||
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
|
|
||||||
|
|
||||||
// Statement
|
|
||||||
[ACE_player, secondaryWeapon ACE_player] call FUNC(selectWeaponMode);
|
|
||||||
true
|
|
||||||
},
|
|
||||||
[5, [false, false, false]],
|
|
||||||
false,
|
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
|
||||||
localize "STR_ACE_WeaponSelect_SelectRifleMuzzle",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
||||||
@ -71,13 +46,25 @@ if !(hasInterface) exitWith {};
|
|||||||
[ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMuzzle);
|
[ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMuzzle);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[4, [false, false, false]],
|
{false},
|
||||||
false,
|
[4, [false, false, false]], false] call cba_fnc_addKeybind; //3 Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(SelectLauncher), localize "STR_ACE_WeaponSelect_SelectLauncher",
|
||||||
localize "STR_ACE_WeaponSelect_SelectBinocular",
|
{
|
||||||
|
// Conditions: canInteract
|
||||||
|
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
||||||
|
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
||||||
|
// Conditions: specific
|
||||||
|
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
|
||||||
|
|
||||||
|
// Statement
|
||||||
|
[ACE_player, secondaryWeapon ACE_player] call FUNC(selectWeaponMode);
|
||||||
|
true
|
||||||
|
},
|
||||||
|
{false},
|
||||||
|
[5, [false, false, false]], false] call cba_fnc_addKeybind; //4 Key
|
||||||
|
|
||||||
|
["ACE3", QGVAR(SelectBinocular), localize "STR_ACE_WeaponSelect_SelectBinocular",
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
||||||
@ -89,13 +76,10 @@ if !(hasInterface) exitWith {};
|
|||||||
[ACE_player, binocular ACE_player] call FUNC(selectWeaponMode);
|
[ACE_player, binocular ACE_player] call FUNC(selectWeaponMode);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[6, [false, false, false]],
|
{false},
|
||||||
false,
|
[6, [false, false, false]], false] call cba_fnc_addKeybind; //5 Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(SelectGrenadeFrag), localize "STR_ACE_WeaponSelect_SelectGrenadeFrag",
|
||||||
localize "STR_ACE_WeaponSelect_SelectGrenadeFrag",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
||||||
@ -107,13 +91,10 @@ if !(hasInterface) exitWith {};
|
|||||||
[ACE_player] call FUNC(selectGrenadeFrag);
|
[ACE_player] call FUNC(selectGrenadeFrag);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[7, [false, false, false]],
|
{false},
|
||||||
false,
|
[7, [false, false, false]], false] call cba_fnc_addKeybind; //6 Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(SelectGrenadeOther), localize "STR_ACE_WeaponSelect_SelectGrenadeOther",
|
||||||
localize "STR_ACE_WeaponSelect_SelectGrenadeOther",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
||||||
@ -125,13 +106,10 @@ if !(hasInterface) exitWith {};
|
|||||||
[ACE_player] call FUNC(selectGrenadeOther);
|
[ACE_player] call FUNC(selectGrenadeOther);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[8, [false, false, false]],
|
{false},
|
||||||
false,
|
[8, [false, false, false]], false] call cba_fnc_addKeybind; //7 Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(HolsterWeapon), localize "STR_ACE_WeaponSelect_HolsterWeapon",
|
||||||
localize "STR_ACE_WeaponSelect_HolsterWeapon",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
||||||
@ -143,13 +121,10 @@ if !(hasInterface) exitWith {};
|
|||||||
[ACE_player] call FUNC(putWeaponAway);
|
[ACE_player] call FUNC(putWeaponAway);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[11, [false, false, false]],
|
{false},
|
||||||
false,
|
[11, [false, false, false]], false] call cba_fnc_addKeybind; //0 Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(EngineOn), localize "STR_ACE_WeaponSelect_EngineOn",
|
||||||
localize "STR_ACE_WeaponSelect_EngineOn",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -161,13 +136,10 @@ if !(hasInterface) exitWith {};
|
|||||||
(vehicle ACE_player) engineOn true;
|
(vehicle ACE_player) engineOn true;
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[3, [false, false, false]],
|
{false},
|
||||||
false,
|
[3, [false, false, false]], false] call cba_fnc_addKeybind; //2 Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(EngineOff), localize "STR_ACE_WeaponSelect_EngineOff",
|
||||||
localize "STR_ACE_WeaponSelect_EngineOff",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -179,13 +151,10 @@ if !(hasInterface) exitWith {};
|
|||||||
(vehicle ACE_player) engineOn false;
|
(vehicle ACE_player) engineOn false;
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[2, [false, false, false]],
|
{false},
|
||||||
false,
|
[2, [false, false, false]], false] call cba_fnc_addKeybind; //1 Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(SelectMainGun), localize "STR_ACE_WeaponSelect_SelectMainGun",
|
||||||
localize "STR_ACE_WeaponSelect_SelectMainGun",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -197,13 +166,10 @@ if !(hasInterface) exitWith {};
|
|||||||
[ACE_player, vehicle ACE_player, 0] call FUNC(selectWeaponVehicle);
|
[ACE_player, vehicle ACE_player, 0] call FUNC(selectWeaponVehicle);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[4, [false, false, false]],
|
{false},
|
||||||
false,
|
[4, [false, false, false]], false] call cba_fnc_addKeybind; //3 Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(SelectMachineGun), localize "STR_ACE_WeaponSelect_SelectMachineGun",
|
||||||
localize "STR_ACE_WeaponSelect_SelectMachineGun",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -215,13 +181,10 @@ if !(hasInterface) exitWith {};
|
|||||||
[ACE_player, vehicle ACE_player, 1] call FUNC(selectWeaponVehicle);
|
[ACE_player, vehicle ACE_player, 1] call FUNC(selectWeaponVehicle);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[5, [false, false, false]],
|
{false},
|
||||||
false,
|
[5, [false, false, false]], false] call cba_fnc_addKeybind; //4 Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(SelectMissiles), localize "STR_ACE_WeaponSelect_SelectMissiles",
|
||||||
localize "STR_ACE_WeaponSelect_SelectMissiles",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -233,13 +196,10 @@ if !(hasInterface) exitWith {};
|
|||||||
[ACE_player, vehicle ACE_player, 2] call FUNC(selectWeaponVehicle);
|
[ACE_player, vehicle ACE_player, 2] call FUNC(selectWeaponVehicle);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[6, [false, false, false]],
|
{false},
|
||||||
false,
|
[6, [false, false, false]], false] call cba_fnc_addKeybind; //5 Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
|
||||||
["ACE3",
|
["ACE3", QGVAR(FireSmokeLauncher), localize "STR_ACE_WeaponSelect_FireSmokeLauncher",
|
||||||
localize "STR_ACE_WeaponSelect_FireSmokeLauncher",
|
|
||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
_exceptions = [];
|
_exceptions = [];
|
||||||
@ -251,7 +211,5 @@ if !(hasInterface) exitWith {};
|
|||||||
[vehicle ACE_player] call FUNC(fireSmokeLauncher);
|
[vehicle ACE_player] call FUNC(fireSmokeLauncher);
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[10, [false, false, false]],
|
{false},
|
||||||
false,
|
[10, [false, false, false]], false] call cba_fnc_addKeybind; //9 Key
|
||||||
"keydown"
|
|
||||||
] call cba_fnc_registerKeybind;
|
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#define MAXELEVATION 20
|
#define MAXELEVATION 20
|
||||||
#define SIMULATIONSTEP 0.05
|
|
||||||
#define MAXITERATIONS 120
|
#define MAXITERATIONS 120
|
||||||
#define PRECISION 0.1
|
#define PRECISION 0.1
|
||||||
#define RADIANS(X) (X / (180 / M_PI))
|
#define RADIANS(X) (X / (180 / M_PI))
|
||||||
@ -45,7 +44,7 @@ std::vector<std::string> splitString(std::string input) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
double traceBullet(double initSpeed, double airFriction, double angle, double angleTarget, double distance) {
|
double traceBullet(double initSpeed, double airFriction, double angle, double angleTarget, double distance) {
|
||||||
double velX, velY, posX, posY, posTargetX, posTargetY, velMag;
|
double velX, velY, posX, posY, lastPosX, lastPosY, posTargetX, posTargetY, velMag;
|
||||||
velX = cos(RADIANS(angle)) * initSpeed;
|
velX = cos(RADIANS(angle)) * initSpeed;
|
||||||
velY = sin(RADIANS(angle)) * initSpeed;
|
velY = sin(RADIANS(angle)) * initSpeed;
|
||||||
posX = 0;
|
posX = 0;
|
||||||
@ -53,18 +52,24 @@ double traceBullet(double initSpeed, double airFriction, double angle, double an
|
|||||||
posTargetX = cos(RADIANS(angleTarget)) * distance;
|
posTargetX = cos(RADIANS(angleTarget)) * distance;
|
||||||
posTargetY = sin(RADIANS(angleTarget)) * distance;
|
posTargetY = sin(RADIANS(angleTarget)) * distance;
|
||||||
|
|
||||||
|
double simulationStep = 0.05;
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (i < MAXITERATIONS) {
|
while (i < MAXITERATIONS) {
|
||||||
|
lastPosX = posX;
|
||||||
|
lastPosY = posY;
|
||||||
|
simulationStep = 0.1 - 0.049 * (posX / posTargetX);
|
||||||
velMag = sqrt(pow(velX, 2) + pow(velY, 2));
|
velMag = sqrt(pow(velX, 2) + pow(velY, 2));
|
||||||
velX += SIMULATIONSTEP * (velX * velMag * airFriction);
|
velX += simulationStep * (velX * velMag * airFriction);
|
||||||
velY += SIMULATIONSTEP * (velY * velMag * airFriction - 9.81);
|
velY += simulationStep * (velY * velMag * airFriction - 9.81);
|
||||||
posX += velX * SIMULATIONSTEP;
|
posX += velX * simulationStep;
|
||||||
posY += velY * SIMULATIONSTEP;
|
posY += velY * simulationStep;
|
||||||
if (posX >= posTargetX) { break; }
|
if (posX >= posTargetX) { break; }
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return posY - posTargetY;
|
double coef = (posTargetX - lastPosX) / (posX - lastPosX);
|
||||||
|
return (lastPosY + (posY - lastPosY) * coef) - posTargetY;
|
||||||
}
|
}
|
||||||
|
|
||||||
double getSolution(double initSpeed, double airFriction, double angleTarget, double distance) {
|
double getSolution(double initSpeed, double airFriction, double angleTarget, double distance) {
|
||||||
|
Loading…
Reference in New Issue
Block a user