Fix bug with ZEM

This commit is contained in:
Brandon Danyluk 2021-04-13 16:21:15 -06:00
parent 1873467deb
commit f96abc0b89
4 changed files with 8 additions and 1 deletions

View File

@ -105,5 +105,6 @@ class GVAR(NavigationTypes) {
};
class ZeroEffortMiss {
functionName = QFUNC(navigationType_zeroEffortMiss);
onFired = QFUNC(proNav_onFired);
};
};

View File

@ -47,6 +47,10 @@ if ((_pitchRate != 0 || {_yawRate != 0}) && {_profileAdjustedTargetPos isNotEqua
private _navigationFunction = getText (configFile >> QGVAR(NavigationTypes) >> _navigationType >> "functionName");
private _commandedAcceleration = [_args, _timestep, _seekerTargetPos, _profileAdjustedTargetPos] call (missionNamespace getVariable _navigationFunction);
if (isNil "_commandedAcceleration") exitWith {
ERROR_MSG("_commandedAcceleration is nil! Guidance cancelled");
};
#ifdef DRAW_GUIDANCE_INFO
private _projectilePosAGL = ASLToAGL _projectilePos;
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], _projectilePosAGL vectorAdd [0, 0, 1], 0.75, 0.75, 0, str _commandedAcceleration, 1, 0.025, "TahomaB"];

View File

@ -21,6 +21,8 @@ _stateParams params ["", "", "", "","_navigationParams"];
_navigationParams params ["", "_navigationGain"];
_targetData params ["_targetDirection", "_targetRange", "_targetVelocity", "_targetAcceleration"];
_navigationGain = 3;
private _vectorToTarget = _targetDirection vectorMultiply _targetRange;
private _closingVelocity = _targetVelocity vectorDiff velocity _projectile;
private _timeToGo = _targetRange / vectorMagnitude _closingVelocity;

View File

@ -122,7 +122,7 @@ if !(isNull _target) then {
_targetData set [3, 0]; // todo: acceleration
};
_targetData set [0, _projectile vectorFromTo _expectedTargetPos];
_targetData set [0, (getPosASLVisual _projectile) vectorFromTo _expectedTargetPos];
_seekerStateParams set [3, _expectedTargetPos];
_launchParams set [0, _target];