Skip to content

Instantly share code, notes, and snippets.

@commy2
Created February 22, 2019 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save commy2/dce70e6a0d231af3950332ae8a89f729 to your computer and use it in GitHub Desktop.
Save commy2/dce70e6a0d231af3950332ae8a89f729 to your computer and use it in GitHub Desktop.
private _distance = viewDistance;
private _origin = AGLToASL positionCameraToWorld [0, 0, 0];
private _target = AGLToASL positionCameraToWorld [0, 0, _distance];
private _default = _origin vectorAdd (_origin vectorFromTo _target vectorMultiply _distance);
lineIntersectsSurfaces [_origin, _target, cameraOn] param [0, [_default]] select 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment