mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Linear work javelin.
This commit is contained in:
parent
8fe11c36ee
commit
1eadcade72
@ -19,21 +19,28 @@ _distanceToShooter = _projectilePos vectorDistance _shooterPos;
|
||||
TRACE_2("", _distanceToTarget, _distanceToShooter);
|
||||
|
||||
// Add height depending on distance for compensate
|
||||
_addHeight =[0,0,0];
|
||||
if(_distanceToShooter < 50) then {
|
||||
_addHeight = [0,0,_distanceToTarget];
|
||||
} else {
|
||||
_addHeight = [0,0, _distanceToTarget*0.02];
|
||||
_addHeight = [0,0,0];
|
||||
|
||||
// Always climb an arc on initial launch if we are close to the round
|
||||
if( ((ASLtoATL _projectilePos) select 2) < 20 && _distanceToShooter < 50) then {
|
||||
_addHeight = _addHeight vectorAdd [0,0,_distanceToTarget];
|
||||
};
|
||||
|
||||
// If we are below the target, increase the climbing arc
|
||||
if((_projectilePos select 2) < (_seekerTargetPos select 2) && _distanceToTarget > 100) then {
|
||||
_addHeight = _addHeight vectorAdd [0,0, _distanceToTarget*0.02];
|
||||
};
|
||||
|
||||
// Handle arcing terminal low for high decent
|
||||
if( (_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget < 100) then {
|
||||
_addHeight = _addHeight vectorDiff [0,0, ((_projectilePos select 2) - (_seekerTargetPos select 2)) * 0.25];
|
||||
};
|
||||
|
||||
|
||||
|
||||
TRACE_3("", _distanceToTarget,_distanceToShooter,_addHeight);
|
||||
|
||||
// Only add the guidance height if we are below the target
|
||||
if((_shooterPos select 2) < (_seekerTargetPos select 2)) then {
|
||||
_returnTargetPos = _seekerTargetPos vectorAdd _addHeight;
|
||||
} else {
|
||||
_returnTargetPos = _seekerTargetPos;
|
||||
};
|
||||
_returnTargetPos = _seekerTargetPos vectorAdd _addHeight;
|
||||
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
drawLine3D [(ASLtoATL _returnTargetPos) vectorAdd _addHeight, ASLtoATL _returnTargetPos, [0,1,0,1]];
|
||||
|
@ -16,7 +16,7 @@ TRACE_1("", _launchParams);
|
||||
// TODO:: Make sure the missile maintains LOS
|
||||
_foundTargetPos = [0,0,0];
|
||||
if(!isNil "_target") then {
|
||||
_foundTargetPos = getPosASL (_target);
|
||||
_foundTargetPos = getPosASL _target;
|
||||
};
|
||||
|
||||
TRACE_2("", _target, _foundTargetPos);
|
||||
|
Loading…
Reference in New Issue
Block a user