Class "Vector"
Last updated
Was this helpful?
Last updated
Was this helpful?
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
Addition operators
{: .abp .tooltip .badge }
Division operators
Multiplication operators
Subtraction operators
Subtraction operators
Clamps the vector based on left, top, right, bottom boundings. Doesn't keep direction
Returns a clamped version of the vector.
Cross product this is the 2x2 matrix determinant or the resulting z value for their 3D versions with z=0
Returns distance between two vectors
???- example "Example Code"
Returns squared distance between two vectors
???- example "Example Code"
Dot product
???- example "Example Code" This code returns a vector that has a 45 degree angle
Returns the angle the vector is facing. The vector (1, 0) will be at 0 degrees. The vector (0, 1) will be at 90 degrees.
???- example "Example Code" This code returns the angle between two positions.
Returns the length of the vector
Returns the length squared of the vector
Linear interpolation between two vectors. For t = 0 it returns the first Vector, for t = 1 it returns the second.
???- example "Alternate Function example" This function does the same as Lerp, but will not alter the input vectors.
???- example "Example Code" This code will make v1 the vector 50% in between v1 and v2
Normalizes this vector
Returns a normalized version of this vector
Resizes the vector length.
Returns a resized version of the vector.
Returns a rotated version of the vector by AngleDegrees
Components of vector.
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .static .tooltip .badge } {: .abp .tooltip .badge }
Build a from an angle, returns a normalized vector. Angle 0 will result in (1, 0). Angle 90 will result in (0, 1).
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }
{: .abp .tooltip .badge }