Files
iris/v3d.js

2 lines
1.0 MiB
JavaScript
Raw Normal View History

2019-06-10 16:32:48 +02:00
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.v3d=e.v3d||{})}(this,function(e){"use strict";function t(){}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:0<e?1:+e}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}),void 0===Object.values&&(Object.values=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}),Object.assign(t.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,e)}}}});var n,r,i,a,o,s,l,c,u,h,_e="2.12.5",H=0,Y=1,q=2,k=1,V=2,N=0,be=1,Q=2,d=0,x=2,Z=0,K=1,J=2,$=3,ee=4,te=5,ne=100,p=101,f=102,m=103,v=104,g=200,y=201,_=202,b=203,w=204,A=205,M=206,T=207,S=208,L=209,C=210,re=0,ie=1,ae=2,oe=3,se=4,le=5,ce=6,ue=7,j=0,W=1,X=2,he=0,we=1,de=2,pe=3,fe=4,me=5,ve=301,ge=302,ye=303,xe=304,Ae=305,Me=306,Te=307,E=1e3,I=1001,P=1002,D=1003,O=1004,U=1005,B=1006,R=1007,F=1008,Ue=1009,z=1010,G=1011,Se=1012,Le=1013,Ce=1014,Be=1015,Ee=1016,Pe=1017,Re=1018,Fe=1019,Ie=1020,Oe=1021,ze=1022,Ge=1023,Ne=1024,De=1025,ke=Ge,Ve=1026,je=1027,We=1028,Xe=33776,He=33777,Ye=33778,qe=33779,Qe=35840,Ze=35841,Ke=35842,Je=35843,$e=36196,et=37808,tt=37809,nt=37810,rt=37811,it=37812,at=37813,ot=37814,st=37815,lt=37816,ct=37817,ut=37818,ht=37819,dt=37820,pt=37821,ft=2300,mt=2301,vt=2302,gt=2400,yt=2401,xt=2402,_t=0,bt=3e3,wt=3001,At=3007,Mt=3002,Tt=3004,St=3005,Lt=3006,Ct=3200,Et=3201,Pt=0,Rt=1,Ft="__V3DL__0000000000",It=6,Ot=0,Nt={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var i=[],e=0;e<256;e++)i[e]=(e<16?"0":"")+e.toString(16);return function(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(i[255&e]+i[e>>8&255]+i[e>>16&255]+i[e>>24&255]+"-"+i[255&t]+i[t>>8&255]+"-"+i[t>>16&15|64]+i[t>>24&255]+"-"+i[63&n|128]+i[n>>8&255]+"-"+i[n>>16&255]+i[n>>24&255]+i[255&r]+i[r>>8&255]+i[r>>16&255]+i[r>>24&255]).toUpperCase()}}(),clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:n<=e?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:n<=e?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},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())},degToRad:function(e){return e*Nt.DEG2RAD},radToDeg:function(e){return e*Nt.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},hashString:function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0},expAverage:function(e,t,n,r){var i=Math.exp(-n/r);return e*i+(1-i)*t},an