Category:Angle

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (Add all Angle components)
(Made the indexing formatting clearer and added examples)
 
Line 4: Line 4:
 
{{ClassFields
 
{{ClassFields
 
|Fields=
 
|Fields=
{{ClassField|number|p/x/pitch|The pitch component of the angle}}
+
{{ClassField|number|'''p''' or '''pitch''' or '''x''' or '''1'''|The pitch component of the angle}}
{{ClassField|number|y/yaw|The yaw component of the angle}}
+
{{ClassField|number|'''y''' or '''yaw''' or '''2'''|The yaw component of the angle}}
{{ClassField|number|r/z/roll|The roll component of the angle}}
+
{{ClassField|number|'''r''' or '''roll''' or '''r''' or '''3'''|The roll component of the angle}}
 +
}}
 +
{{Example
 +
|Description=Indexing by angular single-character component.
 +
|Code=local a = Angle( 1, 2, 3 )
 +
print( a.p, a.y, a.r )
 +
|Output=1 2 3
 +
}}
 +
{{Example
 +
|Description=Indexing by angular named component.
 +
|Code=local a = Angle( 1, 2, 3 )
 +
print( a.pitch, a.yaw, a.roll )
 +
|Output=1 2 3
 +
}}
 +
{{Example
 +
|Description=Indexing by vector single-character component.
 +
|Code=local a = Angle( 1, 2, 3 )
 +
print( a.x, a.y, a.z )
 +
|Output=1 2 3
 +
}}
 +
{{Example
 +
|Description=Indexing by number (most efficient!).
 +
|Code=local a = Angle( 1, 2, 3 )
 +
print( a[1], a[2], a[3] )
 +
|Output=1 2 3
 
}}
 
}}

Latest revision as of 10:17, 24 October 2019

List of all possible functions to manipulate angles.

Created by Angle.

Contents

Fields

Type Name Description
number p or pitch or x or 1 The pitch component of the angle
number y or yaw or 2 The yaw component of the angle
number r or roll or r or 3 The roll component of the angle

Examples

Example

Indexing by angular single-character component.

local a = Angle( 1, 2, 3 )
print( a.p, a.y, a.r )

Output:

1 2 3

Examples

Example

Indexing by angular named component.

local a = Angle( 1, 2, 3 )
print( a.pitch, a.yaw, a.roll )

Output:

1 2 3

Examples

Example

Indexing by vector single-character component.

local a = Angle( 1, 2, 3 )
print( a.x, a.y, a.z )

Output:

1 2 3

Examples

Example

Indexing by number (most efficient!).

local a = Angle( 1, 2, 3 )
print( a[1], a[2], a[3] )

Output:

1 2 3
Personal tools
Navigation