Strata - v1.4.10
    Preparing search index...

    Function calculateBlendWeights

    • Calculates blend weights for a 1D blend tree.

      Parameters

      • config: BlendTreeConfig

        Blend tree configuration

      • parameter: number

        Current parameter value

      Returns BlendWeights

      Calculated blend weights for each animation

      const config: BlendTreeConfig = {
      type: '1d',
      parameter: 'speed',
      nodes: [
      { animation: 'idle', threshold: 0 },
      { animation: 'walk', threshold: 0.5 },
      { animation: 'run', threshold: 1.0 }
      ]
      };
      const weights = calculateBlendWeights(config, 0.75);
      // { weights: { idle: 0, walk: 0.5, run: 0.5 }, hasActiveAnimations: true }