Vector4¶
Reference¶
- class Vector4¶
- module:
- x: number¶
- y: number¶
- z: number¶
- w: number¶
- static new(x, y, z, w)¶
Create new vector
- set(x, y, z, w)¶
Set components of the vector
- Parameters:¶
x (
number
) – x componenty (
number
) – y componentz (
number
) – z componentw (
number
) – w component
- static lerp(from, to, t)¶
Linear interpolation between 2 vectors
- static moveTowards(current, target, maxDistanceDelta)¶
Move one vector in the direction of the target vector
- static scaled(a, b)¶
Scale vector by another vector
- scale(scale)¶
Scale this vector by another vector
- normalized()¶
Return normalized version of this vector
- div(d)¶
Device this vector by another one
- mul(d)¶
Multiply this vector with another one
- add(b)¶
Add another vector to this vector
- sub(b)¶
Subtract another vector from this one
- static dot(a, b)¶
Calculates dot product from 2 vectors
- static project(a, b)¶
Project one vector onto another
- static distance(a, b)¶
Calculate distance between 2 vectors
- sqrMagnitude()¶
Calculate squared magnitude of the vector
- static min(lhs, rhs)¶
Return the minimum of all components of two vectors into a new vector