mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Compensate for target velocity.
This commit is contained in:
parent
5083a5a0d2
commit
c28ac5b4a9
@ -21,4 +21,12 @@ if(!isNil "_target") then {
|
||||
|
||||
TRACE_2("", _target, _foundTargetPos);
|
||||
|
||||
_projectileSpeed = (vectorMagnitude velocity _projectile);
|
||||
_distanceToTarget = (getPosASL _projectile) vectorDistance _foundTargetPos;
|
||||
|
||||
_eta = _distanceToTarget / _projectileSpeed;
|
||||
|
||||
_adjustVelocity = (velocity _target) vectorMultiply _eta;
|
||||
_foundTargetPos = _foundTargetPos vectorAdd _adjustVelocity;
|
||||
|
||||
_foundTargetPos;
|
Loading…
Reference in New Issue
Block a user