Garry's Mod Wiki

Revision Difference

Angle#516854

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}}⤶ {{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}} <classfields>⤶ <fields>{{ClassField|number|**p** or **pitch** or **x** or **1**|The pitch component of the angle</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>⤶ <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> ⤶ </classfields⤶ |fields=⤶ {{classfield|number|**p** or **pitch** or **x** or **1**|the pitch component of the angle}}⤶ {{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>⤶ ⤶ </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>