Garry's Mod Wiki

Revision Difference

Vector#512402

List of all possible functions to manipulate vectors.⤶ ⤶ Created by <page>Global.Vector</page>.⤶ <classfields>⤶ <fields>{{ClassField|number|**x** or **1**|The X component of the vector.</fields>⤶ ⤶ </classfields>⤶ ⤶ ⤶ <classfield|number|**y** or **2**|the y component of the vector.}}⤶ {{classfield|number|**z** or **3**|the z component of the vector.}}⤶ }}⤶ {{example>⤶ <description>Indexing by named component.</description>⤶ <code>⤶ local v = Vector( 1, 2, 3 )⤶ print( v.x, v.y, v.z )⤶ </code>⤶ <output>1 2 3</output>⤶ ⤶ </classfield|number|**y** or **2**|the y component of the vector.}}⤶ {{classfield|number|**z** or **3**|the z component of the vector.}}⤶ }}⤶ {{example>⤶ ⤶ ⤶ <example>⤶ <description>Indexing by number (most efficient!).</description>⤶ <code>⤶ local v = Vector( 1, 2, 3 )⤶ print( v[1], v[2], v[3] )⤶ </code>⤶ <output>1 2 3</output>⤶ ⤶ </example>⤶ ⤶