2016-05-30 16:37:03 +00:00
|
|
|
/*
|
|
|
|
* Author: jaynus
|
|
|
|
* Returns whether the seeker object can see the target position with lineIntersect
|
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Arguments:
|
2016-05-30 16:37:03 +00:00
|
|
|
* 0: Seeker [Object]
|
|
|
|
* 1: Target [Object]
|
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Return Value:
|
2016-05-30 16:37:03 +00:00
|
|
|
* Boolean
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
private["_seeker", "_seekerPos", "_target", "_targetPos", "_return", "_vectorTo", "_searchPos"];
|
|
|
|
_seeker = _this select 0;
|
|
|
|
_target = _this select 1;
|
|
|
|
|
|
|
|
_targetPos = getPosASL _target;
|
|
|
|
_seekerPos = getPosASL _seeker;
|
|
|
|
_return = true;
|
|
|
|
|
|
|
|
if(!(terrainIntersectASL [ _seekerPos, _targetPos])) then {
|
|
|
|
if(lineIntersects [_seekerPos, _targetPos, _seeker, _target]) then {
|
|
|
|
_return = false;
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
_return = false;
|
|
|
|
};
|
|
|
|
|
2015-04-12 20:02:09 +00:00
|
|
|
_return;
|