Garry's Mod Wiki

Revision Difference

Angle#517127

List of all possible functions to manipulate angles. Created by <page>Global.Angle</page>. <classfields> <fields>{{ClassField|number|**p** or **pitch** or **x** or **1**|The pitch component of the angle</fields>⤶ <fields>⤶ <item name="**p** or **pitch** or **x** or **1**" type="number">The pitch component of the angle</item>⤶ ⤶ <item name="**y** or **yaw** or **2**" type="number">The yaw component of the angle</item>⤶ ⤶ <item name="**r** or **roll** or **r** or **3**" type="number">The roll component of the angle</item>⤶ </fields>⤶ </classfields> {{ClassField|number|**y** or **yaw** or **2**|The yaw 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.</description> <code> local a = Angle( 1, 2, 3 ) print( a.p, a.y, a.r ) </code> <output>1 2 3</output> </example> <example> <description>Indexing by angular named component.</description> <code> local a = Angle( 1, 2, 3 ) print( a.pitch, a.yaw, a.roll ) </code> <output>1 2 3</output> </example> <example> <description>Indexing by vector single-character component.</description> <code> local a = Angle( 1, 2, 3 ) print( a.x, a.y, a.z ) </code> <output>1 2 3</output> </example> <example> <description>Indexing by number (most efficient!).</description> <code> local a = Angle( 1, 2, 3 ) print( a[1], a[2], a[3] ) </code> <output>1 2 3</output> </example>