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 scalar value as a GLSL-compatible unsigned integer string.
The scalar value formatted as a GLSL unsigned integer literal with 'u' suffix
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 as a WGSL-compatible unsigned integer string.
The scalar value formatted as a WGSL unsigned integer literal with 'u' suffix
Gets the current scalar value, updating the animation if necessary.
The current scalar value
StaticcompositionGets the component value at the specified index.
The index of the component to retrieve
The component value at the given index
Deletes an animation sampler for the specified track name.
The name of the animation track to delete
Calculates the dot product between this vector and another vector.
The dot product result
Gets an array of all available animation track names.
An array containing all animation track names
Gets the animation sampler for the specified track name.
The name of the animation track
The animation sampler for the specified track
Gets the name of the first active animation track.
The name of the first active animation track
Returns the scalar value as an array of numbers.
An array containing the scalar value
Gets the name of the second active animation track.
The name of the second active animation track, or undefined if not set
Gets the scalar value as a number.
The scalar value
Gets the scalar value wrapped in an array.
An array containing the scalar value
Checks if this vector is a dummy (empty) vector. A dummy vector has no components and is typically used as a placeholder.
True if the vector is dummy, false otherwise
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 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
Sets the first active animation track by name.
The name of the animation track to set as the first active track
Sets the internal Float32Array and triggers an update.
The new Float32Array to set
Sets the second active animation track by name for blending purposes.
The name of the animation track to set as the second active track
Sets a specific time for animation playback.
The time value to set for animation sampling
Converts the scalar to a string representation.
A string representation of the scalar in the format "(value)"
Updates the animated scalar value based on the current time and active animation tracks. This method interpolates between keyframes and handles blending between two tracks if configured. The update is skipped if the time hasn't changed since the last update.
Clears the specific time and uses the default time (0) for animation updates. When used with AnimationComponent, the time will be set via setTime() during animation processing.
Gets the component value at the specified index. Alias for the at() method for convenience.
The index of the component to retrieve
The component value at the given index
Protected Static_ProtectedCreates a dummy (uninitialized) scalar instance.
The typed array constructor to use
A new dummy scalar instance
Protected Static_ProtectedCreates 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
StaticdummyStaticfromCreates a new scalar from a numeric value.
The numeric value to create the scalar from
A new Scalar instance
StaticoneStaticzero
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.