Garry's Mod Wiki

util.AimVector

  Vector util.AimVector( Angle ViewAngles, number ViewFOV, number x, number y, number scrWidth, number scrHeight )

Description

Function used to calculate aim vector from 2D screen position. It is used in SuperDOF calculate Distance.

Essentially a generic version of gui.ScreenToVector.

Arguments

1 Angle ViewAngles
View angles
2 number ViewFOV
View Field of View
3 number x
Mouse X position
4 number y
Mouse Y position
5 number scrWidth
Screen width
6 number scrHeight
Screen height

Returns

1 Vector
Calculated aim vector