Angle

From GMod Wiki

Jump to: navigation, search


The angle object is derived from Vector

Shows an angles orientation

An angle can be created using the 'Angle(Pitch, Yaw, Roll)' command.

Angle (Object)

NewerShared.png Angle:__add
NewerShared.png Angle:__eq
NewerShared.png Angle:__gc
NewerShared.png Angle:__index
NewerShared.png Angle:__mul
NewerShared.png Angle:__newindex
NewerShared.png Angle:__sub
NewerShared.png Angle:__tostring
NewerShared.png Angle:Forward
NewerShared.png Angle:Right
NewerShared.png Angle:RotateAroundAxis
NewerShared.png Angle:Up

Code examples

Creating an angle

 
local angle = Angle( 20, 90, 0 ) //Creates angle where: Pitch = 20deg, Yaw = 90deg, Roll = 0deg
Msg(tostring(angle) .. "\n")
 

Reading components of an angle

 
Msg(tostring(angle.p)) //Prints Pitch component of angle
Msg(tostring(angle.y)) //Prints Yaw component of angle
Msg(tostring(angle.r)) //Prints Roll component of angle
 
 

Semi-Related math (Library)

NewerShared.png math.AngleDifference
NewerShared.png math.ApproachAngle
NewerShared.png math.NormalizeAngle

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox