Skip to main content

Vector4

Vector4 class

Properties

x: number

y: number

z: number

w: number

Functions

Copy

Vector4:Copy() Vector4

Returns a Vector4 (x =x, y =y, z=z, w=w).


Length

Vector4:Length() number

Returns vector length.


Length2

Vector4:Length2() number

Returns vector length square.


Distance

Vector4:Distance( v2: Vector4 ) number

ArgumentTypeDescription
v2Vector4Point2.

Returns distance from v to v2.


Distance2

Vector4:Distance2( v2: Vector4 ) number

ArgumentTypeDescription
v2Vector4Point2.

Returns distance square from v to v2.


Dot

Vector4:Dot( v2: Vector4 ) number

ArgumentTypeDescription
v2Vector4Point2.

Returns dot product result.


Normalize

Vector4:Normalize() Vector4

Returns a normalized Vector4 from this vector.


Lerp

Vector4:Lerp(
v2: Vector4,
time: number - float
) Vector3

ArgumentTypeDescription
v2Vector4Point2.
timenumber - floatTime.

Returns Linear interpolation. V1 + s (V2-V1)


Unpack

Vector4:Unpack() number, number, number, number

Returns two numbers x,y.z,w


Randomize

Vector4:Randomize() Vector4

Randomizes vector a little.