Internal
The typed array constructor type (Float32Array, Float64Array, etc.)
Creates a new mutable scalar with the specified value and type.
The typed array containing the scalar value
Configuration object containing the array type
The typed array constructor to use
Gets the number of bytes per component in the underlying typed array.
The number of bytes per element
Gets the class name of this vector instance.
The constructor name of the class
Gets the scalar value as a GLSL-compatible float string.
The scalar value formatted as a GLSL float literal
Gets the scalar value as a GLSL-compatible integer string.
The scalar value formatted as a GLSL integer literal
Gets the raw typed array containing the scalar value.
The underlying typed array
Gets the w component (always 1 for scalars).
Always returns 1
Gets the scalar value as a WGSL-compatible float string.
The scalar value formatted as a WGSL float literal
Gets the scalar value as a WGSL-compatible integer string.
The scalar value formatted as a WGSL integer literal
Gets the x component (scalar value).
The scalar value
Sets the x component (scalar value).
The new scalar value
Gets the y component (always 0 for scalars).
Always returns 0
Gets the z component (always 0 for scalars).
Always returns 0
Static
compositionGets the composition type for this scalar.
The scalar composition type
Calculates the dot product between this vector and another vector.
The vector to calculate dot product with
The dot product result
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
Sets the scalar value.
The new scalar value
This scalar instance for method chaining
Protected
Static
_dummyProtected
Creates a dummy (uninitialized) scalar instance.
The typed array constructor to use
A new dummy scalar instance
Protected
Static
_fromProtected
Creates a new scalar instance from a number value.
The numeric value to create the scalar from
The typed array constructor to use
A new scalar instance
Base class for mutable scalar values with typed array backing. This class extends the immutable Scalar_ class to provide mutable operations.