Creates a new 32-bit float scalar instance.
The typed array containing the scalar value
Gets the number of bytes per component in the underlying typed array.
The number of bytes per element
Gets the class name for debugging and reflection purposes.
The string "Scalar"
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 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 scalar value (alias for x component).
The scalar value
Static
compositionGets the composition type for scalar values.
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
Performs approximate equality comparison with another scalar within a tolerance.
The scalar to compare with
The tolerance for comparison (default: Number.EPSILON)
True if the scalars are equal within the specified tolerance
Performs strict equality comparison with another scalar. Uses exact floating-point comparison without tolerance.
The scalar to compare with
True if the scalars 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
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
Static
dummyStatic
fromStatic
oneStatic
zero
Immutable scalar class using 32-bit floating-point precision. Represents a single floating-point value with various utility methods for mathematical operations and format conversions.