Scripting/Squirrel/Functions/Vector: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "{{Scripting/Needs_Text}} == Syntax == <pre>Vector( X, Y, Z )</pre> == Arguments == * ''float'' '''X''' - X coordinate * ''float'' '''Y''' - Y coordinate * ''float'' '''Z''...") |
No edit summary |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
This function defines a Vector3 variable thant works as a dot in 3D space. | |||
== Syntax == | == Syntax == | ||
<pre>Vector( | <pre>Vector( x, y, z )</pre> | ||
== Arguments == | == Arguments == | ||
* ''float'' ''' | * ''float'' '''x''' - X coordinate | ||
* ''float'' ''' | * ''float'' '''x''' - Y coordinate | ||
* ''float'' ''' | * ''float'' '''y''' - Z coordinate | ||
== Functions == | |||
<pre>Length()</pre> | |||
<pre>Distance( vector )</pre> | |||
<pre>Dot( vector )</pre> | |||
== Example == | == Example == | ||
In the following example the player will teleport to the coordinates represented in '''X''', '''Y''', '''Z'''. | |||
<source lang=squirrel> | |||
player.Pos = Vector( 190.12, -122.45, 455.32 ); | |||
</source> | |||
=== Notes === | === Notes === | ||
[[Scripting/Squirrel/Functions/Player.Pos|Player.Pos]] were used in this example. More info about them in the corresponding pages. | |||
== Related Functions == | == Related Functions == | ||
{{Scripting/Squirrel/Functions/Data Structures}} | {{Scripting/Squirrel/Functions/Data Structures}} | ||
[[Category:Scripting/Squirrel/Functions/Data_Structures]] |
Latest revision as of 18:01, 30 January 2017
This function defines a Vector3 variable thant works as a dot in 3D space.
Syntax
Vector( x, y, z )
Arguments
- float x - X coordinate
- float x - Y coordinate
- float y - Z coordinate
Functions
Length()
Distance( vector )
Dot( vector )
Example
In the following example the player will teleport to the coordinates represented in X, Y, Z.
player.Pos = Vector( 190.12, -122.45, 455.32 );
Notes
Player.Pos were used in this example. More info about them in the corresponding pages.