Creates a new AnimatedScalar instance.
A map of animation track names to their corresponding samplers
The name of the initially active animation track
Internal typed array storage for vector components
Whether the animation should loop when it reaches the end.
Gets the current blending ratio between animation tracks.
The current blending ratio
Sets the blending ratio between the first and second animation tracks.
The blending ratio (0.0 = first track only, 1.0 = second track only)
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 current scalar value, updating the animation if necessary.
The current 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
Gets the animation sampler for the specified track name.
The name of the animation track
The animation sampler for the specified track
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
Sets or updates an animation sampler for the specified track name.
The name of the animation track
The animation sampler to associate with the track
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
A scalar value that can be animated using animation samplers. This class extends Scalar and implements both IScalar and IAnimatedValue interfaces. It supports blending between two animation tracks and can be configured to loop.