vec2
__call
Creates a new 2D vector instance.
Arguments
1. Default vector (0, 0).
None.
2. Single value.
Name
Type
Description
value
float
X and Y coordinates.
3. XY values.
Name
Type
Description
x
float
X coordinate.
y
float
Y coordinate.
Returns
Type
Description
vec2
New vector.
Example
x
Type: float
X coordinate.
y
Type: float
Y coordinate.
floor
Returns floored variant of this vector.
Arguments
None.
Returns
Type
Description
vec2
Floored variant.
Example
Returns ceiled variant of this vector.
Arguments
None.
Returns
Type
Description
vec2
Ceiled variant.
Example
round
Returns rounded variant of this vector.
Arguments
None.
Returns
Type
Description
vec2
Rounded variant.
Example
len
Returns length of this vector.
Arguments
None.
Returns
Type
Description
float
Length.
Example
len_sqr
Returns squared length of this vector.
This method is de-facto faster than the non-squared variant. Use it, if you need extra performance.
Arguments
None.
Returns
Type
Description
float
Length.
Example
dist
Returns distance to another vector.
Arguments
Name
Type
Description
other
vec2
Other vector.
Returns
Type
Description
float
Distance.
Example
dist_sqr
Returns squared distance to another vector.
This method is de-facto faster than the non-squared variant. Use it, if you need extra performance.
Arguments
Name
Type
Description
other
vec2
Other vector.
Returns
Type
Description
float
Distance.
Example
Last updated