@fms-cat/experimental
Advanced tools
Comparing version 0.4.2 to 0.5.0-dev.201214
// (c) 2019-2020 FMS_Cat - https://github.com/FMS-Cat/experimental-npm/blob/master/LICENSE | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).FMS_CAT_EXPERIMENTAL={})}(this,(function(t){"use strict";function e(t,e){for(var n=0,r=e.length;n<r;){var i=n+r>>1;e[i]<t?n=i+1:r=i}return n}var n=function(){function t(){this.factor=100,this.ratio=1,this.velocity=0,this.value=0,this.target=0}return t.prototype.update=function(t){return this.velocity+=(-this.factor*(this.value-this.target)-2*this.velocity*Math.sqrt(this.factor)*this.ratio)*t,this.value+=this.velocity*t,this.value},t}(),r=function(){function t(){this.__time=0,this.__deltaTime=0,this.__isPlaying=!1}return Object.defineProperty(t.prototype,"time",{get:function(){return this.__time},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"deltaTime",{get:function(){return this.__deltaTime},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isPlaying",{get:function(){return this.__isPlaying},enumerable:!0,configurable:!0}),t.prototype.update=function(t){var e=this.__time;this.__time=t||0,this.__deltaTime=this.__time-e},t.prototype.play=function(){this.__isPlaying=!0},t.prototype.pause=function(){this.__isPlaying=!1},t.prototype.setTime=function(t){this.__time=t},t}(),i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function u(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(s(arguments[e]));return t}var a=function(t){function e(e){void 0===e&&(e=60);var n=t.call(this)||this;return n.__frame=0,n.__fps=e,n}return o(e,t),Object.defineProperty(e.prototype,"frame",{get:function(){return this.__frame},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fps",{get:function(){return this.__fps},enumerable:!0,configurable:!0}),e.prototype.update=function(){this.__isPlaying?(this.__time=this.__frame/this.__fps,this.__deltaTime=1/this.__fps,this.__frame++):this.__deltaTime=0},e.prototype.setTime=function(t){this.__frame=Math.floor(this.__fps*t),this.__time=this.__frame/this.__fps},e}(r),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.__rtTime=0,e.__rtDate=performance.now(),e}return o(e,t),Object.defineProperty(e.prototype,"isRealtime",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.update=function(){var t=performance.now();if(this.__isPlaying){var e=this.__time,n=t-this.__rtDate;this.__time=this.__rtTime+n/1e3,this.__deltaTime=this.time-e}else this.__rtTime=this.time,this.__rtDate=t,this.__deltaTime=0},e.prototype.setTime=function(t){this.__time=t,this.__rtTime=this.time,this.__rtDate=performance.now()},e}(r);function h(t,e,n,r){var i=0,o=new Float32Array(r);o[0]=0;var s=new Float32Array(r+1);s[0]=-1/0,s[1]=1/0;for(var u=new Float32Array(r),a=0;a<r;a++)u[a]=t[e+a*n];for(a=1;a<r;a++){for(var c=0;0<=i&&(c=(u[a]+a*a-u[o[i]]-o[i]*o[i])/(2*a-2*o[i]))<=s[i];)i--;o[++i]=a,s[i]=c,s[i+1]=1/0}i=0;for(a=0;a<r;a++){for(;s[i+1]<a;)i++;var h=a-o[i];t[e+a*n]=u[o[i]]+h*h}}function l(t,e,n){return t+(e-t)*n}function f(t,e,n){return Math.min(Math.max(t,e),n)}function _(t){return f(t,0,1)}function p(t,e,n){return _((n-t)/(e-t))}var y=function(){function t(){this.factor=10,this.target=0,this.value=0}return t.prototype.update=function(t){return this.value=l(this.target,this.value,Math.exp(-this.factor*t)),this.value},t}(),m=function(){function t(e,n,r){void 0===e&&(e=t.WordsDefault),void 0===n&&(n=1),void 0===r&&(r=100),this.__words=e,this.__index=n,this.__end=r}return t.prototype[Symbol.iterator]=function(){return this},t.prototype.next=function(){var t,e;if(this.__end<this.__index)return{done:!0,value:null};var n="";try{for(var r=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.__words),i=r.next();!i.done;i=r.next()){var o=s(i.value,2),u=o[0],a=o[1];this.__index%u==0&&(n+=a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return""===n&&(n=this.__index),this.__index++,{done:!1,value:n}},t.WordsDefault=new Map([[3,"Fizz"],[5,"Buzz"]]),t}(),d=function(){function t(){}return t.gif="https://fms-cat.com/images/fms_cat.gif",t.png="https://fms-cat.com/images/fms_cat.png",t}(),b=function(){function t(t){this.__recalcForEach=0,this.__countUntilRecalc=0,this.__history=[],this.__index=0,this.__count=0,this.__cache=0,this.__length=t,this.__recalcForEach=t;for(var e=0;e<t;e++)this.__history[e]=0}return Object.defineProperty(t.prototype,"mean",{get:function(){var t=Math.min(this.__count,this.__length);return 0===t?0:this.__cache/t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"recalcForEach",{get:function(){return this.__recalcForEach},set:function(t){var e=t-this.__recalcForEach;this.__recalcForEach=t,this.__countUntilRecalc=Math.max(0,this.__countUntilRecalc+e)},enumerable:!0,configurable:!0}),t.prototype.reset=function(){this.__index=0,this.__count=0,this.__cache=0,this.__countUntilRecalc=0;for(var t=0;t<this.__length;t++)this.__history[t]=0},t.prototype.push=function(t){var e=this.__history[this.__index];this.__history[this.__index]=t,this.__count++,this.__index=(this.__index+1)%this.__length,0===this.__countUntilRecalc?this.recalc():(this.__countUntilRecalc--,this.__cache-=e,this.__cache+=t)},t.prototype.recalc=function(){this.__countUntilRecalc=this.__recalcForEach;var t=this.__history.slice(0,Math.min(this.__count,this.__length)).reduce((function(t,e){return t+e}),0);this.__cache=t},t}(),g=function(){function t(t){this.__history=[],this.__sorted=[],this.__index=0,this.__length=t}return Object.defineProperty(t.prototype,"median",{get:function(){var t=Math.min(this.__sorted.length,this.__length);return this.__sorted[Math.floor((t-1)/2)]},enumerable:!0,configurable:!0}),t.prototype.reset=function(){this.__index=0,this.__history=[],this.__sorted=[]},t.prototype.push=function(t){var n=this.__history[this.__index];if(this.__history[this.__index]=t,this.__index=(this.__index+1)%this.__length,this.__sorted.length===this.__length){var r=e(n,this.__sorted);this.__sorted.splice(r,1)}var i=e(t,this.__sorted);this.__sorted.splice(i,0,t)},t}(),v=function(){function t(){}return Object.defineProperty(t.prototype,"length",{get:function(){return Math.sqrt(this.elements.reduce((function(t,e){return t+e*e}),0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"normalized",{get:function(){return this.scale(1/this.length)},enumerable:!0,configurable:!0}),t.prototype.clone=function(){return this.__new(this.elements.concat())},t.prototype.add=function(t){return this.__new(this.elements.map((function(e,n){return e+t.elements[n]})))},t.prototype.sub=function(t){return this.__new(this.elements.map((function(e,n){return e-t.elements[n]})))},t.prototype.multiply=function(t){return this.__new(this.elements.map((function(e,n){return e*t.elements[n]})))},t.prototype.divide=function(t){return this.__new(this.elements.map((function(e,n){return e/t.elements[n]})))},t.prototype.scale=function(t){return this.__new(this.elements.map((function(e){return e*t})))},t.prototype.dot=function(t){return this.elements.reduce((function(e,n,r){return e+n*t.elements[r]}),0)},t}(),x=function(t){function e(e){void 0===e&&(e=[0,0,0]);var n=t.call(this)||this;return n.elements=e,n}return o(e,t),Object.defineProperty(e.prototype,"x",{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return"Vector3( "+this.x.toFixed(3)+", "+this.y.toFixed(3)+", "+this.z.toFixed(3)+" )"},e.prototype.cross=function(t){return new e([this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x])},e.prototype.applyQuaternion=function(t){var n=new z([this.x,this.y,this.z,0]),r=t.inversed,i=t.multiply(n).multiply(r);return new e([i.x,i.y,i.z])},e.prototype.applyMatrix4=function(t){var n=t.elements,r=1/(n[3]*this.x+n[7]*this.y+n[11]*this.z+n[15]);return new e([(n[0]*this.x+n[4]*this.y+n[8]*this.z+n[12])*r,(n[1]*this.x+n[5]*this.y+n[9]*this.z+n[13])*r,(n[2]*this.x+n[6]*this.y+n[10]*this.z+n[14])*r])},e.prototype.__new=function(t){return new e(t)},Object.defineProperty(e,"zero",{get:function(){return new e([0,0,0])},enumerable:!0,configurable:!0}),Object.defineProperty(e,"one",{get:function(){return new e([1,1,1])},enumerable:!0,configurable:!0}),e}(v),w=[0,0,0,1],z=function(){function t(t){void 0===t&&(t=w),this.elements=t}return Object.defineProperty(t.prototype,"x",{get:function(){return this.elements[0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.elements[1]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"z",{get:function(){return this.elements[2]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"w",{get:function(){return this.elements[3]},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"Quaternion( "+this.x.toFixed(3)+", "+this.y.toFixed(3)+", "+this.z.toFixed(3)+", "+this.w.toFixed(3)+" )"},t.prototype.clone=function(){return new t(this.elements.concat())},Object.defineProperty(t.prototype,"matrix",{get:function(){var t=new x([1,0,0]).applyQuaternion(this),e=new x([0,1,0]).applyQuaternion(this),n=new x([0,0,1]).applyQuaternion(this);return new P([t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1])},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inversed",{get:function(){return new t([-this.x,-this.y,-this.z,this.w])},enumerable:!0,configurable:!0}),t.prototype.multiply=function(e){return new t([this.w*e.x+this.x*e.w+this.y*e.z-this.z*e.y,this.w*e.y-this.x*e.z+this.y*e.w+this.z*e.x,this.w*e.z+this.x*e.y-this.y*e.x+this.z*e.w,this.w*e.w-this.x*e.x-this.y*e.y-this.z*e.z])},Object.defineProperty(t,"identity",{get:function(){return new t(w)},enumerable:!0,configurable:!0}),t.fromAxisAngle=function(e,n){var r=n/2,i=Math.sin(r);return new t([e.x*i,e.y*i,e.z*i,Math.cos(r)])},t.fromMatrix=function(e){var n,r=e.elements,i=r[0],o=r[4],s=r[8],u=r[1],a=r[5],c=r[9],h=r[2],l=r[6],f=r[10],_=i+a+f;return new t(_>0?[(l-c)*(n=.5/Math.sqrt(_+1)),(s-h)*n,(u-o)*n,.25/n]:i>a&&i>f?[.25*(n=2*Math.sqrt(1+i-a-f)),(o+u)/n,(s+h)/n,(l-c)/n]:a>f?[(o+u)/(n=2*Math.sqrt(1+a-i-f)),.25*n,(c+l)/n,(s-h)/n]:[(s+h)/(n=2*Math.sqrt(1+f-i-a)),(c+l)/n,.25*n,(u-o)/n])},t}(),M=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],P=function(){function t(t){void 0===t&&(t=M),this.elements=t}return Object.defineProperty(t.prototype,"transpose",{get:function(){var e=this.elements;return new t([e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]])},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"determinant",{get:function(){var t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],u=t[6],a=t[7],c=t[8],h=t[9],l=t[10],f=t[11],_=t[12],p=t[13],y=t[14],m=t[15];return(e*s-n*o)*(l*m-f*y)-(e*u-r*o)*(h*m-f*p)+(e*a-i*o)*(h*y-l*p)+(n*u-r*s)*(c*m-f*_)-(n*a-i*s)*(c*y-l*_)+(r*a-i*u)*(c*p-h*_)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inverse",{get:function(){var e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],u=e[5],a=e[6],c=e[7],h=e[8],l=e[9],f=e[10],_=e[11],p=e[12],y=e[13],m=e[14],d=e[15],b=n*u-r*s,g=n*a-i*s,v=n*c-o*s,x=r*a-i*u,w=r*c-o*u,z=i*c-o*a,M=h*y-l*p,P=h*m-f*p,O=h*d-_*p,j=l*m-f*y,T=l*d-_*y,F=f*d-_*m,S=b*F-g*T+v*j+x*O-w*P+z*M;if(0===S)return null;var A=1/S;return new t([u*F-a*T+c*j,i*T-r*F-o*j,y*z-m*w+d*x,f*w-l*z-_*x,a*O-s*F-c*P,n*F-i*O+o*P,m*v-p*z-d*g,h*z-f*v+_*g,s*T-u*O+c*M,r*O-n*T-o*M,p*w-y*v+d*b,l*v-h*w-_*b,u*P-s*j-a*M,n*j-r*P+i*M,y*g-p*x-m*b,h*x-l*g+f*b].map((function(t){return t*A})))},enumerable:!0,configurable:!0}),t.prototype.toString=function(){var t=this.elements.map((function(t){return t.toFixed(3)}));return"Matrix4( "+t[0]+", "+t[4]+", "+t[8]+", "+t[12]+"; "+t[1]+", "+t[5]+", "+t[9]+", "+t[13]+"; "+t[2]+", "+t[6]+", "+t[10]+", "+t[14]+"; "+t[3]+", "+t[7]+", "+t[11]+", "+t[15]+" )"},t.prototype.clone=function(){return new t(this.elements.concat())},t.prototype.multiply=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0===e.length)return this.clone();var r=e.concat(),i=r.shift();0<r.length&&(i=i.multiply.apply(i,u(r)));var o=this.elements,s=i.elements;return new t([o[0]*s[0]+o[4]*s[1]+o[8]*s[2]+o[12]*s[3],o[1]*s[0]+o[5]*s[1]+o[9]*s[2]+o[13]*s[3],o[2]*s[0]+o[6]*s[1]+o[10]*s[2]+o[14]*s[3],o[3]*s[0]+o[7]*s[1]+o[11]*s[2]+o[15]*s[3],o[0]*s[4]+o[4]*s[5]+o[8]*s[6]+o[12]*s[7],o[1]*s[4]+o[5]*s[5]+o[9]*s[6]+o[13]*s[7],o[2]*s[4]+o[6]*s[5]+o[10]*s[6]+o[14]*s[7],o[3]*s[4]+o[7]*s[5]+o[11]*s[6]+o[15]*s[7],o[0]*s[8]+o[4]*s[9]+o[8]*s[10]+o[12]*s[11],o[1]*s[8]+o[5]*s[9]+o[9]*s[10]+o[13]*s[11],o[2]*s[8]+o[6]*s[9]+o[10]*s[10]+o[14]*s[11],o[3]*s[8]+o[7]*s[9]+o[11]*s[10]+o[15]*s[11],o[0]*s[12]+o[4]*s[13]+o[8]*s[14]+o[12]*s[15],o[1]*s[12]+o[5]*s[13]+o[9]*s[14]+o[13]*s[15],o[2]*s[12]+o[6]*s[13]+o[10]*s[14]+o[14]*s[15],o[3]*s[12]+o[7]*s[13]+o[11]*s[14]+o[15]*s[15]])},t.prototype.scaleScalar=function(e){return new t(this.elements.map((function(t){return t*e})))},Object.defineProperty(t,"identity",{get:function(){return new t(M)},enumerable:!0,configurable:!0}),t.multiply=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0===e.length)return t.identity;var r=e.concat(),i=r.shift();return i.multiply.apply(i,u(r))},t.translate=function(e){return new t([1,0,0,0,0,1,0,0,0,0,1,0,e.x,e.y,e.z,1])},t.scale=function(e){return new t([e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1])},t.scaleScalar=function(e){return new t([e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1])},t.rotateX=function(e){return new t([1,0,0,0,0,Math.cos(e),-Math.sin(e),0,0,Math.sin(e),Math.cos(e),0,0,0,0,1])},t.rotateY=function(e){return new t([Math.cos(e),0,Math.sin(e),0,0,1,0,0,-Math.sin(e),0,Math.cos(e),0,0,0,0,1])},t.rotateZ=function(e){return new t([Math.cos(e),-Math.sin(e),0,0,Math.sin(e),Math.cos(e),0,0,0,0,1,0,0,0,0,1])},t.lookAt=function(e,n,r,i){void 0===n&&(n=new x([0,0,0])),void 0===r&&(r=new x([0,1,0])),void 0===i&&(i=0);var o=e.sub(n).normalized,s=r.cross(o).normalized,u=o.cross(s);return s=s.scale(Math.cos(i)).add(u.scale(Math.sin(i))),u=o.cross(s),new t([s.x,s.y,s.z,0,u.x,u.y,u.z,0,o.x,o.y,o.z,0,e.x,e.y,e.z,1])},t.lookAtInverse=function(e,n,r,i){void 0===n&&(n=new x([0,0,0])),void 0===r&&(r=new x([0,1,0])),void 0===i&&(i=0);var o=e.sub(n).normalized,s=r.cross(o).normalized,u=o.cross(s);return s=s.scale(Math.cos(i)).add(u.scale(Math.sin(i))),u=o.cross(s),new t([s.x,u.x,o.x,0,s.y,u.y,o.y,0,s.z,u.z,o.z,0,-s.x*e.x-s.y*e.y-s.z*e.z,-u.x*e.x-u.y*e.y-u.z*e.z,-o.x*e.x-o.y*e.y-o.z*e.z,1])},t.perspective=function(e,n,r){void 0===e&&(e=45),void 0===n&&(n=.01),void 0===r&&(r=100);var i=1/Math.tan(e*Math.PI/360),o=r-n;return new t([i,0,0,0,0,i,0,0,0,0,-(r+n)/o,-1,0,0,-2*r*n/o,0])},t.prototype.decompose=function(){var t=this.elements,e=new x([t[0],t[1],t[2]]).length,n=new x([t[4],t[5],t[6]]).length,r=new x([t[8],t[9],t[10]]).length;this.determinant<0&&(e=-e);var i=1/e,o=1/n,s=1/r,u=this.clone();return u.elements[0]*=i,u.elements[1]*=i,u.elements[2]*=i,u.elements[4]*=o,u.elements[5]*=o,u.elements[6]*=o,u.elements[8]*=s,u.elements[9]*=s,u.elements[10]*=s,{position:new x([t[12],t[13],t[14]]),scale:new x([e,n,r]),rotation:z.fromMatrix(u)}},t.compose=function(e,n,r){var i=n.x,o=n.y,s=n.z,u=n.w,a=i+i,c=o+o,h=s+s,l=i*a,f=i*c,_=i*h,p=o*c,y=o*h,m=s*h,d=u*a,b=u*c,g=u*h,v=r.x,x=r.y,w=r.z;return new t([(1-(p+m))*v,(f+g)*v,(_-b)*v,0,(f-g)*x,(1-(l+m))*x,(y+d)*x,0,(_+b)*w,(y-d)*w,(1-(l+p))*w,0,e.x,e.y,e.z,1])},t}(),O=function(t){function e(e){void 0===e&&(e=[0,0,0,0]);var n=t.call(this)||this;return n.elements=e,n}return o(e,t),Object.defineProperty(e.prototype,"x",{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"w",{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return"Vector4( "+this.x.toFixed(3)+", "+this.y.toFixed(3)+", "+this.z.toFixed(3)+", "+this.w.toFixed(3)+" )"},e.prototype.applyMatrix4=function(t){var n=t.elements;return new e([n[0]*this.x+n[4]*this.y+n[8]*this.z+n[12]*this.w,n[1]*this.x+n[5]*this.y+n[9]*this.z+n[13]*this.w,n[2]*this.x+n[6]*this.y+n[10]*this.z+n[14]*this.w,n[3]*this.x+n[7]*this.y+n[11]*this.z+n[15]*this.w])},e.prototype.__new=function(t){return new e(t)},Object.defineProperty(e,"zero",{get:function(){return new e([0,0,0,0])},enumerable:!0,configurable:!0}),Object.defineProperty(e,"one",{get:function(){return new e([1,1,1,1])},enumerable:!0,configurable:!0}),e}(v),j=function(){function t(t,e){this.i=t,this.o=e}return t.prototype.swap=function(){var t=this.i;this.i=this.o,this.o=t},t}(),T=function(){function t(){this.__bpm=0,this.__lastTap=0,this.__lastBeat=0,this.__lastTime=0,this.__calc=new b(16)}return Object.defineProperty(t.prototype,"beatDuration",{get:function(){return 60/this.__bpm},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bpm",{get:function(){return this.__bpm},set:function(t){this.__lastBeat=this.beat,this.__lastTime=performance.now(),this.__bpm=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"beat",{get:function(){return this.__lastBeat+.001*(performance.now()-this.__lastTime)/this.beatDuration},enumerable:!0,configurable:!0}),t.prototype.reset=function(){this.__calc.reset()},t.prototype.nudge=function(t){this.__lastBeat=this.beat+t,this.__lastTime=performance.now()},t.prototype.tap=function(){var t=performance.now(),e=.001*(t-this.__lastTap);2<e?this.reset():(this.__calc.push(e),this.__bpm=60/this.__calc.mean),this.__lastTap=t,this.__lastTime=t,this.__lastBeat=0},t}(),F=function(){function t(t){this.seed=t||1}return t.prototype.gen=function(t){return t&&(this.seed=t),this.seed=this.seed^this.seed<<13,this.seed=this.seed^this.seed>>>17,this.seed=this.seed^this.seed<<5,this.seed/Math.pow(2,32)+.5},t.prototype.set=function(t){this.seed=t||this.seed||1},t}();t.CDS=n,t.Clock=r,t.ClockFrame=a,t.ClockRealtime=c,t.ExpSmooth=y,t.FMS_Cat=d,t.FizzBuzz=m,t.HistoryMeanCalculator=b,t.HistoryMedianCalculator=g,t.Matrix4=P,t.Quaternion=z,t.Swap=j,t.TRIANGLE_STRIP_QUAD=[-1,-1,1,-1,-1,1,1,1],t.TRIANGLE_STRIP_QUAD_3D=[-1,-1,0,1,-1,0,-1,1,0,1,1,0],t.TRIANGLE_STRIP_QUAD_NORMAL=[0,0,1,0,0,1,0,0,1,0,0,1],t.TRIANGLE_STRIP_QUAD_UV=[0,0,1,0,0,1,1,1],t.TapTempo=T,t.Vector=v,t.Vector3=x,t.Vector4=O,t.Xorshift=F,t.binarySearch=e,t.clamp=f,t.edt1d=h,t.edt2d=function(t,e,n){for(var r=0;r<e;r++)h(t,r,e,n);for(var i=0;i<n;i++)h(t,i*e,1,e)},t.lerp=l,t.linearstep=p,t.matrix2d=function(t,e){for(var n=[],r=0;r<e;r++)for(var i=0;i<t;i++)n.push(i,r);return n},t.range=function(t,e,n,r,i){return(t-e)*(i-r)/(n-e)+r},t.rawIdentityMatrix4=M,t.rawIdentityQuaternion=w,t.saturate=_,t.shuffleArray=function(t,e){for(var n=e||function(){return Math.random()},r=0;r<t.length-1;r++){var i=r+Math.floor(n()*(t.length-r)),o=t[i];t[i]=t[r],t[r]=o}return t},t.smootherstep=function(t,e,n){var r=p(t,e,n);return r*r*r*(r*(6*r-15)+10)},t.smootheststep=function(t,e,n){var r=p(t,e,n);return r*r*r*r*(r*(r*(-20*r+70)-84)+35)},t.smoothstep=function(t,e,n){var r=p(t,e,n);return r*r*(3-2*r)},t.triIndexToLineIndex=function(t){for(var e=[],n=0;n<t.length/3;n++){var r=3*n;e.push(t[r],t[r+1],t[r+1],t[r+2],t[r+2],t[r])}return e},Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).FMS_CAT_EXPERIMENTAL={})}(this,(function(t){"use strict";function e(t,n){if("function"!=typeof n)return e(t,(function(t){return t<=n}));for(var r=n,i=0,o=t.length;i<o;){var s=i+o>>1;r(t[s])?i=s+1:o=s}return i}var n=function(){function t(){this.factor=100,this.ratio=1,this.velocity=0,this.value=0,this.target=0}return t.prototype.update=function(t){return this.velocity+=(-this.factor*(this.value-this.target)-2*this.velocity*Math.sqrt(this.factor)*this.ratio)*t,this.value+=this.velocity*t,this.value},t}(),r=function(){function t(){this.__time=0,this.__deltaTime=0,this.__isPlaying=!1}return Object.defineProperty(t.prototype,"time",{get:function(){return this.__time},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"deltaTime",{get:function(){return this.__deltaTime},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isPlaying",{get:function(){return this.__isPlaying},enumerable:!0,configurable:!0}),t.prototype.update=function(t){var e=this.__time;this.__time=t||0,this.__deltaTime=this.__time-e},t.prototype.play=function(){this.__isPlaying=!0},t.prototype.pause=function(){this.__isPlaying=!1},t.prototype.setTime=function(t){this.__time=t},t}(),i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function u(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(s(arguments[e]));return t}var a=function(t){function e(e){void 0===e&&(e=60);var n=t.call(this)||this;return n.__frame=0,n.__fps=e,n}return o(e,t),Object.defineProperty(e.prototype,"frame",{get:function(){return this.__frame},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fps",{get:function(){return this.__fps},enumerable:!0,configurable:!0}),e.prototype.update=function(){this.__isPlaying?(this.__time=this.__frame/this.__fps,this.__deltaTime=1/this.__fps,this.__frame++):this.__deltaTime=0},e.prototype.setTime=function(t){this.__frame=Math.floor(this.__fps*t),this.__time=this.__frame/this.__fps},e}(r),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.__rtTime=0,e.__rtDate=performance.now(),e}return o(e,t),Object.defineProperty(e.prototype,"isRealtime",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.update=function(){var t=performance.now();if(this.__isPlaying){var e=this.__time,n=t-this.__rtDate;this.__time=this.__rtTime+n/1e3,this.__deltaTime=this.time-e}else this.__rtTime=this.time,this.__rtDate=t,this.__deltaTime=0},e.prototype.setTime=function(t){this.__time=t,this.__rtTime=this.time,this.__rtDate=performance.now()},e}(r);function h(t,e,n,r){var i=0,o=new Float32Array(r);o[0]=0;var s=new Float32Array(r+1);s[0]=-1/0,s[1]=1/0;for(var u=new Float32Array(r),a=0;a<r;a++)u[a]=t[e+a*n];for(a=1;a<r;a++){for(var c=0;0<=i&&(c=(u[a]+a*a-u[o[i]]-o[i]*o[i])/(2*a-2*o[i]))<=s[i];)i--;o[++i]=a,s[i]=c,s[i+1]=1/0}i=0;for(a=0;a<r;a++){for(;s[i+1]<a;)i++;var h=a-o[i];t[e+a*n]=u[o[i]]+h*h}}function l(t,e,n){return t+(e-t)*n}function f(t,e,n){return Math.min(Math.max(t,e),n)}function _(t){return f(t,0,1)}function p(t,e,n){return _((n-t)/(e-t))}var y=function(){function t(){this.factor=10,this.target=0,this.value=0}return t.prototype.update=function(t){return this.value=l(this.target,this.value,Math.exp(-this.factor*t)),this.value},t}(),m=function(){function t(e,n,r){void 0===e&&(e=t.WordsDefault),void 0===n&&(n=1),void 0===r&&(r=100),this.__words=e,this.__index=n,this.__end=r}return t.prototype[Symbol.iterator]=function(){return this},t.prototype.next=function(){var t,e;if(this.__end<this.__index)return{done:!0,value:null};var n="";try{for(var r=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.__words),i=r.next();!i.done;i=r.next()){var o=s(i.value,2),u=o[0],a=o[1];this.__index%u==0&&(n+=a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return""===n&&(n=this.__index),this.__index++,{done:!1,value:n}},t.WordsDefault=new Map([[3,"Fizz"],[5,"Buzz"]]),t}(),d=function(){function t(){}return t.gif="https://fms-cat.com/images/fms_cat.gif",t.png="https://fms-cat.com/images/fms_cat.png",t}(),b=function(){function t(t){this.__recalcForEach=0,this.__countUntilRecalc=0,this.__history=[],this.__index=0,this.__count=0,this.__cache=0,this.__length=t,this.__recalcForEach=t;for(var e=0;e<t;e++)this.__history[e]=0}return Object.defineProperty(t.prototype,"mean",{get:function(){var t=Math.min(this.__count,this.__length);return 0===t?0:this.__cache/t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"recalcForEach",{get:function(){return this.__recalcForEach},set:function(t){var e=t-this.__recalcForEach;this.__recalcForEach=t,this.__countUntilRecalc=Math.max(0,this.__countUntilRecalc+e)},enumerable:!0,configurable:!0}),t.prototype.reset=function(){this.__index=0,this.__count=0,this.__cache=0,this.__countUntilRecalc=0;for(var t=0;t<this.__length;t++)this.__history[t]=0},t.prototype.push=function(t){var e=this.__history[this.__index];this.__history[this.__index]=t,this.__count++,this.__index=(this.__index+1)%this.__length,0===this.__countUntilRecalc?this.recalc():(this.__countUntilRecalc--,this.__cache-=e,this.__cache+=t)},t.prototype.recalc=function(){this.__countUntilRecalc=this.__recalcForEach;var t=this.__history.slice(0,Math.min(this.__count,this.__length)).reduce((function(t,e){return t+e}),0);this.__cache=t},t}(),g=function(t){function e(e){var n=t.call(this,e)||this;return console.warn("HistoryMedianCalculator: Deprecated. Use HistoryPercentileCalculator instead"),n}return o(e,t),e}(function(){function t(t){this.__history=[],this.__sorted=[],this.__index=0,this.__length=t}return Object.defineProperty(t.prototype,"median",{get:function(){return this.percentile(50)},enumerable:!0,configurable:!0}),t.prototype.percentile=function(t){return 0===this.__history.length?0:this.__sorted[Math.round(.01*t*(this.__history.length-1))]},t.prototype.reset=function(){this.__index=0,this.__history=[],this.__sorted=[]},t.prototype.push=function(t){var n=this.__history[this.__index];if(this.__history[this.__index]=t,this.__index=(this.__index+1)%this.__length,this.__sorted.length===this.__length){var r=e(this.__sorted,n);this.__sorted.splice(r,1)}var i=e(this.__sorted,t);this.__sorted.splice(i,0,t)},t}()),v=function(){function t(){}return Object.defineProperty(t.prototype,"length",{get:function(){return Math.sqrt(this.elements.reduce((function(t,e){return t+e*e}),0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"normalized",{get:function(){return this.scale(1/this.length)},enumerable:!0,configurable:!0}),t.prototype.clone=function(){return this.__new(this.elements.concat())},t.prototype.add=function(t){return this.__new(this.elements.map((function(e,n){return e+t.elements[n]})))},t.prototype.sub=function(t){return this.__new(this.elements.map((function(e,n){return e-t.elements[n]})))},t.prototype.multiply=function(t){return this.__new(this.elements.map((function(e,n){return e*t.elements[n]})))},t.prototype.divide=function(t){return this.__new(this.elements.map((function(e,n){return e/t.elements[n]})))},t.prototype.scale=function(t){return this.__new(this.elements.map((function(e){return e*t})))},t.prototype.dot=function(t){return this.elements.reduce((function(e,n,r){return e+n*t.elements[r]}),0)},t}(),x=function(t){function e(e){void 0===e&&(e=[0,0,0]);var n=t.call(this)||this;return n.elements=e,n}return o(e,t),Object.defineProperty(e.prototype,"x",{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return"Vector3( "+this.x.toFixed(3)+", "+this.y.toFixed(3)+", "+this.z.toFixed(3)+" )"},e.prototype.cross=function(t){return new e([this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x])},e.prototype.applyQuaternion=function(t){var n=new z([this.x,this.y,this.z,0]),r=t.inversed,i=t.multiply(n).multiply(r);return new e([i.x,i.y,i.z])},e.prototype.applyMatrix4=function(t){var n=t.elements,r=1/(n[3]*this.x+n[7]*this.y+n[11]*this.z+n[15]);return new e([(n[0]*this.x+n[4]*this.y+n[8]*this.z+n[12])*r,(n[1]*this.x+n[5]*this.y+n[9]*this.z+n[13])*r,(n[2]*this.x+n[6]*this.y+n[10]*this.z+n[14])*r])},e.prototype.__new=function(t){return new e(t)},Object.defineProperty(e,"zero",{get:function(){return new e([0,0,0])},enumerable:!0,configurable:!0}),Object.defineProperty(e,"one",{get:function(){return new e([1,1,1])},enumerable:!0,configurable:!0}),e}(v),w=[0,0,0,1],z=function(){function t(t){void 0===t&&(t=w),this.elements=t}return Object.defineProperty(t.prototype,"x",{get:function(){return this.elements[0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.elements[1]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"z",{get:function(){return this.elements[2]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"w",{get:function(){return this.elements[3]},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"Quaternion( "+this.x.toFixed(3)+", "+this.y.toFixed(3)+", "+this.z.toFixed(3)+", "+this.w.toFixed(3)+" )"},t.prototype.clone=function(){return new t(this.elements.concat())},Object.defineProperty(t.prototype,"matrix",{get:function(){var t=new x([1,0,0]).applyQuaternion(this),e=new x([0,1,0]).applyQuaternion(this),n=new x([0,0,1]).applyQuaternion(this);return new P([t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1])},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inversed",{get:function(){return new t([-this.x,-this.y,-this.z,this.w])},enumerable:!0,configurable:!0}),t.prototype.multiply=function(e){return new t([this.w*e.x+this.x*e.w+this.y*e.z-this.z*e.y,this.w*e.y-this.x*e.z+this.y*e.w+this.z*e.x,this.w*e.z+this.x*e.y-this.y*e.x+this.z*e.w,this.w*e.w-this.x*e.x-this.y*e.y-this.z*e.z])},Object.defineProperty(t,"identity",{get:function(){return new t(w)},enumerable:!0,configurable:!0}),t.fromAxisAngle=function(e,n){var r=n/2,i=Math.sin(r);return new t([e.x*i,e.y*i,e.z*i,Math.cos(r)])},t.fromMatrix=function(e){var n,r=e.elements,i=r[0],o=r[4],s=r[8],u=r[1],a=r[5],c=r[9],h=r[2],l=r[6],f=r[10],_=i+a+f;return new t(_>0?[(l-c)*(n=.5/Math.sqrt(_+1)),(s-h)*n,(u-o)*n,.25/n]:i>a&&i>f?[.25*(n=2*Math.sqrt(1+i-a-f)),(o+u)/n,(s+h)/n,(l-c)/n]:a>f?[(o+u)/(n=2*Math.sqrt(1+a-i-f)),.25*n,(c+l)/n,(s-h)/n]:[(s+h)/(n=2*Math.sqrt(1+f-i-a)),(c+l)/n,.25*n,(u-o)/n])},t}(),M=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],P=function(){function t(t){void 0===t&&(t=M),this.elements=t}return Object.defineProperty(t.prototype,"transpose",{get:function(){var e=this.elements;return new t([e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]])},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"determinant",{get:function(){var t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],u=t[6],a=t[7],c=t[8],h=t[9],l=t[10],f=t[11],_=t[12],p=t[13],y=t[14],m=t[15];return(e*s-n*o)*(l*m-f*y)-(e*u-r*o)*(h*m-f*p)+(e*a-i*o)*(h*y-l*p)+(n*u-r*s)*(c*m-f*_)-(n*a-i*s)*(c*y-l*_)+(r*a-i*u)*(c*p-h*_)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inverse",{get:function(){var e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],u=e[5],a=e[6],c=e[7],h=e[8],l=e[9],f=e[10],_=e[11],p=e[12],y=e[13],m=e[14],d=e[15],b=n*u-r*s,g=n*a-i*s,v=n*c-o*s,x=r*a-i*u,w=r*c-o*u,z=i*c-o*a,M=h*y-l*p,P=h*m-f*p,O=h*d-_*p,j=l*m-f*y,T=l*d-_*y,F=f*d-_*m,S=b*F-g*T+v*j+x*O-w*P+z*M;if(0===S)return null;var A=1/S;return new t([u*F-a*T+c*j,i*T-r*F-o*j,y*z-m*w+d*x,f*w-l*z-_*x,a*O-s*F-c*P,n*F-i*O+o*P,m*v-p*z-d*g,h*z-f*v+_*g,s*T-u*O+c*M,r*O-n*T-o*M,p*w-y*v+d*b,l*v-h*w-_*b,u*P-s*j-a*M,n*j-r*P+i*M,y*g-p*x-m*b,h*x-l*g+f*b].map((function(t){return t*A})))},enumerable:!0,configurable:!0}),t.prototype.toString=function(){var t=this.elements.map((function(t){return t.toFixed(3)}));return"Matrix4( "+t[0]+", "+t[4]+", "+t[8]+", "+t[12]+"; "+t[1]+", "+t[5]+", "+t[9]+", "+t[13]+"; "+t[2]+", "+t[6]+", "+t[10]+", "+t[14]+"; "+t[3]+", "+t[7]+", "+t[11]+", "+t[15]+" )"},t.prototype.clone=function(){return new t(this.elements.concat())},t.prototype.multiply=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0===e.length)return this.clone();var r=e.concat(),i=r.shift();0<r.length&&(i=i.multiply.apply(i,u(r)));var o=this.elements,s=i.elements;return new t([o[0]*s[0]+o[4]*s[1]+o[8]*s[2]+o[12]*s[3],o[1]*s[0]+o[5]*s[1]+o[9]*s[2]+o[13]*s[3],o[2]*s[0]+o[6]*s[1]+o[10]*s[2]+o[14]*s[3],o[3]*s[0]+o[7]*s[1]+o[11]*s[2]+o[15]*s[3],o[0]*s[4]+o[4]*s[5]+o[8]*s[6]+o[12]*s[7],o[1]*s[4]+o[5]*s[5]+o[9]*s[6]+o[13]*s[7],o[2]*s[4]+o[6]*s[5]+o[10]*s[6]+o[14]*s[7],o[3]*s[4]+o[7]*s[5]+o[11]*s[6]+o[15]*s[7],o[0]*s[8]+o[4]*s[9]+o[8]*s[10]+o[12]*s[11],o[1]*s[8]+o[5]*s[9]+o[9]*s[10]+o[13]*s[11],o[2]*s[8]+o[6]*s[9]+o[10]*s[10]+o[14]*s[11],o[3]*s[8]+o[7]*s[9]+o[11]*s[10]+o[15]*s[11],o[0]*s[12]+o[4]*s[13]+o[8]*s[14]+o[12]*s[15],o[1]*s[12]+o[5]*s[13]+o[9]*s[14]+o[13]*s[15],o[2]*s[12]+o[6]*s[13]+o[10]*s[14]+o[14]*s[15],o[3]*s[12]+o[7]*s[13]+o[11]*s[14]+o[15]*s[15]])},t.prototype.scaleScalar=function(e){return new t(this.elements.map((function(t){return t*e})))},Object.defineProperty(t,"identity",{get:function(){return new t(M)},enumerable:!0,configurable:!0}),t.multiply=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0===e.length)return t.identity;var r=e.concat(),i=r.shift();return i.multiply.apply(i,u(r))},t.translate=function(e){return new t([1,0,0,0,0,1,0,0,0,0,1,0,e.x,e.y,e.z,1])},t.scale=function(e){return new t([e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1])},t.scaleScalar=function(e){return new t([e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1])},t.rotateX=function(e){return new t([1,0,0,0,0,Math.cos(e),-Math.sin(e),0,0,Math.sin(e),Math.cos(e),0,0,0,0,1])},t.rotateY=function(e){return new t([Math.cos(e),0,Math.sin(e),0,0,1,0,0,-Math.sin(e),0,Math.cos(e),0,0,0,0,1])},t.rotateZ=function(e){return new t([Math.cos(e),-Math.sin(e),0,0,Math.sin(e),Math.cos(e),0,0,0,0,1,0,0,0,0,1])},t.lookAt=function(e,n,r,i){void 0===n&&(n=new x([0,0,0])),void 0===r&&(r=new x([0,1,0])),void 0===i&&(i=0);var o=e.sub(n).normalized,s=r.cross(o).normalized,u=o.cross(s);return s=s.scale(Math.cos(i)).add(u.scale(Math.sin(i))),u=o.cross(s),new t([s.x,s.y,s.z,0,u.x,u.y,u.z,0,o.x,o.y,o.z,0,e.x,e.y,e.z,1])},t.lookAtInverse=function(e,n,r,i){void 0===n&&(n=new x([0,0,0])),void 0===r&&(r=new x([0,1,0])),void 0===i&&(i=0);var o=e.sub(n).normalized,s=r.cross(o).normalized,u=o.cross(s);return s=s.scale(Math.cos(i)).add(u.scale(Math.sin(i))),u=o.cross(s),new t([s.x,u.x,o.x,0,s.y,u.y,o.y,0,s.z,u.z,o.z,0,-s.x*e.x-s.y*e.y-s.z*e.z,-u.x*e.x-u.y*e.y-u.z*e.z,-o.x*e.x-o.y*e.y-o.z*e.z,1])},t.perspective=function(e,n,r){void 0===e&&(e=45),void 0===n&&(n=.01),void 0===r&&(r=100);var i=1/Math.tan(e*Math.PI/360),o=r-n;return new t([i,0,0,0,0,i,0,0,0,0,-(r+n)/o,-1,0,0,-2*r*n/o,0])},t.prototype.decompose=function(){var t=this.elements,e=new x([t[0],t[1],t[2]]).length,n=new x([t[4],t[5],t[6]]).length,r=new x([t[8],t[9],t[10]]).length;this.determinant<0&&(e=-e);var i=1/e,o=1/n,s=1/r,u=this.clone();return u.elements[0]*=i,u.elements[1]*=i,u.elements[2]*=i,u.elements[4]*=o,u.elements[5]*=o,u.elements[6]*=o,u.elements[8]*=s,u.elements[9]*=s,u.elements[10]*=s,{position:new x([t[12],t[13],t[14]]),scale:new x([e,n,r]),rotation:z.fromMatrix(u)}},t.compose=function(e,n,r){var i=n.x,o=n.y,s=n.z,u=n.w,a=i+i,c=o+o,h=s+s,l=i*a,f=i*c,_=i*h,p=o*c,y=o*h,m=s*h,d=u*a,b=u*c,g=u*h,v=r.x,x=r.y,w=r.z;return new t([(1-(p+m))*v,(f+g)*v,(_-b)*v,0,(f-g)*x,(1-(l+m))*x,(y+d)*x,0,(_+b)*w,(y-d)*w,(1-(l+p))*w,0,e.x,e.y,e.z,1])},t}(),O=function(t){function e(e){void 0===e&&(e=[0,0,0,0]);var n=t.call(this)||this;return n.elements=e,n}return o(e,t),Object.defineProperty(e.prototype,"x",{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"w",{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return"Vector4( "+this.x.toFixed(3)+", "+this.y.toFixed(3)+", "+this.z.toFixed(3)+", "+this.w.toFixed(3)+" )"},e.prototype.applyMatrix4=function(t){var n=t.elements;return new e([n[0]*this.x+n[4]*this.y+n[8]*this.z+n[12]*this.w,n[1]*this.x+n[5]*this.y+n[9]*this.z+n[13]*this.w,n[2]*this.x+n[6]*this.y+n[10]*this.z+n[14]*this.w,n[3]*this.x+n[7]*this.y+n[11]*this.z+n[15]*this.w])},e.prototype.__new=function(t){return new e(t)},Object.defineProperty(e,"zero",{get:function(){return new e([0,0,0,0])},enumerable:!0,configurable:!0}),Object.defineProperty(e,"one",{get:function(){return new e([1,1,1,1])},enumerable:!0,configurable:!0}),e}(v),j=function(){function t(t,e){this.i=t,this.o=e}return t.prototype.swap=function(){var t=this.i;this.i=this.o,this.o=t},t}(),T=function(){function t(){this.__bpm=0,this.__lastTap=0,this.__lastBeat=0,this.__lastTime=0,this.__calc=new b(16)}return Object.defineProperty(t.prototype,"beatDuration",{get:function(){return 60/this.__bpm},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bpm",{get:function(){return this.__bpm},set:function(t){this.__lastBeat=this.beat,this.__lastTime=performance.now(),this.__bpm=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"beat",{get:function(){return this.__lastBeat+.001*(performance.now()-this.__lastTime)/this.beatDuration},enumerable:!0,configurable:!0}),t.prototype.reset=function(){this.__calc.reset()},t.prototype.nudge=function(t){this.__lastBeat=this.beat+t,this.__lastTime=performance.now()},t.prototype.tap=function(){var t=performance.now(),e=.001*(t-this.__lastTap);2<e?this.reset():(this.__calc.push(e),this.__bpm=60/this.__calc.mean),this.__lastTap=t,this.__lastTime=t,this.__lastBeat=0},t}(),F=function(){function t(t){this.seed=t||1}return t.prototype.gen=function(t){return t&&(this.seed=t),this.seed=this.seed^this.seed<<13,this.seed=this.seed^this.seed>>>17,this.seed=this.seed^this.seed<<5,this.seed/Math.pow(2,32)+.5},t.prototype.set=function(t){this.seed=t||this.seed||1},t}();t.CDS=n,t.Clock=r,t.ClockFrame=a,t.ClockRealtime=c,t.ExpSmooth=y,t.FMS_Cat=d,t.FizzBuzz=m,t.HistoryMeanCalculator=b,t.HistoryMedianCalculator=g,t.Matrix4=P,t.Quaternion=z,t.Swap=j,t.TRIANGLE_STRIP_QUAD=[-1,-1,1,-1,-1,1,1,1],t.TRIANGLE_STRIP_QUAD_3D=[-1,-1,0,1,-1,0,-1,1,0,1,1,0],t.TRIANGLE_STRIP_QUAD_NORMAL=[0,0,1,0,0,1,0,0,1,0,0,1],t.TRIANGLE_STRIP_QUAD_UV=[0,0,1,0,0,1,1,1],t.TapTempo=T,t.Vector=v,t.Vector3=x,t.Vector4=O,t.Xorshift=F,t.binarySearch=e,t.clamp=f,t.edt1d=h,t.edt2d=function(t,e,n){for(var r=0;r<e;r++)h(t,r,e,n);for(var i=0;i<n;i++)h(t,i*e,1,e)},t.lerp=l,t.linearstep=p,t.matrix2d=function(t,e){for(var n=[],r=0;r<e;r++)for(var i=0;i<t;i++)n.push(i,r);return n},t.range=function(t,e,n,r,i){return(t-e)*(i-r)/(n-e)+r},t.rawIdentityMatrix4=M,t.rawIdentityQuaternion=w,t.saturate=_,t.shuffleArray=function(t,e){for(var n=e||function(){return Math.random()},r=0;r<t.length-1;r++){var i=r+Math.floor(n()*(t.length-r)),o=t[i];t[i]=t[r],t[r]=o}return t},t.smootherstep=function(t,e,n){var r=p(t,e,n);return r*r*r*(r*(6*r-15)+10)},t.smootheststep=function(t,e,n){var r=p(t,e,n);return r*r*r*r*(r*(r*(-20*r+70)-84)+35)},t.smoothstep=function(t,e,n){var r=p(t,e,n);return r*r*(3-2*r)},t.triIndexToLineIndex=function(t){for(var e=[],n=0;n<t.length/3;n++){var r=3*n;e.push(t[r],t[r+1],t[r+1],t[r+2],t[r+2],t[r])}return e},Object.defineProperty(t,"__esModule",{value:!0})})); |
// (c) 2019-2020 FMS_Cat - https://github.com/FMS-Cat/experimental-npm/blob/master/LICENSE | ||
function t(t,e){let s=0,i=e.length;for(;s<i;){const n=s+i>>1;e[n]<t?s=n+1:i=n}return s}const e=[-1,-1,1,-1,-1,1,1,1],s=[-1,-1,0,1,-1,0,-1,1,0,1,1,0],i=[0,0,1,0,0,1,0,0,1,0,0,1],n=[0,0,1,0,0,1,1,1];function h(t,e){const s=e||(()=>Math.random());for(let e=0;e<t.length-1;e++){const i=e+Math.floor(s()*(t.length-e)),n=t[i];t[i]=t[e],t[e]=n}return t}function r(t){const e=[];for(let s=0;s<t.length/3;s++){const i=3*s;e.push(t[i],t[i+1],t[i+1],t[i+2],t[i+2],t[i])}return e}function _(t,e){const s=[];for(let i=0;i<e;i++)for(let e=0;e<t;e++)s.push(e,i);return s}class a{constructor(){this.factor=100,this.ratio=1,this.velocity=0,this.value=0,this.target=0}update(t){return this.velocity+=(-this.factor*(this.value-this.target)-2*this.velocity*Math.sqrt(this.factor)*this.ratio)*t,this.value+=this.velocity*t,this.value}}class c{constructor(){this.__time=0,this.__deltaTime=0,this.__isPlaying=!1}get time(){return this.__time}get deltaTime(){return this.__deltaTime}get isPlaying(){return this.__isPlaying}update(t){const e=this.__time;this.__time=t||0,this.__deltaTime=this.__time-e}play(){this.__isPlaying=!0}pause(){this.__isPlaying=!1}setTime(t){this.__time=t}}class o extends c{constructor(t=60){super(),this.__frame=0,this.__fps=t}get frame(){return this.__frame}get fps(){return this.__fps}update(){this.__isPlaying?(this.__time=this.__frame/this.__fps,this.__deltaTime=1/this.__fps,this.__frame++):this.__deltaTime=0}setTime(t){this.__frame=Math.floor(this.__fps*t),this.__time=this.__frame/this.__fps}}class l extends c{constructor(){super(...arguments),this.__rtTime=0,this.__rtDate=performance.now()}get isRealtime(){return!0}update(){const t=performance.now();if(this.__isPlaying){const e=this.__time,s=t-this.__rtDate;this.__time=this.__rtTime+s/1e3,this.__deltaTime=this.time-e}else this.__rtTime=this.time,this.__rtDate=t,this.__deltaTime=0}setTime(t){this.__time=t,this.__rtTime=this.time,this.__rtDate=performance.now()}}function u(t,e,s,i){let n=0;const h=new Float32Array(i);h[0]=0;const r=new Float32Array(i+1);r[0]=-1/0,r[1]=1/0;const _=new Float32Array(i);for(let n=0;n<i;n++)_[n]=t[e+n*s];for(let t=1;t<i;t++){let e=0;for(;0<=n&&(e=(_[t]+t*t-_[h[n]]-h[n]*h[n])/(2*t-2*h[n]),e<=r[n]);)n--;n++,h[n]=t,r[n]=e,r[n+1]=1/0}n=0;for(let a=0;a<i;a++){for(;r[n+1]<a;)n++;const i=a-h[n];t[e+a*s]=_[h[n]]+i*i}}function m(t,e,s){for(let i=0;i<e;i++)u(t,i,e,s);for(let i=0;i<s;i++)u(t,i*e,1,e)}function d(t,e,s){return t+(e-t)*s}function x(t,e,s){return Math.min(Math.max(t,e),s)}function y(t){return x(t,0,1)}function w(t,e,s,i,n){return(t-e)*(n-i)/(s-e)+i}function p(t,e,s){return y((s-t)/(e-t))}function g(t,e,s){const i=p(t,e,s);return i*i*(3-2*i)}function f(t,e,s){const i=p(t,e,s);return i*i*i*(i*(6*i-15)+10)}function z(t,e,s){const i=p(t,e,s);return i*i*i*i*(i*(i*(-20*i+70)-84)+35)}class M{constructor(){this.factor=10,this.target=0,this.value=0}update(t){return this.value=d(this.target,this.value,Math.exp(-this.factor*t)),this.value}}class ${constructor(t=$.WordsDefault,e=1,s=100){this.__words=t,this.__index=e,this.__end=s}[Symbol.iterator](){return this}next(){if(this.__end<this.__index)return{done:!0,value:null};let t="";for(const[e,s]of this.__words)this.__index%e==0&&(t+=s);return""===t&&(t=this.__index),this.__index++,{done:!1,value:t}}}$.WordsDefault=new Map([[3,"Fizz"],[5,"Buzz"]]);class F{}F.gif="https://fms-cat.com/images/fms_cat.gif",F.png="https://fms-cat.com/images/fms_cat.png";class T{constructor(t){this.__recalcForEach=0,this.__countUntilRecalc=0,this.__history=[],this.__index=0,this.__count=0,this.__cache=0,this.__length=t,this.__recalcForEach=t;for(let e=0;e<t;e++)this.__history[e]=0}get mean(){const t=Math.min(this.__count,this.__length);return 0===t?0:this.__cache/t}get recalcForEach(){return this.__recalcForEach}set recalcForEach(t){const e=t-this.__recalcForEach;this.__recalcForEach=t,this.__countUntilRecalc=Math.max(0,this.__countUntilRecalc+e)}reset(){this.__index=0,this.__count=0,this.__cache=0,this.__countUntilRecalc=0;for(let t=0;t<this.__length;t++)this.__history[t]=0}push(t){const e=this.__history[this.__index];this.__history[this.__index]=t,this.__count++,this.__index=(this.__index+1)%this.__length,0===this.__countUntilRecalc?this.recalc():(this.__countUntilRecalc--,this.__cache-=e,this.__cache+=t)}recalc(){this.__countUntilRecalc=this.__recalcForEach;const t=this.__history.slice(0,Math.min(this.__count,this.__length)).reduce((t,e)=>t+e,0);this.__cache=t}}class v{constructor(t){this.__history=[],this.__sorted=[],this.__index=0,this.__length=t}get median(){const t=Math.min(this.__sorted.length,this.__length);return this.__sorted[Math.floor((t-1)/2)]}reset(){this.__index=0,this.__history=[],this.__sorted=[]}push(e){const s=this.__history[this.__index];if(this.__history[this.__index]=e,this.__index=(this.__index+1)%this.__length,this.__sorted.length===this.__length){const e=t(s,this.__sorted);this.__sorted.splice(e,1)}const i=t(e,this.__sorted);this.__sorted.splice(i,0,e)}}class b{get length(){return Math.sqrt(this.elements.reduce((t,e)=>t+e*e,0))}get normalized(){return this.scale(1/this.length)}clone(){return this.__new(this.elements.concat())}add(t){return this.__new(this.elements.map((e,s)=>e+t.elements[s]))}sub(t){return this.__new(this.elements.map((e,s)=>e-t.elements[s]))}multiply(t){return this.__new(this.elements.map((e,s)=>e*t.elements[s]))}divide(t){return this.__new(this.elements.map((e,s)=>e/t.elements[s]))}scale(t){return this.__new(this.elements.map(e=>e*t))}dot(t){return this.elements.reduce((e,s,i)=>e+s*t.elements[i],0)}}class D extends b{constructor(t=[0,0,0]){super(),this.elements=t}get x(){return this.elements[0]}set x(t){this.elements[0]=t}get y(){return this.elements[1]}set y(t){this.elements[1]=t}get z(){return this.elements[2]}set z(t){this.elements[2]=t}toString(){return`Vector3( ${this.x.toFixed(3)}, ${this.y.toFixed(3)}, ${this.z.toFixed(3)} )`}cross(t){return new D([this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x])}applyQuaternion(t){const e=new P([this.x,this.y,this.z,0]),s=t.inversed,i=t.multiply(e).multiply(s);return new D([i.x,i.y,i.z])}applyMatrix4(t){const e=t.elements,s=1/(e[3]*this.x+e[7]*this.y+e[11]*this.z+e[15]);return new D([(e[0]*this.x+e[4]*this.y+e[8]*this.z+e[12])*s,(e[1]*this.x+e[5]*this.y+e[9]*this.z+e[13])*s,(e[2]*this.x+e[6]*this.y+e[10]*this.z+e[14])*s])}__new(t){return new D(t)}static get zero(){return new D([0,0,0])}static get one(){return new D([1,1,1])}}const E=[0,0,0,1];class P{constructor(t=E){this.elements=t}get x(){return this.elements[0]}get y(){return this.elements[1]}get z(){return this.elements[2]}get w(){return this.elements[3]}toString(){return`Quaternion( ${this.x.toFixed(3)}, ${this.y.toFixed(3)}, ${this.z.toFixed(3)}, ${this.w.toFixed(3)} )`}clone(){return new P(this.elements.concat())}get matrix(){const t=new D([1,0,0]).applyQuaternion(this),e=new D([0,1,0]).applyQuaternion(this),s=new D([0,0,1]).applyQuaternion(this);return new A([t.x,e.x,s.x,0,t.y,e.y,s.y,0,t.z,e.z,s.z,0,0,0,0,1])}get inversed(){return new P([-this.x,-this.y,-this.z,this.w])}multiply(t){return new P([this.w*t.x+this.x*t.w+this.y*t.z-this.z*t.y,this.w*t.y-this.x*t.z+this.y*t.w+this.z*t.x,this.w*t.z+this.x*t.y-this.y*t.x+this.z*t.w,this.w*t.w-this.x*t.x-this.y*t.y-this.z*t.z])}static get identity(){return new P(E)}static fromAxisAngle(t,e){const s=e/2,i=Math.sin(s);return new P([t.x*i,t.y*i,t.z*i,Math.cos(s)])}static fromMatrix(t){const e=t.elements,s=e[0],i=e[4],n=e[8],h=e[1],r=e[5],_=e[9],a=e[2],c=e[6],o=e[10],l=s+r+o;if(l>0){const t=.5/Math.sqrt(l+1);return new P([(c-_)*t,(n-a)*t,(h-i)*t,.25/t])}if(s>r&&s>o){const t=2*Math.sqrt(1+s-r-o);return new P([.25*t,(i+h)/t,(n+a)/t,(c-_)/t])}if(r>o){const t=2*Math.sqrt(1+r-s-o);return new P([(i+h)/t,.25*t,(_+c)/t,(n-a)/t])}{const t=2*Math.sqrt(1+o-s-r);return new P([(n+a)/t,(_+c)/t,.25*t,(h-i)/t])}}}const R=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class A{constructor(t=R){this.elements=t}get transpose(){const t=this.elements;return new A([t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15]])}get determinant(){const t=this.elements,e=t[0],s=t[1],i=t[2],n=t[3],h=t[4],r=t[5],_=t[6],a=t[7],c=t[8],o=t[9],l=t[10],u=t[11],m=t[12],d=t[13],x=t[14],y=t[15];return(e*r-s*h)*(l*y-u*x)-(e*_-i*h)*(o*y-u*d)+(e*a-n*h)*(o*x-l*d)+(s*_-i*r)*(c*y-u*m)-(s*a-n*r)*(c*x-l*m)+(i*a-n*_)*(c*d-o*m)}get inverse(){const t=this.elements,e=t[0],s=t[1],i=t[2],n=t[3],h=t[4],r=t[5],_=t[6],a=t[7],c=t[8],o=t[9],l=t[10],u=t[11],m=t[12],d=t[13],x=t[14],y=t[15],w=e*r-s*h,p=e*_-i*h,g=e*a-n*h,f=s*_-i*r,z=s*a-n*r,M=i*a-n*_,$=c*d-o*m,F=c*x-l*m,T=c*y-u*m,v=o*x-l*d,b=o*y-u*d,D=l*y-u*x,E=w*D-p*b+g*v+f*T-z*F+M*$;if(0===E)return null;const P=1/E;return new A([r*D-_*b+a*v,i*b-s*D-n*v,d*M-x*z+y*f,l*z-o*M-u*f,_*T-h*D-a*F,e*D-i*T+n*F,x*g-m*M-y*p,c*M-l*g+u*p,h*b-r*T+a*$,s*T-e*b-n*$,m*z-d*g+y*w,o*g-c*z-u*w,r*F-h*v-_*$,e*v-s*F+i*$,d*p-m*f-x*w,c*f-o*p+l*w].map(t=>t*P))}toString(){const t=this.elements.map(t=>t.toFixed(3));return`Matrix4( ${t[0]}, ${t[4]}, ${t[8]}, ${t[12]}; ${t[1]}, ${t[5]}, ${t[9]}, ${t[13]}; ${t[2]}, ${t[6]}, ${t[10]}, ${t[14]}; ${t[3]}, ${t[7]}, ${t[11]}, ${t[15]} )`}clone(){return new A(this.elements.concat())}multiply(...t){if(0===t.length)return this.clone();const e=t.concat();let s=e.shift();0<e.length&&(s=s.multiply(...e));const i=this.elements,n=s.elements;return new A([i[0]*n[0]+i[4]*n[1]+i[8]*n[2]+i[12]*n[3],i[1]*n[0]+i[5]*n[1]+i[9]*n[2]+i[13]*n[3],i[2]*n[0]+i[6]*n[1]+i[10]*n[2]+i[14]*n[3],i[3]*n[0]+i[7]*n[1]+i[11]*n[2]+i[15]*n[3],i[0]*n[4]+i[4]*n[5]+i[8]*n[6]+i[12]*n[7],i[1]*n[4]+i[5]*n[5]+i[9]*n[6]+i[13]*n[7],i[2]*n[4]+i[6]*n[5]+i[10]*n[6]+i[14]*n[7],i[3]*n[4]+i[7]*n[5]+i[11]*n[6]+i[15]*n[7],i[0]*n[8]+i[4]*n[9]+i[8]*n[10]+i[12]*n[11],i[1]*n[8]+i[5]*n[9]+i[9]*n[10]+i[13]*n[11],i[2]*n[8]+i[6]*n[9]+i[10]*n[10]+i[14]*n[11],i[3]*n[8]+i[7]*n[9]+i[11]*n[10]+i[15]*n[11],i[0]*n[12]+i[4]*n[13]+i[8]*n[14]+i[12]*n[15],i[1]*n[12]+i[5]*n[13]+i[9]*n[14]+i[13]*n[15],i[2]*n[12]+i[6]*n[13]+i[10]*n[14]+i[14]*n[15],i[3]*n[12]+i[7]*n[13]+i[11]*n[14]+i[15]*n[15]])}scaleScalar(t){return new A(this.elements.map(e=>e*t))}static get identity(){return new A(R)}static multiply(...t){if(0===t.length)return A.identity;{const e=t.concat();return e.shift().multiply(...e)}}static translate(t){return new A([1,0,0,0,0,1,0,0,0,0,1,0,t.x,t.y,t.z,1])}static scale(t){return new A([t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1])}static scaleScalar(t){return new A([t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1])}static rotateX(t){return new A([1,0,0,0,0,Math.cos(t),-Math.sin(t),0,0,Math.sin(t),Math.cos(t),0,0,0,0,1])}static rotateY(t){return new A([Math.cos(t),0,Math.sin(t),0,0,1,0,0,-Math.sin(t),0,Math.cos(t),0,0,0,0,1])}static rotateZ(t){return new A([Math.cos(t),-Math.sin(t),0,0,Math.sin(t),Math.cos(t),0,0,0,0,1,0,0,0,0,1])}static lookAt(t,e=new D([0,0,0]),s=new D([0,1,0]),i=0){const n=t.sub(e).normalized;let h=s.cross(n).normalized,r=n.cross(h);return h=h.scale(Math.cos(i)).add(r.scale(Math.sin(i))),r=n.cross(h),new A([h.x,h.y,h.z,0,r.x,r.y,r.z,0,n.x,n.y,n.z,0,t.x,t.y,t.z,1])}static lookAtInverse(t,e=new D([0,0,0]),s=new D([0,1,0]),i=0){const n=t.sub(e).normalized;let h=s.cross(n).normalized,r=n.cross(h);return h=h.scale(Math.cos(i)).add(r.scale(Math.sin(i))),r=n.cross(h),new A([h.x,r.x,n.x,0,h.y,r.y,n.y,0,h.z,r.z,n.z,0,-h.x*t.x-h.y*t.y-h.z*t.z,-r.x*t.x-r.y*t.y-r.z*t.z,-n.x*t.x-n.y*t.y-n.z*t.z,1])}static perspective(t=45,e=.01,s=100){const i=1/Math.tan(t*Math.PI/360),n=s-e;return new A([i,0,0,0,0,i,0,0,0,0,-(s+e)/n,-1,0,0,-2*s*e/n,0])}decompose(){const t=this.elements;let e=new D([t[0],t[1],t[2]]).length;const s=new D([t[4],t[5],t[6]]).length,i=new D([t[8],t[9],t[10]]).length;this.determinant<0&&(e=-e);const n=1/e,h=1/s,r=1/i,_=this.clone();return _.elements[0]*=n,_.elements[1]*=n,_.elements[2]*=n,_.elements[4]*=h,_.elements[5]*=h,_.elements[6]*=h,_.elements[8]*=r,_.elements[9]*=r,_.elements[10]*=r,{position:new D([t[12],t[13],t[14]]),scale:new D([e,s,i]),rotation:P.fromMatrix(_)}}static compose(t,e,s){const i=e.x,n=e.y,h=e.z,r=e.w,_=i+i,a=n+n,c=h+h,o=i*_,l=i*a,u=i*c,m=n*a,d=n*c,x=h*c,y=r*_,w=r*a,p=r*c,g=s.x,f=s.y,z=s.z;return new A([(1-(m+x))*g,(l+p)*g,(u-w)*g,0,(l-p)*f,(1-(o+x))*f,(d+y)*f,0,(u+w)*z,(d-y)*z,(1-(o+m))*z,0,t.x,t.y,t.z,1])}}class S extends b{constructor(t=[0,0,0,0]){super(),this.elements=t}get x(){return this.elements[0]}set x(t){this.elements[0]=t}get y(){return this.elements[1]}set y(t){this.elements[1]=t}get z(){return this.elements[2]}set z(t){this.elements[2]=t}get w(){return this.elements[3]}set w(t){this.elements[3]=t}toString(){return`Vector4( ${this.x.toFixed(3)}, ${this.y.toFixed(3)}, ${this.z.toFixed(3)}, ${this.w.toFixed(3)} )`}applyMatrix4(t){const e=t.elements;return new S([e[0]*this.x+e[4]*this.y+e[8]*this.z+e[12]*this.w,e[1]*this.x+e[5]*this.y+e[9]*this.z+e[13]*this.w,e[2]*this.x+e[6]*this.y+e[10]*this.z+e[14]*this.w,e[3]*this.x+e[7]*this.y+e[11]*this.z+e[15]*this.w])}__new(t){return new S(t)}static get zero(){return new S([0,0,0,0])}static get one(){return new S([1,1,1,1])}}class U{constructor(t,e){this.i=t,this.o=e}swap(){const t=this.i;this.i=this.o,this.o=t}}class q{constructor(){this.__bpm=0,this.__lastTap=0,this.__lastBeat=0,this.__lastTime=0,this.__calc=new T(16)}get beatDuration(){return 60/this.__bpm}get bpm(){return this.__bpm}set bpm(t){this.__lastBeat=this.beat,this.__lastTime=performance.now(),this.__bpm=t}get beat(){return this.__lastBeat+.001*(performance.now()-this.__lastTime)/this.beatDuration}reset(){this.__calc.reset()}nudge(t){this.__lastBeat=this.beat+t,this.__lastTime=performance.now()}tap(){const t=performance.now(),e=.001*(t-this.__lastTap);2<e?this.reset():(this.__calc.push(e),this.__bpm=60/this.__calc.mean),this.__lastTap=t,this.__lastTime=t,this.__lastBeat=0}}class B{constructor(t){this.seed=t||1}gen(t){return t&&(this.seed=t),this.seed=this.seed^this.seed<<13,this.seed=this.seed^this.seed>>>17,this.seed=this.seed^this.seed<<5,this.seed/Math.pow(2,32)+.5}set(t){this.seed=t||this.seed||1}}export{a as CDS,c as Clock,o as ClockFrame,l as ClockRealtime,M as ExpSmooth,F as FMS_Cat,$ as FizzBuzz,T as HistoryMeanCalculator,v as HistoryMedianCalculator,A as Matrix4,P as Quaternion,U as Swap,e as TRIANGLE_STRIP_QUAD,s as TRIANGLE_STRIP_QUAD_3D,i as TRIANGLE_STRIP_QUAD_NORMAL,n as TRIANGLE_STRIP_QUAD_UV,q as TapTempo,b as Vector,D as Vector3,S as Vector4,B as Xorshift,t as binarySearch,x as clamp,u as edt1d,m as edt2d,d as lerp,p as linearstep,_ as matrix2d,w as range,R as rawIdentityMatrix4,E as rawIdentityQuaternion,y as saturate,h as shuffleArray,f as smootherstep,z as smootheststep,g as smoothstep,r as triIndexToLineIndex}; | ||
function t(e,s){if("function"!=typeof s)return t(e,t=>t<=s);const i=s;let n=0,r=e.length;for(;n<r;){const t=n+r>>1;i(e[t])?n=t+1:r=t}return n}const e=[-1,-1,1,-1,-1,1,1,1],s=[-1,-1,0,1,-1,0,-1,1,0,1,1,0],i=[0,0,1,0,0,1,0,0,1,0,0,1],n=[0,0,1,0,0,1,1,1];function r(t,e){const s=e||(()=>Math.random());for(let e=0;e<t.length-1;e++){const i=e+Math.floor(s()*(t.length-e)),n=t[i];t[i]=t[e],t[e]=n}return t}function h(t){const e=[];for(let s=0;s<t.length/3;s++){const i=3*s;e.push(t[i],t[i+1],t[i+1],t[i+2],t[i+2],t[i])}return e}function c(t,e){const s=[];for(let i=0;i<e;i++)for(let e=0;e<t;e++)s.push(e,i);return s}class _{constructor(){this.factor=100,this.ratio=1,this.velocity=0,this.value=0,this.target=0}update(t){return this.velocity+=(-this.factor*(this.value-this.target)-2*this.velocity*Math.sqrt(this.factor)*this.ratio)*t,this.value+=this.velocity*t,this.value}}class o{constructor(){this.__time=0,this.__deltaTime=0,this.__isPlaying=!1}get time(){return this.__time}get deltaTime(){return this.__deltaTime}get isPlaying(){return this.__isPlaying}update(t){const e=this.__time;this.__time=t||0,this.__deltaTime=this.__time-e}play(){this.__isPlaying=!0}pause(){this.__isPlaying=!1}setTime(t){this.__time=t}}class a extends o{constructor(t=60){super(),this.__frame=0,this.__fps=t}get frame(){return this.__frame}get fps(){return this.__fps}update(){this.__isPlaying?(this.__time=this.__frame/this.__fps,this.__deltaTime=1/this.__fps,this.__frame++):this.__deltaTime=0}setTime(t){this.__frame=Math.floor(this.__fps*t),this.__time=this.__frame/this.__fps}}class l extends o{constructor(){super(...arguments),this.__rtTime=0,this.__rtDate=performance.now()}get isRealtime(){return!0}update(){const t=performance.now();if(this.__isPlaying){const e=this.__time,s=t-this.__rtDate;this.__time=this.__rtTime+s/1e3,this.__deltaTime=this.time-e}else this.__rtTime=this.time,this.__rtDate=t,this.__deltaTime=0}setTime(t){this.__time=t,this.__rtTime=this.time,this.__rtDate=performance.now()}}function u(t,e,s,i){let n=0;const r=new Float32Array(i);r[0]=0;const h=new Float32Array(i+1);h[0]=-1/0,h[1]=1/0;const c=new Float32Array(i);for(let n=0;n<i;n++)c[n]=t[e+n*s];for(let t=1;t<i;t++){let e=0;for(;0<=n&&(e=(c[t]+t*t-c[r[n]]-r[n]*r[n])/(2*t-2*r[n]),e<=h[n]);)n--;n++,r[n]=t,h[n]=e,h[n+1]=1/0}n=0;for(let _=0;_<i;_++){for(;h[n+1]<_;)n++;const i=_-r[n];t[e+_*s]=c[r[n]]+i*i}}function m(t,e,s){for(let i=0;i<e;i++)u(t,i,e,s);for(let i=0;i<s;i++)u(t,i*e,1,e)}function d(t,e,s){return t+(e-t)*s}function y(t,e,s){return Math.min(Math.max(t,e),s)}function x(t){return y(t,0,1)}function w(t,e,s,i,n){return(t-e)*(n-i)/(s-e)+i}function p(t,e,s){return x((s-t)/(e-t))}function f(t,e,s){const i=p(t,e,s);return i*i*(3-2*i)}function g(t,e,s){const i=p(t,e,s);return i*i*i*(i*(6*i-15)+10)}function z(t,e,s){const i=p(t,e,s);return i*i*i*i*(i*(i*(-20*i+70)-84)+35)}class M{constructor(){this.factor=10,this.target=0,this.value=0}update(t){return this.value=d(this.target,this.value,Math.exp(-this.factor*t)),this.value}}class ${constructor(t=$.WordsDefault,e=1,s=100){this.__words=t,this.__index=e,this.__end=s}[Symbol.iterator](){return this}next(){if(this.__end<this.__index)return{done:!0,value:null};let t="";for(const[e,s]of this.__words)this.__index%e==0&&(t+=s);return""===t&&(t=this.__index),this.__index++,{done:!1,value:t}}}$.WordsDefault=new Map([[3,"Fizz"],[5,"Buzz"]]);class F{}F.gif="https://fms-cat.com/images/fms_cat.gif",F.png="https://fms-cat.com/images/fms_cat.png";class T{constructor(t){this.__recalcForEach=0,this.__countUntilRecalc=0,this.__history=[],this.__index=0,this.__count=0,this.__cache=0,this.__length=t,this.__recalcForEach=t;for(let e=0;e<t;e++)this.__history[e]=0}get mean(){const t=Math.min(this.__count,this.__length);return 0===t?0:this.__cache/t}get recalcForEach(){return this.__recalcForEach}set recalcForEach(t){const e=t-this.__recalcForEach;this.__recalcForEach=t,this.__countUntilRecalc=Math.max(0,this.__countUntilRecalc+e)}reset(){this.__index=0,this.__count=0,this.__cache=0,this.__countUntilRecalc=0;for(let t=0;t<this.__length;t++)this.__history[t]=0}push(t){const e=this.__history[this.__index];this.__history[this.__index]=t,this.__count++,this.__index=(this.__index+1)%this.__length,0===this.__countUntilRecalc?this.recalc():(this.__countUntilRecalc--,this.__cache-=e,this.__cache+=t)}recalc(){this.__countUntilRecalc=this.__recalcForEach;const t=this.__history.slice(0,Math.min(this.__count,this.__length)).reduce((t,e)=>t+e,0);this.__cache=t}}class v extends class{constructor(t){this.__history=[],this.__sorted=[],this.__index=0,this.__length=t}get median(){return this.percentile(50)}percentile(t){return 0===this.__history.length?0:this.__sorted[Math.round(.01*t*(this.__history.length-1))]}reset(){this.__index=0,this.__history=[],this.__sorted=[]}push(e){const s=this.__history[this.__index];if(this.__history[this.__index]=e,this.__index=(this.__index+1)%this.__length,this.__sorted.length===this.__length){const e=t(this.__sorted,s);this.__sorted.splice(e,1)}const i=t(this.__sorted,e);this.__sorted.splice(i,0,e)}}{constructor(t){super(t),console.warn("HistoryMedianCalculator: Deprecated. Use HistoryPercentileCalculator instead")}}class b{get length(){return Math.sqrt(this.elements.reduce((t,e)=>t+e*e,0))}get normalized(){return this.scale(1/this.length)}clone(){return this.__new(this.elements.concat())}add(t){return this.__new(this.elements.map((e,s)=>e+t.elements[s]))}sub(t){return this.__new(this.elements.map((e,s)=>e-t.elements[s]))}multiply(t){return this.__new(this.elements.map((e,s)=>e*t.elements[s]))}divide(t){return this.__new(this.elements.map((e,s)=>e/t.elements[s]))}scale(t){return this.__new(this.elements.map(e=>e*t))}dot(t){return this.elements.reduce((e,s,i)=>e+s*t.elements[i],0)}}class D extends b{constructor(t=[0,0,0]){super(),this.elements=t}get x(){return this.elements[0]}set x(t){this.elements[0]=t}get y(){return this.elements[1]}set y(t){this.elements[1]=t}get z(){return this.elements[2]}set z(t){this.elements[2]=t}toString(){return`Vector3( ${this.x.toFixed(3)}, ${this.y.toFixed(3)}, ${this.z.toFixed(3)} )`}cross(t){return new D([this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x])}applyQuaternion(t){const e=new E([this.x,this.y,this.z,0]),s=t.inversed,i=t.multiply(e).multiply(s);return new D([i.x,i.y,i.z])}applyMatrix4(t){const e=t.elements,s=1/(e[3]*this.x+e[7]*this.y+e[11]*this.z+e[15]);return new D([(e[0]*this.x+e[4]*this.y+e[8]*this.z+e[12])*s,(e[1]*this.x+e[5]*this.y+e[9]*this.z+e[13])*s,(e[2]*this.x+e[6]*this.y+e[10]*this.z+e[14])*s])}__new(t){return new D(t)}static get zero(){return new D([0,0,0])}static get one(){return new D([1,1,1])}}const P=[0,0,0,1];class E{constructor(t=P){this.elements=t}get x(){return this.elements[0]}get y(){return this.elements[1]}get z(){return this.elements[2]}get w(){return this.elements[3]}toString(){return`Quaternion( ${this.x.toFixed(3)}, ${this.y.toFixed(3)}, ${this.z.toFixed(3)}, ${this.w.toFixed(3)} )`}clone(){return new E(this.elements.concat())}get matrix(){const t=new D([1,0,0]).applyQuaternion(this),e=new D([0,1,0]).applyQuaternion(this),s=new D([0,0,1]).applyQuaternion(this);return new U([t.x,e.x,s.x,0,t.y,e.y,s.y,0,t.z,e.z,s.z,0,0,0,0,1])}get inversed(){return new E([-this.x,-this.y,-this.z,this.w])}multiply(t){return new E([this.w*t.x+this.x*t.w+this.y*t.z-this.z*t.y,this.w*t.y-this.x*t.z+this.y*t.w+this.z*t.x,this.w*t.z+this.x*t.y-this.y*t.x+this.z*t.w,this.w*t.w-this.x*t.x-this.y*t.y-this.z*t.z])}static get identity(){return new E(P)}static fromAxisAngle(t,e){const s=e/2,i=Math.sin(s);return new E([t.x*i,t.y*i,t.z*i,Math.cos(s)])}static fromMatrix(t){const e=t.elements,s=e[0],i=e[4],n=e[8],r=e[1],h=e[5],c=e[9],_=e[2],o=e[6],a=e[10],l=s+h+a;if(l>0){const t=.5/Math.sqrt(l+1);return new E([(o-c)*t,(n-_)*t,(r-i)*t,.25/t])}if(s>h&&s>a){const t=2*Math.sqrt(1+s-h-a);return new E([.25*t,(i+r)/t,(n+_)/t,(o-c)/t])}if(h>a){const t=2*Math.sqrt(1+h-s-a);return new E([(i+r)/t,.25*t,(c+o)/t,(n-_)/t])}{const t=2*Math.sqrt(1+a-s-h);return new E([(n+_)/t,(c+o)/t,.25*t,(r-i)/t])}}}const R=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class U{constructor(t=R){this.elements=t}get transpose(){const t=this.elements;return new U([t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15]])}get determinant(){const t=this.elements,e=t[0],s=t[1],i=t[2],n=t[3],r=t[4],h=t[5],c=t[6],_=t[7],o=t[8],a=t[9],l=t[10],u=t[11],m=t[12],d=t[13],y=t[14],x=t[15];return(e*h-s*r)*(l*x-u*y)-(e*c-i*r)*(a*x-u*d)+(e*_-n*r)*(a*y-l*d)+(s*c-i*h)*(o*x-u*m)-(s*_-n*h)*(o*y-l*m)+(i*_-n*c)*(o*d-a*m)}get inverse(){const t=this.elements,e=t[0],s=t[1],i=t[2],n=t[3],r=t[4],h=t[5],c=t[6],_=t[7],o=t[8],a=t[9],l=t[10],u=t[11],m=t[12],d=t[13],y=t[14],x=t[15],w=e*h-s*r,p=e*c-i*r,f=e*_-n*r,g=s*c-i*h,z=s*_-n*h,M=i*_-n*c,$=o*d-a*m,F=o*y-l*m,T=o*x-u*m,v=a*y-l*d,b=a*x-u*d,D=l*x-u*y,P=w*D-p*b+f*v+g*T-z*F+M*$;if(0===P)return null;const E=1/P;return new U([h*D-c*b+_*v,i*b-s*D-n*v,d*M-y*z+x*g,l*z-a*M-u*g,c*T-r*D-_*F,e*D-i*T+n*F,y*f-m*M-x*p,o*M-l*f+u*p,r*b-h*T+_*$,s*T-e*b-n*$,m*z-d*f+x*w,a*f-o*z-u*w,h*F-r*v-c*$,e*v-s*F+i*$,d*p-m*g-y*w,o*g-a*p+l*w].map(t=>t*E))}toString(){const t=this.elements.map(t=>t.toFixed(3));return`Matrix4( ${t[0]}, ${t[4]}, ${t[8]}, ${t[12]}; ${t[1]}, ${t[5]}, ${t[9]}, ${t[13]}; ${t[2]}, ${t[6]}, ${t[10]}, ${t[14]}; ${t[3]}, ${t[7]}, ${t[11]}, ${t[15]} )`}clone(){return new U(this.elements.concat())}multiply(...t){if(0===t.length)return this.clone();const e=t.concat();let s=e.shift();0<e.length&&(s=s.multiply(...e));const i=this.elements,n=s.elements;return new U([i[0]*n[0]+i[4]*n[1]+i[8]*n[2]+i[12]*n[3],i[1]*n[0]+i[5]*n[1]+i[9]*n[2]+i[13]*n[3],i[2]*n[0]+i[6]*n[1]+i[10]*n[2]+i[14]*n[3],i[3]*n[0]+i[7]*n[1]+i[11]*n[2]+i[15]*n[3],i[0]*n[4]+i[4]*n[5]+i[8]*n[6]+i[12]*n[7],i[1]*n[4]+i[5]*n[5]+i[9]*n[6]+i[13]*n[7],i[2]*n[4]+i[6]*n[5]+i[10]*n[6]+i[14]*n[7],i[3]*n[4]+i[7]*n[5]+i[11]*n[6]+i[15]*n[7],i[0]*n[8]+i[4]*n[9]+i[8]*n[10]+i[12]*n[11],i[1]*n[8]+i[5]*n[9]+i[9]*n[10]+i[13]*n[11],i[2]*n[8]+i[6]*n[9]+i[10]*n[10]+i[14]*n[11],i[3]*n[8]+i[7]*n[9]+i[11]*n[10]+i[15]*n[11],i[0]*n[12]+i[4]*n[13]+i[8]*n[14]+i[12]*n[15],i[1]*n[12]+i[5]*n[13]+i[9]*n[14]+i[13]*n[15],i[2]*n[12]+i[6]*n[13]+i[10]*n[14]+i[14]*n[15],i[3]*n[12]+i[7]*n[13]+i[11]*n[14]+i[15]*n[15]])}scaleScalar(t){return new U(this.elements.map(e=>e*t))}static get identity(){return new U(R)}static multiply(...t){if(0===t.length)return U.identity;{const e=t.concat();return e.shift().multiply(...e)}}static translate(t){return new U([1,0,0,0,0,1,0,0,0,0,1,0,t.x,t.y,t.z,1])}static scale(t){return new U([t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1])}static scaleScalar(t){return new U([t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1])}static rotateX(t){return new U([1,0,0,0,0,Math.cos(t),-Math.sin(t),0,0,Math.sin(t),Math.cos(t),0,0,0,0,1])}static rotateY(t){return new U([Math.cos(t),0,Math.sin(t),0,0,1,0,0,-Math.sin(t),0,Math.cos(t),0,0,0,0,1])}static rotateZ(t){return new U([Math.cos(t),-Math.sin(t),0,0,Math.sin(t),Math.cos(t),0,0,0,0,1,0,0,0,0,1])}static lookAt(t,e=new D([0,0,0]),s=new D([0,1,0]),i=0){const n=t.sub(e).normalized;let r=s.cross(n).normalized,h=n.cross(r);return r=r.scale(Math.cos(i)).add(h.scale(Math.sin(i))),h=n.cross(r),new U([r.x,r.y,r.z,0,h.x,h.y,h.z,0,n.x,n.y,n.z,0,t.x,t.y,t.z,1])}static lookAtInverse(t,e=new D([0,0,0]),s=new D([0,1,0]),i=0){const n=t.sub(e).normalized;let r=s.cross(n).normalized,h=n.cross(r);return r=r.scale(Math.cos(i)).add(h.scale(Math.sin(i))),h=n.cross(r),new U([r.x,h.x,n.x,0,r.y,h.y,n.y,0,r.z,h.z,n.z,0,-r.x*t.x-r.y*t.y-r.z*t.z,-h.x*t.x-h.y*t.y-h.z*t.z,-n.x*t.x-n.y*t.y-n.z*t.z,1])}static perspective(t=45,e=.01,s=100){const i=1/Math.tan(t*Math.PI/360),n=s-e;return new U([i,0,0,0,0,i,0,0,0,0,-(s+e)/n,-1,0,0,-2*s*e/n,0])}decompose(){const t=this.elements;let e=new D([t[0],t[1],t[2]]).length;const s=new D([t[4],t[5],t[6]]).length,i=new D([t[8],t[9],t[10]]).length;this.determinant<0&&(e=-e);const n=1/e,r=1/s,h=1/i,c=this.clone();return c.elements[0]*=n,c.elements[1]*=n,c.elements[2]*=n,c.elements[4]*=r,c.elements[5]*=r,c.elements[6]*=r,c.elements[8]*=h,c.elements[9]*=h,c.elements[10]*=h,{position:new D([t[12],t[13],t[14]]),scale:new D([e,s,i]),rotation:E.fromMatrix(c)}}static compose(t,e,s){const i=e.x,n=e.y,r=e.z,h=e.w,c=i+i,_=n+n,o=r+r,a=i*c,l=i*_,u=i*o,m=n*_,d=n*o,y=r*o,x=h*c,w=h*_,p=h*o,f=s.x,g=s.y,z=s.z;return new U([(1-(m+y))*f,(l+p)*f,(u-w)*f,0,(l-p)*g,(1-(a+y))*g,(d+x)*g,0,(u+w)*z,(d-x)*z,(1-(a+m))*z,0,t.x,t.y,t.z,1])}}class A extends b{constructor(t=[0,0,0,0]){super(),this.elements=t}get x(){return this.elements[0]}set x(t){this.elements[0]=t}get y(){return this.elements[1]}set y(t){this.elements[1]=t}get z(){return this.elements[2]}set z(t){this.elements[2]=t}get w(){return this.elements[3]}set w(t){this.elements[3]=t}toString(){return`Vector4( ${this.x.toFixed(3)}, ${this.y.toFixed(3)}, ${this.z.toFixed(3)}, ${this.w.toFixed(3)} )`}applyMatrix4(t){const e=t.elements;return new A([e[0]*this.x+e[4]*this.y+e[8]*this.z+e[12]*this.w,e[1]*this.x+e[5]*this.y+e[9]*this.z+e[13]*this.w,e[2]*this.x+e[6]*this.y+e[10]*this.z+e[14]*this.w,e[3]*this.x+e[7]*this.y+e[11]*this.z+e[15]*this.w])}__new(t){return new A(t)}static get zero(){return new A([0,0,0,0])}static get one(){return new A([1,1,1,1])}}class S{constructor(t,e){this.i=t,this.o=e}swap(){const t=this.i;this.i=this.o,this.o=t}}class q{constructor(){this.__bpm=0,this.__lastTap=0,this.__lastBeat=0,this.__lastTime=0,this.__calc=new T(16)}get beatDuration(){return 60/this.__bpm}get bpm(){return this.__bpm}set bpm(t){this.__lastBeat=this.beat,this.__lastTime=performance.now(),this.__bpm=t}get beat(){return this.__lastBeat+.001*(performance.now()-this.__lastTime)/this.beatDuration}reset(){this.__calc.reset()}nudge(t){this.__lastBeat=this.beat+t,this.__lastTime=performance.now()}tap(){const t=performance.now(),e=.001*(t-this.__lastTap);2<e?this.reset():(this.__calc.push(e),this.__bpm=60/this.__calc.mean),this.__lastTap=t,this.__lastTime=t,this.__lastBeat=0}}class B{constructor(t){this.seed=t||1}gen(t){return t&&(this.seed=t),this.seed=this.seed^this.seed<<13,this.seed=this.seed^this.seed>>>17,this.seed=this.seed^this.seed<<5,this.seed/Math.pow(2,32)+.5}set(t){this.seed=t||this.seed||1}}export{_ as CDS,o as Clock,a as ClockFrame,l as ClockRealtime,M as ExpSmooth,F as FMS_Cat,$ as FizzBuzz,T as HistoryMeanCalculator,v as HistoryMedianCalculator,U as Matrix4,E as Quaternion,S as Swap,e as TRIANGLE_STRIP_QUAD,s as TRIANGLE_STRIP_QUAD_3D,i as TRIANGLE_STRIP_QUAD_NORMAL,n as TRIANGLE_STRIP_QUAD_UV,q as TapTempo,b as Vector,D as Vector3,A as Vector4,B as Xorshift,t as binarySearch,y as clamp,u as edt1d,m as edt2d,d as lerp,p as linearstep,c as matrix2d,w as range,R as rawIdentityMatrix4,P as rawIdentityQuaternion,x as saturate,r as shuffleArray,g as smootherstep,z as smootheststep,f as smoothstep,h as triIndexToLineIndex}; |
@@ -5,3 +5,3 @@ { | ||
"author": "FMS_Cat", | ||
"version": "0.4.2", | ||
"version": "0.5.0-dev.201214", | ||
"main": "dist/fms-cat-experimental.js", | ||
@@ -8,0 +8,0 @@ "module": "dist/fms-cat-experimental.module.js", |
# `@fms-cat/experimental` | ||
[![@fms-cat/experimental](https://badge.fury.io/js/%40fms-cat%2Fexperimental.svg)](https://badge.fury.io/js/%40fms-cat%2Fexperimental) | ||
Experimental edition of FMS_Cat |
@@ -1,1 +0,8 @@ | ||
export declare function binarySearch(element: number, array: ArrayLike<number>): number; | ||
/** | ||
* Look for an index from a sorted list using the binary search. | ||
* @param array A sorted array | ||
* @param compare Make this function return `false` if you want to point right side of given element, `true` if you want to point left side of given element. | ||
* @returns An index found | ||
*/ | ||
export declare function binarySearch<T>(array: ArrayLike<T>, element: T): number; | ||
export declare function binarySearch<T>(array: ArrayLike<T>, compare: (element: T) => boolean): number; |
/** | ||
* Useful for fps calc | ||
* Useful for tap tempo | ||
* See also: {@link HistoryMeanCalculator} | ||
*/ | ||
@@ -4,0 +5,0 @@ export declare class HistoryMeanCalculator { |
@@ -0,14 +1,7 @@ | ||
import { HistoryPercentileCalculator } from './HistoryPercentileCalculator'; | ||
/** | ||
* Useful for tap tempo | ||
* See also: {@link HistoryMeanCalculator} | ||
* @deprecated It's actually just a special case of {@link HistoryPercentileCalculator} | ||
*/ | ||
export declare class HistoryMedianCalculator { | ||
private __history; | ||
private __sorted; | ||
private __index; | ||
private readonly __length; | ||
export declare class HistoryMedianCalculator extends HistoryPercentileCalculator { | ||
constructor(length: number); | ||
readonly median: number; | ||
reset(): void; | ||
push(value: number): void; | ||
} |
@@ -1,1 +0,8 @@ | ||
export declare function binarySearch(element: number, array: ArrayLike<number>): number; | ||
/** | ||
* Look for an index from a sorted list using the binary search. | ||
* @param array A sorted array | ||
* @param compare Make this function return `false` if you want to point right side of given element, `true` if you want to point left side of given element. | ||
* @returns An index found | ||
*/ | ||
export declare function binarySearch<T>(array: ArrayLike<T>, element: T): number; | ||
export declare function binarySearch<T>(array: ArrayLike<T>, compare: (element: T) => boolean): number; |
/** | ||
* Useful for fps calc | ||
* Useful for tap tempo | ||
* See also: {@link HistoryMeanCalculator} | ||
*/ | ||
@@ -4,0 +5,0 @@ export declare class HistoryMeanCalculator { |
@@ -0,14 +1,7 @@ | ||
import { HistoryPercentileCalculator } from './HistoryPercentileCalculator'; | ||
/** | ||
* Useful for tap tempo | ||
* See also: {@link HistoryMeanCalculator} | ||
* @deprecated It's actually just a special case of {@link HistoryPercentileCalculator} | ||
*/ | ||
export declare class HistoryMedianCalculator { | ||
private __history; | ||
private __sorted; | ||
private __index; | ||
private readonly __length; | ||
export declare class HistoryMedianCalculator extends HistoryPercentileCalculator { | ||
constructor(length: number); | ||
get median(): number; | ||
reset(): void; | ||
push(value: number): void; | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
412693
81
5254
6