XWWitPark/witpark_jzzs/xw_jzzs_web/public/lib/three/three.js

2 lines
495 KiB
JavaScript
Raw Normal View History

2024-09-12 00:10:00 +00:00
/* 2020-9-22 15:23:18 | 版权所有 军懋国兴 */
function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t,e){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.THREE=t.THREE||{})}(this,function(t){"use strict";function e(){}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:0<t?1:+t}),void 0===Function.prototype.name&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),Object.assign(e.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)},removeEventListener:function(t,e){var i,n;void 0!==this._listeners&&(void 0===(i=this._listeners[t])||-1!==(n=i.indexOf(e))&&i.splice(n,1))},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var i=e.slice(0),n=0,r=i.length;n<r;n++)i[n].call(this,t)}}}});var i,n,r,a,o,s,V=0,k=1,j=2,F=1,B=2,z=0,W=1,X=2,Rt=1,c=2,Lt=0,q=0,Y=1,Z=2,J=3,Q=4,K=5,Pt=100,Ct=204,It=205,$=0,tt=1,et=2,it=3,nt=4,rt=5,at=6,ot=7,G=0,H=1,st=2,ct=0,Ut=1,ht=2,lt=3,ut=4,dt=301,pt=302,ft=303,mt=304,gt=305,vt=306,yt=307,Nt=1e3,Ot=1001,Dt=1002,Ft=1003,Bt=1004,zt=1005,Gt=1006,Ht=1008,Vt=1009,kt=1012,jt=1014,Wt=1015,Xt=1016,qt=1020,Yt=1022,Zt=1023,h=Zt,Jt=1026,Qt=1027,l=2300,u=2301,d=2400,p=2401,f=2402,Kt=0,m=3e3,g=3001,v=3007,y=3002,x=3004,_=3005,b=3006,w=3200,xt=3201,$t={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:(n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=new Array(36),a=0,function(){for(var t=0;t<36;t++)8===t||13===t||18===t||23===t?r[t]="-":14===t?r[t]="4":(a<=2&&(a=33554432+16777216*Math.random()|0),i=15&a,a>>=4,r[t]=n[19===t?3&i|8:i]);return r.join("")}),clamp:function(t,e,i){return Math.max(e,Math.min(i,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,i,n,r){return n+(t-e)*(r-n)/(i-e)},lerp:function(t,e,i){return(1-i)*t+i*e},smoothstep:function(t,e,i){return t<=e?0:i<=t?1:(t=(t-e)/(i-e))*t*(3-2*t)},smootherstep:function(t,e,i){return t<=e?0:i<=t?1:(t=(t-e)/(i-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*$t.DEG2RAD},radToDeg:function(t){return t*$t.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}};function _t(t,e){this.x=t||0,this.y=e||0}Object.defineProperties(_t.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(_t.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:funct