Arma 3 Scripting

getAimDirectionAndUp

  • Global argument
  • Arma 3 v2.22

Command · also in Render Time Scope · Markdown · JSON · original wiki page

Description

Returns the aim direction and up vectors of a soldier in model space. It returns where the weapon aim is wanted from the eyePos, not the actual weapon direction. For actual weapon direction, see weaponDirection.

Syntax

getAimDirectionAndUp [soldier, isRenderScope]

Parameters:

Returns: Array - in format [directionForward, directionUp] in soldier's model space

Examples

Example 1

onEachFrame
{
    getAimDirectionAndUp [player] params ["_dir", "_up"];
    private _dirWS = player vectorModelToWorld _dir;
    private _upWS = player vectorModelToWorld _up;
    private _eyePos = eyePos player;
    drawLine3D [ASLtoAGL _eyePos, ASLtoAGL (_eyePos vectorAdd _dirWS), [1,0,0,1]];
}

See also

weaponDirection · eyeDirection · positionCameraToWorld · eyePos