Constructs a vec4 with the given x, y, z, and w components.
Alpha component of the vector, equivalent to w.
Blue component of the vector, equivalent to z.
Green component of the vector, equivalent to y.
Magnitude of the vector.
Squared magnitude of the vector.
Red component of the vector, equivalent to x.
Fourth component of the vector.
First component of the vector.
Second component of the vector.
Third component of the vector.
Returns the angle in radians between this vector and the given vector.
Returns a new vec4 with its length clamped to the given maximum.
Clamps the length of this vector to the given maximum in place.
Returns a new vec4 with the same component values.
Returns the squared distance between this vector and the given vector.
Returns true if this vector and the given vector have equal components.
Sets all components of this vector to the given value.
StaticlerpLinearly interpolates this vector toward the given vector by the given factor in place.
StaticmaxStaticminMoves this vector toward the target by at most the given max delta in place.
Returns a new vec4 with unit length in the same direction.
Normalizes this vector to unit length in place.
StaticoneReturns a vec4 with all components set to 1.
Projects this vector onto the plane defined by the given normal in place.
Reflects this vector off the plane defined by the given normal in place.
Sets the r, g, b, and a components of this vector.
Optionalr: numberOptionalg: numberOptionalb: numberOptionala: numberSets the x, y, z, and w components of this vector.
Optionalx: numberOptionaly: numberOptionalz: numberOptionalw: numberReturns a string representation of this vector.
Returns a new vec4 with all components multiplied by the given scalar.
Multiplies all components of this vector by the given scalar in place.
StaticzeroReturns a vec4 with all components set to 0.
Four-component float vector used for XYZW coordinates and RGBA color values.