Creates a new Vector3D.
The x component. Defaults to 0.
The y component. Defaults to 0.
The z component. Defaults to 0.
The x component. Defaults to 0.
The y component. Defaults to 0.
The z component. Defaults to 0.
Static ReadonlyZEROStatic zero vector to avoid unnecessary allocations. Should be treated as read-only.
Adds a scalar value to all components.
The scalar to add.
this
Copies components from another vector.
The vector to copy from.
this
Calculates the cross product of this vector and another vector.
The other vector.
this
Calculates the Euclidean distance to another vector.
The other vector.
The distance.
Calculates the squared distance to another vector.
The other vector.
The squared distance.
Divides the vector by a scalar.
The scalar to divide by.
this
Calculates the dot product of this vector and another.
The other vector.
The dot product.
Calculates the Euclidean length of the vector.
The length.
Calculates the squared length of the vector.
The squared length.
Sets this vector's components to the maximum of its own and the given vector's.
The other vector.
this
Sets this vector's components to the minimum of its own and the given vector's.
The other vector.
this
Multiplies the vector components by another vector (component-wise).
The vector to multiply by.
this
Normalizes the vector to a unit length of 1.
this
Scales the vector by a scalar value.
The scalar factor.
this
Sets the components of the vector.
The x component.
The y component. Defaults to x.
The z component. Defaults to y.
this
Subtracts another vector from this one.
The vector to subtract.
this
Transforms the direction of this vector with a matrix. This ignores the translation component of the matrix.
The transformation matrix.
this
A class representing a 3D vector. Data is stored as individual properties for fast access in JS engines.