rhodonite
    Preparing search index...

    Class AnimatedVectorN

    An animated vector class that extends VectorN and implements animation interpolation. This class manages multiple animation tracks and supports blending between them. It can interpolate vector values over time using animation samplers.

    Hierarchy (View Summary)

    Implements

    • IAnimatedValue
    Index
    • Creates a new AnimatedVectorN instance.

      Parameters

      • animationSamplers: AnimationSamplers

        Map of animation track names to their corresponding samplers

      • activeAnimationTrackName: string

        The name of the initially active animation track

      Returns AnimatedVectorN

      When the specified animation track is not found

    isLoop: boolean = true

    Whether the animation should loop when it reaches the end.

    • get blendingRatio(): number

      Gets the current blending ratio between animation tracks.

      Returns number

      The current blending ratio

    • set blendingRatio(value: number): void

      Sets the blending ratio between the first and second active animation tracks.

      Parameters

      • value: number

        The blending ratio (0.0 = first track only, 1.0 = second track only)

      Returns void

    • Creates a deep copy of this vector.

      Returns VectorN

      A new VectorN instance with the same components as this vector

    • Removes an animation sampler from the available tracks.

      Parameters

      • trackName: string

        The name of the animation track to remove

      Returns void

    • Gets all available animation track names.

      Returns string[]

      An array containing all animation track names

    • Gets the animation sampler for a specific track.

      Parameters

      • trackName: string

        The name of the animation track

      Returns AnimationSampler

      The animation sampler for the specified track

      When the animation track is not found

    • Parameters

      • i: number

      Returns number

    • Number of actual interpolations performed. Intended for tests and benchmarks.

      Returns number

    • Gets the track name of the sampler that is actually bound as the first animation. This can differ from the requested active track when that track has no sampler.

      Returns string

      The track name of the currently evaluated first sampler

    • Gets the name of the first active animation track.

      Returns string

      The name of the first active animation track

    • Gets the maximum end time for a specific animation track.

      Parameters

      • trackName: string

        The name of the animation track

      Returns number

      The maximum end input time for the track

      When the animation track is not found

    • Gets the minimum start time for a specific animation track.

      Parameters

      • trackName: string

        The name of the animation track

      Returns number

      The minimum start input time for the track

      When the animation track is not found

    • Gets the vector components as a plain number array.

      Returns number[]

      A new array containing the vector components

    • Gets the track name of the sampler that is actually bound as the second animation. This can differ from the requested active track when that track has no sampler.

      Returns string | undefined

      The track name of the currently evaluated second sampler, or undefined if none is bound

    • Gets the name of the second active animation track.

      Returns string | undefined

      The name of the second active animation track, or undefined if not set

    • Gets the internal value array without allocating a copy. Do not mutate the returned array.

      Returns TypedArray

    • Drops the memoized interpolation result. Call this after mutating sampler data directly.

      Returns void

    • Checks if this vector is a dummy vector (has no components).

      Returns boolean

      True if the vector has no components, false otherwise

    • Adds or updates an animation sampler for a specific track.

      Parameters

      • animationTrackName: string

        The name of the animation track

      • animationSampler: AnimationSampler

        The animation sampler to set for the track

      Returns void

    • Parameters

      • i: number
      • value: number

      Returns void

    • Sets the first active animation track by name.

      Parameters

      • animationTrackName: string

        The name of the animation track to set as first active

      Returns void

    • Sets the internal Float32Array and updates the animation state.

      Parameters

      • array: Float32Array

        The new Float32Array to set

      Returns void

    • Sets the second active animation track by name for blending purposes.

      Parameters

      • animationTrackName: string

        The name of the animation track to set as second active

      Returns void

    • Sets a specific time for animation evaluation instead of using global time.

      Parameters

      • time: number

        The time value to set for animation evaluation

      Returns void

    • Sets the time and blending ratio and evaluates the value at most once.

      Parameters

      • time: number
      • blendingRatio: number

      Returns void

    • Updates the vector values based on the current time and active animation tracks. Handles time looping, interpolation, and blending between multiple tracks.

      Returns void

    • Switches back to using the global animation time instead of a specific time.

      Returns void

    • Creates a dummy vector with no components.

      Returns VectorN

      A new dummy VectorN instance