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:
@ -21,4 +21,12 @@ if(!isNil "_target") then {
|
|||||||
|
|
||||||
TRACE_2("", _target, _foundTargetPos);
|
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;
|
_foundTargetPos;
|
Reference in New Issue
Block a user