The x component of the vector. Default is 0.
The y component of the vector. Default is 0.
The z component of the vector. Default is 0.
The z component of the vector. Default is 0.
The w component of the vector.
The x component of the vector.
The y component of the vector.
The z component of the vector.
Adds the scalar value s to the x, y, z and w components of this vector.
The scalar value to add.
Rounds this vector's components up to the nearest integer value.
If this vector's x, y, z or w value is greater than the max vector's x, y, z or w value, it is replaced by the corresponding value. If this vector's x, y, z or w value is less than the min vector's x, y, z or w value, it is replaced by the corresponding value.
The vector with the minimum x, y and z values used for clamping this vector.
The vector with the maximum x, y and z values used for clamping this vector.
If this vector's x, y, z or w values are greater than the max value, they are replaced by the maxVal value. If this vector's x, y, z or w values are less than the min value, they are replaced by the minVal value.
The minimum value used for clamping this vector.
The maximum value used for clamping this vector.
Returns a new vector with the same x, y, z and w values as this one.
Divides this vector by the scalar s. Each component of this vector is divided by the same value s. Set this vector to (0, 0, 0, 0) if s == 0.
The value to divide each component of this vector with.
Calculates the dot product of this vector and v.
The other vector to calculate the dot product with.
Checks for strict equality of this vector and v.
The other vector to compare this one to.
Rounds this vector's components down to the nearest integer value.
Sets this vector's x value to be array[offset+0], y value to be array[offset+1] z value to be array[offset+2] and w value to be array[offset+3].
The array of format [x, y, z, w] used to construct this vector.
An offset into the array from where to start reading the components.
Gets the value of the index-th component of the vector. Index 0 corresponds to the x component, 1 is y, 2 is z and 3 is w.
The index (0, 1, 2 or 3) of the component to get.
Computes the Euclidean length (straight-line length) from (0, 0, 0, 0) to this vector's (x, y, z, w). If you are comparing the lengths of vectors, you should compare the length squared instead as it is slightly more efficient to calculate.
Computes the Manhattan length of this vector.
Computes the square of the Euclidean length (straight-line length) from (0, 0, 0, 0) to this vector's (x, y, z, w). If you are comparing the lengths of vectors, you should compare the length squared instead as it is slightly more efficient to calculate.
Linearly interpolates between this vector and v by alpha amount (alpha=0 returns this vector, while alpha=1 returns v) and stores the result into this vector.
The vector to interpolate this one towards.
The interpolation factor, typically in the closed interval [0, 1].
Linearly interpolates between v1 and v2 by alpha amount (alpha=0 returns v1, while alpha=1 returns v2) and stores the result into this vector.
The starting vector (returned when alpha equals 0).
The vector to interpolate towards (returned when alpha equals 1).
The interpolation factor, typically in the closed interval [0, 1].
Multiplies this vector by the scalar s. Each component of this vector is multiplied by the same value s.
The value to multiply each component of this vector by.
Inverts this vector, i.e. sets x=-x, y=-y, z=-z and w=-w.
Converts this vector to a unit vector, that is, sets it equal to a vector with the same direction as this one, but with a length of 1.
Rounds this vector's components to the nearest integer value.
Rounds this vector's components towards zero (up if negative, down if positive) to an integer value.
Sets the x, y, z and w components of this vector to the provided ones.
The x component of the vector.
The y component of the vector.
The z component of the vector.
The w component of the vector.
Sets this vector to the computed axis-angle representation of the rotation defined by the quaternion q. The axis is stored in (x, y, z) components of the vector, and the rotation in radians is stored in component w.
The quaternion to represent as an axis-angle in this vector.
Sets this vector to the computed axis-angle representation of the rotation defined by the matrix m. The upper left 3x3 part of m is assumed to be a pure rotation matrix (i.e, unscaled). The axis is stored in (x, y, z) components of the vector, and the rotation in radians is stored in component w.
Sets the index-th component of this vector to the provided value. Index 0 corresponds to the x component, 1 is y, 2 is z and 3 is w.
The index (0, 1, 2 or 3) of the component to set.
The value to set the component of this vector to.
Set this vector to a vector with the same direction as this one, but a length of l.
Sets the x, y, z and w components of this vector to the same scalar value.
The value to set all the components of this vector to.
Sets this vector's w component to the provided value.
The value to set the w component to.
Sets this vector's x component to the provided value.
The value to set the x component to.
Sets this vector's y component to the provided value.
The value to set the y component to.
Sets this vector's z component to the provided value.
The value to set the z component to.
Subtracts the scalar s from this vector's x, y and z components.
The value to subtract to the x, y and z components of this vector.
Returns the components of this vector in an array of format [x, y, z, w].
The array to store the compoments of the vector in. If not specified, a new array will be created.
An offset into the array where to write the elements of this vector.
Creates a new Vector4