Constructor
Variables
x : Float
y : Float
Functions
View source
Parameters:
copyFrom (other : Vector2) : Void
Copies the values from one vector into this one
Parameters:
other | The vector to copy from |
View source
Parameters:
Returns:
distance (other : Vector2) : Float
Returns the distance between this and another point
Parameters:
other | The other point to use for distance calculation |
Returns:
The distance between the two points
View source
Parameters:
normalize (size : Float = 1) : Void
Normalize the vector to a set length
Parameters:
size | The length of the resulting vector. Default: unit length (1) |
View source
Parameters:
rotate (angle : Float) : Void
Rotate the vector around an angle
Parameters:
angle | The angle, in radians to rotate around (clockwise) |
View source
zcross (other : Vector2) : Float
This is the same as a 3D cross product but only returns the z value because x and y are 0. Can be used to determine if and angle between two vectors is greater than 180 degrees.