dist/server-module/lance-gg.js
/**
     * Apply in-place slerp (spherical linear interpolation) to this quaternion,
     * towards another quaternion.
     *
     * @param {Quaternion} target The target quaternion
     * @param {Number} bending The percentage to interpolate
     * @return {Quaternion} returns self
     */
Apply in-place slerp (spherical linear interpolation) to this quaternion,
towards another quaternion.

@param {Quaternion} target The target quaternion
@param {Number} bending The percentage to interpolate
@return {Quaternion} returns self
Apply in - place slerp ( spherical linear interpolation ) to this quaternion towards another quaternion . @param { Quaternion } target The target quaternion @param { Number } bending The percentage to interpolate @return { Quaternion } returns self
slerp(target, bending) {
        if (bending <= 0) return this;
        if (bending >= 1) return this.copy(target);
        let aw = this.w, ax = this.x, ay = this.y, az = this.z;
        let bw = target.w, bx = target.x, by = target.y, bz = target.z;
        let cosHalfTheta = aw*bw + ax*bx + ay*by + az*bz;
        if (cosHalfTheta < 0) {
            this.set(-bw, -bx, -by, -bz);
            cosHalfTheta = -cosHalfTheta;
        } else {
            this.copy(target);
        }
        if (cosHalfTheta >= 1.0) {
            this.set(aw, ax, ay, az);
            return this;
        }
        let sqrSinHalfTheta = 1.0 - cosHalfTheta*cosHalfTheta;
        if (sqrSinHalfTheta < Number.EPSILON) {
            let s = 1 - bending;
            this.set(s*aw + bending*this.w, s*ax + bending*this.x, s*ay + bending*this.y, s*az + bending*this.z);
            return this.normalize();
        }
        let sinHalfTheta = Math.sqrt(sqrSinHalfTheta);
        let halfTheta = Math.atan2(sinHalfTheta, cosHalfTheta);
        let delTheta = bending * halfTheta;
        if (Math.abs(delTheta) > MAX_DEL_THETA)
            delTheta = MAX_DEL_THETA * Math.sign(delTheta);
        let ratioA = Math.sin(halfTheta - delTheta)/sinHalfTheta;
        let ratioB = Math.sin(delTheta)/sinHalfTheta;
        this.set(aw*ratioA + this.w*ratioB,
            ax*ratioA + this.x*ratioB,
            ay*ratioA + this.y*ratioB,
            az*ratioA + this.z*ratioB);
        return this;
    }
slerp ( target , bending ) { if ( bending <= 0 ) return this ; if ( bending >= 1 ) return this . copy ( target ) ; let aw = this . w , ax = this . x , ay = this . y , az = this . z ; let bw = target . w , bx = target . x , by = target . y , bz = target . z ; let cosHalfTheta = aw * bw + ax * bx + ay * by + az * bz ; if ( cosHalfTheta < 0 ) { this . set ( - bw , - bx , - by , - bz ) ; cosHalfTheta = - cosHalfTheta ; } else { this . copy ( target ) ; } if ( cosHalfTheta >= 1.0 ) { this . set ( aw , ax , ay , az ) ; return this ; } let sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta ; if ( sqrSinHalfTheta < Number . EPSILON ) { let s = 1 - bending ; this . set ( s * aw + bending * this . w , s * ax + bending * this . x , s * ay + bending * this . y , s * az + bending * this . z ) ; return this . normalize ( ) ; } let sinHalfTheta = Math . sqrt ( sqrSinHalfTheta ) ; let halfTheta = Math . atan2 ( sinHalfTheta , cosHalfTheta ) ; let delTheta = bending * halfTheta ; if ( Math . abs ( delTheta ) > MAX_DEL_THETA ) delTheta = MAX_DEL_THETA * Math . sign ( delTheta ) ; let ratioA = Math . sin ( halfTheta - delTheta ) / sinHalfTheta ; let ratioB = Math . sin ( delTheta ) / sinHalfTheta ; this . set ( aw * ratioA + this . w * ratioB , ax * ratioA + this . x * ratioB , ay * ratioA + this . y * ratioB , az * ratioA + this . z * ratioB ) ; return this ; }
Apply in-place slerp (spherical linear interpolation) to this quaternion,
 towards another quaternion.
Apply in - place slerp ( spherical linear interpolation ) to this quaternion towards another quaternion .