2 lines
1.4 MiB
JavaScript
2 lines
1.4 MiB
JavaScript
|
function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},_extends.apply(this,arguments)}!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).v3d={})}(this,(function(e){"use strict";const t="4.1.1",n={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},i=100,o=200,r=201,a=204,s=205,l=300,c=301,u=302,d=303,h=304,p=306,f=307,m=1e3,g=1001,v=1002,A=1003,_=1004,x=1005,y=1006,b=1007,M=1008,C=1009,S=1012,w=1014,E=1015,T=1016,I=1020,R=1023,L=1026,B=1027,P=1028,D=33776,N=33777,O=33778,F=33779,U=35840,z=35841,V=35842,G=35843,k=36196,Q=37492,W=37496,H=37808,j=37809,Y=37810,X=37811,K=37812,q=37813,Z=37814,J=37815,$=37816,ee=37817,te=37818,ne=37819,ie=37820,oe=37821,re=36492,ae=2200,se=2201,le=2202,ce=2300,ue=2301,de=2302,he=2400,pe=2401,fe=2402,me=2500,ge=2501,ve=3e3,Ae=3001,_e=3201,xe=3202,ye=3301,be=7680,Me=7681,Ce=34055,Se=34056,we=35044,Ee=35048,Te="300 es",Ie=1035,Re="BLENDER",Le="__V3DL__0000000000";class Be{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=t.slice(0);for(let t=0,i=n.length;t<i;t++)n[t].call(this,e);e.target=null}}}const Pe=[];for(let e=0;e<256;e++)Pe[e]=(e<16?"0":"")+e.toString(16);let De=1234567;const Ne=Math.PI/180,Oe=180/Math.PI;function Fe(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(Pe[255&e]+Pe[e>>8&255]+Pe[e>>16&255]+Pe[e>>24&255]+"-"+Pe[255&t]+Pe[t>>8&255]+"-"+Pe[t>>16&15|64]+Pe[t>>24&255]+"-"+Pe[63&n|128]+Pe[n>>8&255]+"-"+Pe[n>>16&255]+Pe[n>>24&255]+Pe[255&i]+Pe[i>>8&255]+Pe[i>>16&255]+Pe[i>>24&255]).toUpperCase()}function Ue(e,t,n){return Math.max(t,Math.min(n,e))}function ze(e,t){return(e%t+t)%t}function Ve(e,t,n){return(1-n)*e+n*t}function Ge(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)}function ke(e){return e*Ne}function Qe(e){return e*Oe}function We(e){return 0==(e&e-1)&&0!==e}function He(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function je(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function Ye(e){let t=5381,n=e.length;for(;n;)t=33*t^e.charCodeAt(--n);return t>>>0}function Xe(e,t,n,i){let o=Math.exp(-n/i);return e*o+(1-o)*t}function Ke(e,t,n,i,o){let r=Xe(e,t,n,i);return Math.abs(e-t)<o&&(r=t),r}function qe(e){return Ue(e-2*Math.PI*Math.floor(e/(2*Math.PI)),0,2*Math.PI)}function Ze(e){let t=e+Math.PI;return t%=2*Math.PI,t+=2*Math.PI,t%=2*Math.PI,t-=Math.PI,t}function Je(e,t,n){let i=qe(e-t),o=qe(n-t);return i>o&&(i=i<o/2+Math.PI?o:0),i+t}var $e=Object.freeze({__proto__:null,DEG2RAD:Ne,RAD2DEG:Oe,generateUUID:Fe,clamp:Ue,euclideanModulo:ze,mapLinear:function(e,t,n,i,o){return i+(e-t)*(o-i)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:Ve,damp:function(e,t,n,i){return Ve(e,t,1-Math.exp(-n*i))},pingpong:function(e,t=1){return t-Math.abs(ze(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:Ge,randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return void 0!==e&&(De=e%2147483647),De=16807*De%2147483647,(De-1)/2147483646},degToRad:ke,radToDeg:Qe,isPowerOfTwo:We,ceilPowerOfTwo:He,floorPowerOfTwo:je,setQuaternionFromProperEuler:function(e,t,n,i,o){const r=Math.cos,a=Math.sin,s=r(n/2),l=a(n/2),c=r((t+i)/2),u=a((t+i)/2),d
|