_vibrateString(event) {
    const amplitude = Math.abs(this._line.segments[1].point.y - (this._h/2));
    if (amplitude > 1) {
      // Move the closer to the center
      this._line.segments[1].point.y = 0.5 * this._h * (this.FRICTION + 1) - (this.FRICTION * this._line.segments[1].point.y);
    } else {
      // Attach the line to the center
      this._line.segments[1].point.y = this._h/2;

      this._endVibration();
    }
  }
/**
  * Simulate the vibration of the string. Event handler for onFrame.
  */
Simulate the vibration of the string. Event handler for onFrame.
Simulate the vibration of the string . Event handler for onFrame .
_vibrateString(event) {
    const amplitude = Math.abs(this._line.segments[1].point.y - (this._h/2));
    if (amplitude > 1) {
      this._line.segments[1].point.y = 0.5 * this._h * (this.FRICTION + 1) - (this.FRICTION * this._line.segments[1].point.y);
    } else {
      this._line.segments[1].point.y = this._h/2;
      this._endVibration();
    }
  }
_vibrateString ( event ) { const amplitude = Math . abs ( this . _line . segments [ 1 ] . point . y - ( this . _h / 2 ) ) ; if ( amplitude > 1 ) { this . _line . segments [ 1 ] . point . y = 0.5 * this . _h * ( this . FRICTION + 1 ) - ( this . FRICTION * this . _line . segments [ 1 ] . point . y ) ; } else { this . _line . segments [ 1 ] . point . y = this . _h / 2 ; this . _endVibration ( ) ; } }
Simulate the vibration of the string.
Simulate the vibration of the string .
// Move the closer to the center // Attach the line to the center