Last active
April 13, 2020 02:38
-
-
Save Benargee/715c7253fc8fa9bed8978d2b085b71e4 to your computer and use it in GitHub Desktop.
Draw lineIntersectsSurfaces point Arma 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_unit = player; | |
originPos = eyePos _unit; | |
offsetVector = _unit weaponDirection (currentWeapon _unit); | |
offsetPos = offsetVector vectorMultiply 10; | |
destPos = originPos vectorAdd offsetPos; | |
intersections = lineIntersectsSurfaces [originPos, destPos, _unit, objNull, true, 1]; | |
if (count intersections > 0) then { | |
//found | |
intersectPos = intersections select 0 select 0; | |
drawLoop = { | |
drawLine3D [ASLToAGL originPos, ASLToAGL destPos, [0,1,0,1]]; | |
drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [0,1,0,1], ASLToAGL intersectPos, 1, 1, 0, (str (intersections select 0 select 2)), 0, 0.03, "TahomaB"]; | |
}; | |
} else { | |
//not found | |
drawLoop = { | |
drawLine3D [ASLToAGL originPos, ASLToAGL destPos, [1,0,0,1]]; | |
}; | |
}; | |
onEachFrame { | |
call drawLoop; | |
}; | |
hintSilent str intersections; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment