getCameraViewDirection

From Bohemia Interactive Community
Jump to: navigation, search
Introduced with Arma 3 version 1.58
  Arguments of this scripting command don't have to be local to the client the command is executed on

Click on the images for descriptions

Introduced in

Game:
Arma 3
Version:
1.58

Description

Description:
Returns the direction unit is looking in render time scope. While for AI the origin for the view direction vector can be taken from eyePos unit, for human player the origin should be taken from player camera position positionCameraToWorld [0,0,0]

Syntax

Syntax:
getCameraViewDirection unit
Parameters:
unit: Object
Return Value:
Array - 3D Vector

Examples

Example 1:
Draw AI eye direction (green), weapon direction (red) and camera direction (blue) in 3D: bob = createGroup east createUnit ["O_Soldier_F", [0,0,0], [], 0, "NONE"]; bob setVehiclePosition [player modelToWorld [0,100,0], [], 0, "NONE"]; onEachFrame { _beg = ASLToAGL eyePos bob; _endE = (_beg vectorAdd (eyeDirection bob vectorMultiply 100)); drawLine3D [ _beg, _endE, [0,1,0,1]]; _endW = (_beg vectorAdd (bob weaponDirection currentWeapon bob vectorMultiply 100)); drawLine3D [_beg, _endW, [1,0,0,1]]; _endV = (_beg vectorAdd (getCameraViewDirection bob vectorMultiply 100)); drawLine3D [_beg, _endV, [0,0,1,1]]; };

Additional Information

Multiplayer:
-
See also:
positionCameraToWorldweaponDirectioneyeDirectionvectorDirvectorDirVisual

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

Notes

Bottom Section