Protected_wProtected_xProtected_yProtected_zStatic ReadonlyoneA Vector with all components set to one.
Static ReadonlywA Vector with the W component set to one and the rest set to zero.
Static ReadonlyxA Vector with the X component set to one and the rest set to zero.
Static ReadonlyyA Vector with the Y component set to one and the rest set to zero.
Static ReadonlyzA Vector with the Z component set to one and the rest set to zero.
Static ReadonlyzeroA Vector with all components set to zero.
Evaluates the expression and assigns it to the vector.
The expression to evaluate.
A reference to this vector
MathEx.eval for detailed documentation, limitations and considerations.
Returns whether the provided vector, given a error margin, has the same vector components values as this one.
The other Vector4 to compare with.
Optionalepsilon: numberOptional. Error margin within which the numbers should be considered equal.
True if equal, false otherwise.
StaticaddStaticdistanceStaticdivideStaticdotStaticisStaticisStaticmaxStaticminStaticmultiplyStaticmultiplyStaticsubtract
The Vector4 implements a fixed-size four-dimensional vector with a homogenous
wcoordinate. The class follows the 'copy-on-write' pattern, which means that every operation such as Vector4.normalized or Vector4.add returns a copy of the vector with updates values. It also implies that the values of the vector cannot be directly modified.The concept of immutability improves sharing of objects as all types in TypeScript are assigned by identity, instead of by-value (e.g. a copy) as in other programming languages like C.