getAimDirectionAndUp: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| Line 25: | Line 25: | ||
private _upWS = player vectorModelToWorld _up; | private _upWS = player vectorModelToWorld _up; | ||
private _eyePos = eyePos player; | private _eyePos = eyePos player; | ||
drawLine3D [_eyePos, _eyePos vectorAdd _dirWS, [1,0,0,1]]; | drawLine3D [ASLtoAGL _eyePos, ASLtoAGL (_eyePos vectorAdd _dirWS), [1,0,0,1]]; | ||
} | } | ||
</sqf> | </sqf> | ||
Latest revision as of 12:14, 31 March 2026
Description
- 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.
- Groups:
- Object ManipulationRender Time Scope
Syntax
- Syntax:
- getAimDirectionAndUp [soldier, isRenderScope]
- Parameters:
- soldier: Object - The soldier entity. The soldier must either be on foot or in a turret.
- isRenderScope: Boolean - (Optional, default false) Whether to use render scope to get the vector. (render scope is smoother for visualizing the vector in 3D)
- Return Value:
- 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]]; }
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note