import { SkeletonModifier } from './skeleton_modifier.js';

/**
 * Post-processor wrapper for joint dynamics systems.
 *
 * Integrates joint-based physics simulation into the skeleton post-processing pipeline.
 * The joint dynamics system is updated each frame and results are blended with the base animation.
 *
 * @public
 */ class JointDynamicsModifier extends SkeletonModifier {
    _jointDynamicsSystem;
    /**
   * Create a joint dynamics post-processor.
   *
   * @param jointDynamicsSystem - The joint dynamics system to integrate
   */ constructor(jointDynamicsSystem){
        super();
        this._jointDynamicsSystem = jointDynamicsSystem;
    }
    /**
   * Get the joint dynamics system.
   */ get jointDynamicsSystem() {
        return this._jointDynamicsSystem;
    }
    /**
   * Apply spring physics to skeleton joints.
   */ apply(_skeleton, deltaTime) {
        if (!this._enabled || this.weight <= 0) {
            return;
        }
        // Update spring physics simulation
        this._jointDynamicsSystem.update(deltaTime);
    }
    /**
   * Reset the spring system to initial state.
   */ reset() {
        this._jointDynamicsSystem.controller.reset();
    }
    warp() {
        this._jointDynamicsSystem.controller.warp();
    }
    _getWeight() {
        return 1 - this._jointDynamicsSystem.controller.blendRatio;
    }
    _setWeight(value) {
        this._jointDynamicsSystem.controller.blendRatio = 1 - Math.max(0, Math.min(1, value));
    }
}

export { JointDynamicsModifier };
//# sourceMappingURL=joint_dynamics_modifier.js.map
