Internal
The typed array constructor (Float32Array or Float64Array)
Creates a new Vector3_ instance.
The typed array containing the vector components
Configuration object containing the typed array constructor
Gets the number of bytes per component.
The number of bytes per component (4 for Float32Array, 8 for Float64Array)
Gets the class name.
The class name "Vector3"
Gets the GLSL representation of this vector as a float vec3.
A string representation suitable for GLSL shaders
Gets the GLSL representation of this vector as an integer ivec3.
A string representation suitable for GLSL shaders with integer components
Gets the W component of the vector (always returns 1 for homogeneous coordinates).
Always returns 1
Gets the WGSL representation of this vector as a float vec3f.
A string representation suitable for WGSL shaders
Gets the WGSL representation of this vector as an integer vec3i.
A string representation suitable for WGSL shaders with integer components
Gets the X component of the vector.
The X component value
Gets the Y component of the vector.
The Y component value
Gets the Z component of the vector.
The Z component value
Static
compositionGets the composition type for this vector class.
The composition type (Vec3)
Calculates the dot product of this vector with another vector.
The vector to calculate dot product with
The dot product result
Checks if this vector is approximately equal to another vector within a tolerance.
The vector to compare with
The tolerance for comparison (default: Number.EPSILON)
True if vectors are approximately equal, false otherwise
Checks if this vector is strictly equal to another vector (exact comparison).
The vector to compare with
True if vectors are exactly equal, false otherwise
Checks if the internal storage shares the same ArrayBuffer as the provided one. Useful for determining if vectors share underlying memory.
The ArrayBuffer to compare against
True if the same ArrayBuffer is used, false otherwise
Calculates the distance from this vector to another vector.
The target vector
The distance between the vectors
Static
_addAdds two vectors component-wise (static version).
The first vector
The second vector
The typed array constructor to use
A new vector containing the sum
Static
_crossCalculates the cross product of two vectors (static version).
The first vector (left operand)
The second vector (right operand)
The typed array constructor to use
A new vector containing the cross product result
Static
_divideDivides a vector by a scalar value (static version).
The vector to divide
The scalar value to divide by
The typed array constructor to use
A new vector containing the divided result
Static
_divideDivides two vectors component-wise (static version).
The vector to divide
The vector to divide by
The typed array constructor to use
A new vector containing the component-wise division result
Static
_dummyCreates an empty dummy vector for placeholder purposes.
The typed array constructor to use
A new dummy vector
Static
_fromCreates a vector from individual x, y, z components.
The x component
The y component
The z component
The typed array constructor to use
A new vector
Static
_fromCreates a vector from an array (takes first 3 elements).
The array containing the components
The typed array constructor to use
A new vector
Static
_fromCreates a vector from a 3-element array.
The array containing x, y, z components
The typed array constructor to use
A new vector
Static
_fromCreates a vector by copying from another Vector3.
The source vector to copy from
The typed array constructor to use
A new vector
Static
_fromCreates a Vector3 from a Vector4 (drops the w component).
The source Vector4 to copy from
The typed array constructor to use
A new vector
Static
_fromCreates a Vector3 from a Vector2 (sets z component to 0).
The source Vector2 to copy from
The typed array constructor to use
A new vector
Static
_lerpPerforms linear interpolation between two vectors (static version).
The start vector
The end vector
The interpolation ratio (0.0 to 1.0)
The typed array constructor to use
A new vector containing the interpolated result
Static
_multiplyMultiplies a vector by a scalar value (static version).
The vector to multiply
The scalar value to multiply by
The typed array constructor to use
A new vector containing the scaled result
Static
_multiplyTransforms a 3D vector by a 4x4 matrix, treating the vector as a point (w=1). The result is perspective-divided if the w component is not 1.
The vector to transform
The 4x4 transformation matrix
The typed array constructor to use
A new transformed vector
Static
_multiplyTransforms a vector by a quaternion rotation (static version). This applies the quaternion rotation to the vector.
The quaternion to apply
The vector to transform
The typed array constructor to use
A new vector containing the transformed result
Static
_multiplyMultiplies two vectors component-wise (static version).
The first vector
The second vector
The typed array constructor to use
A new vector containing the component-wise product
Static
_normalizeNormalizes a vector to unit length (static version).
The vector to normalize
The typed array constructor to use
A new normalized vector
Static
_oneCreates a vector with all components set to 1 (1, 1, 1).
The typed array constructor to use
A new vector with all components set to 1
Static
_subtractSubtracts the second vector from the first vector (static version).
The vector to subtract from
The vector to subtract
The typed array constructor to use
A new vector containing the difference
Static
_zeroCreates a zero vector (0, 0, 0).
The typed array constructor to use
A new zero vector
Static
addAdds two vectors and stores the result in the output vector.
The first vector
The second vector
The output vector to store the result
The output vector containing the sum
Static
angleStatic
crossCalculates the cross product of two vectors and stores the result in the output vector.
The first vector (left operand)
The second vector (right operand)
The output vector to store the result
The output vector containing the cross product result
Static
divideDivides a vector by a scalar and stores the result in the output vector.
The vector to divide
The scalar value to divide by
The output vector to store the result
The output vector containing the divided result
Static
divideDivides two vectors component-wise and stores the result in the output vector.
The vector to divide
The vector to divide by
The output vector to store the result
The output vector containing the component-wise division result
Static
dotStatic
lengthStatic
lengthCalculates the squared length of a vector (static version). This is more efficient than calculating the actual length when only comparison is needed.
The vector to calculate squared length for
The squared length of the vector
Static
multiplyTransforms a vector by a quaternion rotation and stores the result in the output vector. This applies the quaternion rotation to the vector.
The quaternion to apply
The vector to transform
The output vector to store the result
The output vector containing the transformed result
Static
multiplyMultiplies a vector by a scalar and stores the result in the output vector.
The vector to multiply
The scalar value to multiply by
The output vector to store the result
The output vector containing the scaled result
Static
multiplyMultiplies two vectors component-wise and stores the result in the output vector.
The first vector
The second vector
The output vector to store the result
The output vector containing the component-wise product
Static
normalizeNormalizes a vector and stores the result in the output vector.
The vector to normalize
The output vector to store the result
The output vector containing the normalized result
Static
subtractSubtracts two vectors and stores the result in the output vector.
The vector to subtract from
The vector to subtract
The output vector to store the result
The output vector containing the difference
Generic base class for 3D vectors with floating-point components. This class provides immutable 3D vector operations and serves as the foundation for both 32-bit and 64-bit precision vector implementations.