Garry's Mod Wiki

Vector:AngleEx

Angle Vector:AngleEx( Vector up )

Description

Returns the angle of the vector, but instead of assuming that up is Vector( 0, 0, 1 ) (Like Vector:Angle does) you can specify which direction is 'up' for the angle.

Arguments

1 Vector up
The up direction vector

Returns

1 Angle
The angle

Example

Shows usage of the function

print( Vector( 0, 0, 100 ):AngleEx( Vector( 0, 0, 0 ) ) )
Output: Angle( -90.000, -0.000, 0.000 )

Example

Use forward and up vector to produce angle. These two lines below will return the same angle

local e = ents.Create("prop_physics") print(e:GetAngles()) print(e:GetForward():AngleEx(e:GetUp()))

Page Links


Special Pages


Wikis

?

Render Time: 62ms

DB GetPage 12
Generate Html 4
SaveChanges (1) 31
Render Body 0
Render Sidebar 13