gl-draw 0.1.2 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -4
- package/dist/index.module.js +4 -4
- package/dist/objects/index.js +11 -11
- package/dist/objects/index.module.js +11 -11
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.module.js +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.module.js +1 -1
- package/dist/utils/uvGenerator.d.ts +8 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){var Be={187:function(R){"use strict";var T=typeof Reflect=="object"?Reflect:null,C=T&&typeof T.apply=="function"?T.apply:function(d,p,b){return Function.prototype.apply.call(d,p,b)},z;T&&typeof T.ownKeys=="function"?z=T.ownKeys:Object.getOwnPropertySymbols?z=function(d){return Object.getOwnPropertyNames(d).concat(Object.getOwnPropertySymbols(d))}:z=function(d){return Object.getOwnPropertyNames(d)};function D(f){console&&console.warn&&console.warn(f)}var E=Number.isNaN||function(d){return d!==d};function m(){m.init.call(this)}R.exports=m,R.exports.once=$,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var F=10;function q(f){if(typeof f!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof f)}Object.defineProperty(m,"defaultMaxListeners",{enumerable:!0,get:function(){return F},set:function(f){if(typeof f!="number"||f<0||E(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");F=f}}),m.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},m.prototype.setMaxListeners=function(d){if(typeof d!="number"||d<0||E(d))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+d+".");return this._maxListeners=d,this};function H(f){return f._maxListeners===void 0?m.defaultMaxListeners:f._maxListeners}m.prototype.getMaxListeners=function(){return H(this)},m.prototype.emit=function(d){for(var p=[],b=1;b<arguments.length;b++)p.push(arguments[b]);var _=d==="error",L=this._events;if(L!==void 0)_=_&&L.error===void 0;else if(!_)return!1;if(_){var j;if(p.length>0&&(j=p[0]),j instanceof Error)throw j;var N=new Error("Unhandled error."+(j?" ("+j.message+")":""));throw N.context=j,N}var ae=L[d];if(ae===void 0)return!1;if(typeof ae=="function")C(ae,this,p);else for(var de=ae.length,he=oe(ae,de),b=0;b<de;++b)C(he[b],this,p);return!0};function k(f,d,p,b){var _,L,j;if(q(p),L=f._events,L===void 0?(L=f._events=Object.create(null),f._eventsCount=0):(L.newListener!==void 0&&(f.emit("newListener",d,p.listener?p.listener:p),L=f._events),j=L[d]),j===void 0)j=L[d]=p,++f._eventsCount;else if(typeof j=="function"?j=L[d]=b?[p,j]:[j,p]:b?j.unshift(p):j.push(p),_=H(f),_>0&&j.length>_&&!j.warned){j.warned=!0;var N=new Error("Possible EventEmitter memory leak detected. "+j.length+" "+String(d)+" listeners added. Use emitter.setMaxListeners() to increase limit");N.name="MaxListenersExceededWarning",N.emitter=f,N.type=d,N.count=j.length,D(N)}return f}m.prototype.addListener=function(d,p){return k(this,d,p,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(d,p){return k(this,d,p,!0)};function X(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(f,d,p){var b={fired:!1,wrapFn:void 0,target:f,type:d,listener:p},_=X.bind(b);return _.listener=p,b.wrapFn=_,_}m.prototype.once=function(d,p){return q(p),this.on(d,l(this,d,p)),this},m.prototype.prependOnceListener=function(d,p){return q(p),this.prependListener(d,l(this,d,p)),this},m.prototype.removeListener=function(d,p){var b,_,L,j,N;if(q(p),_=this._events,_===void 0)return this;if(b=_[d],b===void 0)return this;if(b===p||b.listener===p)--this._eventsCount===0?this._events=Object.create(null):(delete _[d],_.removeListener&&this.emit("removeListener",d,b.listener||p));else if(typeof b!="function"){for(L=-1,j=b.length-1;j>=0;j--)if(b[j]===p||b[j].listener===p){N=b[j].listener,L=j;break}if(L<0)return this;L===0?b.shift():ie(b,L),b.length===1&&(_[d]=b[0]),_.removeListener!==void 0&&this.emit("removeListener",d,N||p)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(d){var p,b,_;if(b=this._events,b===void 0)return this;if(b.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):b[d]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete b[d]),this;if(arguments.length===0){var L=Object.keys(b),j;for(_=0;_<L.length;++_)j=L[_],j!=="removeListener"&&this.removeAllListeners(j);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(p=b[d],typeof p=="function")this.removeListener(d,p);else if(p!==void 0)for(_=p.length-1;_>=0;_--)this.removeListener(d,p[_]);return this};function Q(f,d,p){var b=f._events;if(b===void 0)return[];var _=b[d];return _===void 0?[]:typeof _=="function"?p?[_.listener||_]:[_]:p?I(_):oe(_,_.length)}m.prototype.listeners=function(d){return Q(this,d,!0)},m.prototype.rawListeners=function(d){return Q(this,d,!1)},m.listenerCount=function(f,d){return typeof f.listenerCount=="function"?f.listenerCount(d):ne.call(f,d)},m.prototype.listenerCount=ne;function ne(f){var d=this._events;if(d!==void 0){var p=d[f];if(typeof p=="function")return 1;if(p!==void 0)return p.length}return 0}m.prototype.eventNames=function(){return this._eventsCount>0?z(this._events):[]};function oe(f,d){for(var p=new Array(d),b=0;b<d;++b)p[b]=f[b];return p}function ie(f,d){for(;d+1<f.length;d++)f[d]=f[d+1];f.pop()}function I(f){for(var d=new Array(f.length),p=0;p<d.length;++p)d[p]=f[p].listener||f[p];return d}function $(f,d){return new Promise(function(p,b){function _(j){f.removeListener(d,L),b(j)}function L(){typeof f.removeListener=="function"&&f.removeListener("error",_),p([].slice.call(arguments))}U(f,d,L,{once:!0}),d!=="error"&&A(f,_,{once:!0})})}function A(f,d,p){typeof f.on=="function"&&U(f,"error",d,p)}function U(f,d,p,b){if(typeof f.on=="function")b.once?f.once(d,p):f.on(d,p);else if(typeof f.addEventListener=="function")f.addEventListener(d,function _(L){b.once&&f.removeEventListener(d,_),p(L)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(R){var T=function(C){"use strict";var z=Object.prototype,D=z.hasOwnProperty,E,m=typeof Symbol=="function"?Symbol:{},F=m.iterator||"@@iterator",q=m.asyncIterator||"@@asyncIterator",H=m.toStringTag||"@@toStringTag";function k(v,c,g){return Object.defineProperty(v,c,{value:g,enumerable:!0,configurable:!0,writable:!0}),v[c]}try{k({},"")}catch(v){k=function(c,g,O){return c[g]=O}}function X(v,c,g,O){var x=c&&c.prototype instanceof $?c:$,Z=Object.create(x.prototype),ee=new he(O||[]);return Z._invoke=j(v,g,ee),Z}C.wrap=X;function l(v,c,g){try{return{type:"normal",arg:v.call(c,g)}}catch(O){return{type:"throw",arg:O}}}var Q="suspendedStart",ne="suspendedYield",oe="executing",ie="completed",I={};function $(){}function A(){}function U(){}var f={};k(f,F,function(){return this});var d=Object.getPrototypeOf,p=d&&d(d(ve([])));p&&p!==z&&D.call(p,F)&&(f=p);var b=U.prototype=$.prototype=Object.create(f);A.prototype=U,k(b,"constructor",U),k(U,"constructor",A),A.displayName=k(U,H,"GeneratorFunction");function _(v){["next","throw","return"].forEach(function(c){k(v,c,function(g){return this._invoke(c,g)})})}C.isGeneratorFunction=function(v){var c=typeof v=="function"&&v.constructor;return c?c===A||(c.displayName||c.name)==="GeneratorFunction":!1},C.mark=function(v){return Object.setPrototypeOf?Object.setPrototypeOf(v,U):(v.__proto__=U,k(v,H,"GeneratorFunction")),v.prototype=Object.create(b),v},C.awrap=function(v){return{__await:v}};function L(v,c){function g(Z,ee,J,te){var Y=l(v[Z],v,ee);if(Y.type==="throw")te(Y.arg);else{var pe=Y.arg,me=pe.value;return me&&typeof me=="object"&&D.call(me,"__await")?c.resolve(me.__await).then(function(fe){g("next",fe,J,te)},function(fe){g("throw",fe,J,te)}):c.resolve(me).then(function(fe){pe.value=fe,J(pe)},function(fe){return g("throw",fe,J,te)})}}var O;function x(Z,ee){function J(){return new c(function(te,Y){g(Z,ee,te,Y)})}return O=O?O.then(J,J):J()}this._invoke=x}_(L.prototype),k(L.prototype,q,function(){return this}),C.AsyncIterator=L,C.async=function(v,c,g,O,x){x===void 0&&(x=Promise);var Z=new L(X(v,c,g,O),x);return C.isGeneratorFunction(c)?Z:Z.next().then(function(ee){return ee.done?ee.value:Z.next()})};function j(v,c,g){var O=Q;return function(Z,ee){if(O===oe)throw new Error("Generator is already running");if(O===ie){if(Z==="throw")throw ee;return ce()}for(g.method=Z,g.arg=ee;;){var J=g.delegate;if(J){var te=N(J,g);if(te){if(te===I)continue;return te}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(O===Q)throw O=ie,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);O=oe;var Y=l(v,c,g);if(Y.type==="normal"){if(O=g.done?ie:ne,Y.arg===I)continue;return{value:Y.arg,done:g.done}}else Y.type==="throw"&&(O=ie,g.method="throw",g.arg=Y.arg)}}}function N(v,c){var g=v.iterator[c.method];if(g===E){if(c.delegate=null,c.method==="throw"){if(v.iterator.return&&(c.method="return",c.arg=E,N(v,c),c.method==="throw"))return I;c.method="throw",c.arg=new TypeError("The iterator does not provide a 'throw' method")}return I}var O=l(g,v.iterator,c.arg);if(O.type==="throw")return c.method="throw",c.arg=O.arg,c.delegate=null,I;var x=O.arg;if(!x)return c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,I;if(x.done)c[v.resultName]=x.value,c.next=v.nextLoc,c.method!=="return"&&(c.method="next",c.arg=E);else return x;return c.delegate=null,I}_(b),k(b,H,"Generator"),k(b,F,function(){return this}),k(b,"toString",function(){return"[object Generator]"});function ae(v){var c={tryLoc:v[0]};1 in v&&(c.catchLoc=v[1]),2 in v&&(c.finallyLoc=v[2],c.afterLoc=v[3]),this.tryEntries.push(c)}function de(v){var c=v.completion||{};c.type="normal",delete c.arg,v.completion=c}function he(v){this.tryEntries=[{tryLoc:"root"}],v.forEach(ae,this),this.reset(!0)}C.keys=function(v){var c=[];for(var g in v)c.push(g);return c.reverse(),function O(){for(;c.length;){var x=c.pop();if(x in v)return O.value=x,O.done=!1,O}return O.done=!0,O}};function ve(v){if(v){var c=v[F];if(c)return c.call(v);if(typeof v.next=="function")return v;if(!isNaN(v.length)){var g=-1,O=function x(){for(;++g<v.length;)if(D.call(v,g))return x.value=v[g],x.done=!1,x;return x.value=E,x.done=!0,x};return O.next=O}}return{next:ce}}C.values=ve;function ce(){return{value:E,done:!0}}return he.prototype={constructor:he,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=E,this.done=!1,this.delegate=null,this.method="next",this.arg=E,this.tryEntries.forEach(de),!v)for(var c in this)c.charAt(0)==="t"&&D.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=E)},stop:function(){this.done=!0;var v=this.tryEntries[0],c=v.completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var c=this;function g(te,Y){return Z.type="throw",Z.arg=v,c.next=te,Y&&(c.method="next",c.arg=E),!!Y}for(var O=this.tryEntries.length-1;O>=0;--O){var x=this.tryEntries[O],Z=x.completion;if(x.tryLoc==="root")return g("end");if(x.tryLoc<=this.prev){var ee=D.call(x,"catchLoc"),J=D.call(x,"finallyLoc");if(ee&&J){if(this.prev<x.catchLoc)return g(x.catchLoc,!0);if(this.prev<x.finallyLoc)return g(x.finallyLoc)}else if(ee){if(this.prev<x.catchLoc)return g(x.catchLoc,!0)}else if(J){if(this.prev<x.finallyLoc)return g(x.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(v,c){for(var g=this.tryEntries.length-1;g>=0;--g){var O=this.tryEntries[g];if(O.tryLoc<=this.prev&&D.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var x=O;break}}x&&(v==="break"||v==="continue")&&x.tryLoc<=c&&c<=x.finallyLoc&&(x=null);var Z=x?x.completion:{};return Z.type=v,Z.arg=c,x?(this.method="next",this.next=x.finallyLoc,I):this.complete(Z)},complete:function(v,c){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&c&&(this.next=c),I},finish:function(v){for(var c=this.tryEntries.length-1;c>=0;--c){var g=this.tryEntries[c];if(g.finallyLoc===v)return this.complete(g.completion,g.afterLoc),de(g),I}},catch:function(v){for(var c=this.tryEntries.length-1;c>=0;--c){var g=this.tryEntries[c];if(g.tryLoc===v){var O=g.completion;if(O.type==="throw"){var x=O.arg;de(g)}return x}}throw new Error("illegal catch attempt")},delegateYield:function(v,c,g){return this.delegate={iterator:ve(v),resultName:c,nextLoc:g},this.method==="next"&&(this.arg=E),I}},C}(R.exports);try{regeneratorRuntime=T}catch(C){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},182:function(R,T,C){"use strict";C.d(T,{Z:function(){return z}});function z(D){if(D.geometry&&D.geometry.dispose(),D.material){var E=Array.isArray(D.material)?D.material:[D.material];E.forEach(function(m){var F,q,H,k,X,l,Q,ne,oe,ie,I,$,A;(F=m.map)===null||F===void 0||F.dispose(),(q=m.lightMap)===null||q===void 0||q.dispose(),(H=m.bumpMap)===null||H===void 0||H.dispose(),(k=m.normalMap)===null||k===void 0||k.dispose(),(X=m.specularMap)===null||X===void 0||X.dispose(),(l=m.envMap)===null||l===void 0||l.dispose(),(Q=m.alphaMap)===null||Q===void 0||Q.dispose(),(ne=m.aoMap)===null||ne===void 0||ne.dispose(),(oe=m.displacementMap)===null||oe===void 0||oe.dispose(),(ie=m.emissiveMap)===null||ie===void 0||ie.dispose(),(I=m.gradientMap)===null||I===void 0||I.dispose(),($=m.metalnessMap)===null||$===void 0||$.dispose(),(A=m.roughnessMap)===null||A===void 0||A.dispose(),m.dispose()})}}},54:function(R,T,C){"use strict";C.d(T,{disposeMesh:function(){return m.Z},isPlainObject:function(){return H.Z}});var z=C(666),D=C.n(z),E=null,m=C(182),F=C(644);function q(I){if(I.material){var $=Array.isArray(I.material)?I.material:[I.material];$.forEach(function(A){var U,f;(U=A.color)===null||U===void 0||U.convertSRGBToLinear(),(f=A.emissive)===null||f===void 0||f.convertSRGBToLinear(),A.map&&(A.map.encoding=THREE.sRGBEncoding),A.emissiveMap&&(A.emissiveMap.encoding=THREE.sRGBEncoding)})}}var H=C(975),k=C(568),X=C(924),l=require("idb-keyval"),Q=C(620),ne=null,oe=null,ie=function(){var I=(0,k.Z)(D().mark(function $(A,U){var f,d,p,b,_,L;return D().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:return f=U.version,N.next=4,(0,l.get)(A);case 4:if(p=N.sent,!(p&&p[f])){N.next=9;break}d=p[f],N.next=15;break;case 9:return N.next=11,(0,Q.Z)(fetch(A).then(function(ae){if(ae.ok)return ae.blob();throw new Error}));case 11:b=N.sent,_=b.res,L=b.err,L||(d=_,(0,l.set)(A,(0,X.Z)({},f,_)));case 15:return N.abrupt("return",d?{url:URL.createObjectURL(d)}:{url:A});case 16:case"end":return N.stop()}},$)}));return function(A,U){return I.apply(this,arguments)}}()},975:function(R,T,C){"use strict";C.d(T,{Z:function(){return D}});function z(E){return Object.prototype.toString.call(E)==="[object Object]"}function D(E){if(z(E)===!1)return!1;var m=E.constructor;if(m===void 0)return!0;var F=m.prototype;return!(z(F)===!1||F.hasOwnProperty("isPrototypeOf")===!1)}},620:function(R,T,C){"use strict";C.d(T,{Z:function(){return D}});var z=C(42);function D(E){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.then(function(F){return(0,z.Z)({err:null,res:F},m)}).catch(function(F){return(0,z.Z)({err:F,res:void 0},m)})}},644:function(R){"use strict";R.exports=require("three")},568:function(R,T,C){"use strict";C.d(T,{Z:function(){return D}});function z(E,m,F,q,H,k,X){try{var l=E[k](X),Q=l.value}catch(ne){F(ne);return}l.done?m(Q):Promise.resolve(Q).then(q,H)}function D(E){return function(){var m=this,F=arguments;return new Promise(function(q,H){var k=E.apply(m,F);function X(Q){z(k,q,H,X,l,"next",Q)}function l(Q){z(k,q,H,X,l,"throw",Q)}X(void 0)})}}},924:function(R,T,C){"use strict";C.d(T,{Z:function(){return z}});function z(D,E,m){return E in D?Object.defineProperty(D,E,{value:m,enumerable:!0,configurable:!0,writable:!0}):D[E]=m,D}},42:function(R,T,C){"use strict";C.d(T,{Z:function(){return D}});var z=C(924);function D(E){for(var m=1;m<arguments.length;m++){var F=arguments[m]!=null?arguments[m]:{},q=Object.keys(F);typeof Object.getOwnPropertySymbols=="function"&&(q=q.concat(Object.getOwnPropertySymbols(F).filter(function(H){return Object.getOwnPropertyDescriptor(F,H).enumerable}))),q.forEach(function(H){(0,z.Z)(E,H,F[H])})}return E}}},Oe={};function K(R){var T=Oe[R];if(T!==void 0)return T.exports;var C=Oe[R]={exports:{}};return Be[R](C,C.exports,K),C.exports}(function(){K.n=function(R){var T=R&&R.__esModule?function(){return R.default}:function(){return R};return K.d(T,{a:T}),T}})(),function(){K.d=function(R,T){for(var C in T)K.o(T,C)&&!K.o(R,C)&&Object.defineProperty(R,C,{enumerable:!0,get:T[C]})}}(),function(){K.o=function(R,T){return Object.prototype.hasOwnProperty.call(R,T)}}(),function(){K.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})}}();var Pe={};(function(){"use strict";K.r(Pe),K.d(Pe,{BaseObject:function(){return pt},GUIObject:function(){return U},Pencil:function(){return Ce},default:function(){return Ce}});function R(s,i){if(!(s instanceof i))throw new TypeError("Cannot call a class as a function")}function T(s,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(s,e.key,e)}}function C(s,i,n){return i&&T(s.prototype,i),n&&T(s,n),s}var z=K(42);function D(s,i){var n=Object.keys(s);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(s);i&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(s,t).enumerable})),n.push.apply(n,e)}return n}function E(s,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(i)):D(Object(i)).forEach(function(n){Object.defineProperty(s,n,Object.getOwnPropertyDescriptor(i,n))}),s}function m(s,i){(i==null||i>s.length)&&(i=s.length);for(var n=0,e=new Array(i);n<i;n++)e[n]=s[n];return e}function F(s){if(Array.isArray(s))return m(s)}function q(s){if(typeof Symbol!="undefined"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}function H(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(s,i){if(!!s){if(typeof s=="string")return m(s,i);var n=Object.prototype.toString.call(s).slice(8,-1);if(n==="Object"&&s.constructor&&(n=s.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(s,i)}}function X(s){return F(s)||q(s)||k(s)||H()}var l=K(644),Q=K(187),ne=require("deepmerge"),oe=K.n(ne),ie=require("three/examples/jsm/libs/stats.module"),I=K.n(ie),$=require("lil-gui"),A=K.n($),U=function(){"use strict";function s(n){R(this,s),this.guiParams={},n&&(this.guiParams=n)}var i=s.prototype;return i.showGui=function(e){var t=this;!e||Object.keys(this.guiParams).forEach(function(r){var o=e.addFolder(r),u=t.guiParams[r];Object.keys(u).forEach(function(a){var h=u[a],w=h.min,P=h.max,y=h.step,S=h.name,M=h.paramMap,G=h.items,B=h.value,W=h.target,se=a.toLowerCase().indexOf("color")>-1,V,re=typeof B=="undefined"&&W,ue=re?W():u[a],le=re?a:"value";G?V=o.add(ue,le,G):se?V=o.addColor(ue,le):V=o.add(ue,le),V=V.name(S||a),typeof w!="undefined"&&(V=V.min(w)),typeof P!="undefined"&&(V=V.max(P)),typeof y!="undefined"&&(V=V.step(y)),V=V.onChange(function(){t.setTargetValue(r,a,ue[le],M)}),re&&V.listen()})})},i.setTargetValue=function(e,t,r,o){var u=this.guiParams[e][t],a=u.onChange,h=u.target,w=u.value,P=t.toLowerCase().indexOf("color")>-1,y=typeof w=="undefined"&&h;if(h&&!y){var S=h();Array.isArray(S)||(S=[S]),S.forEach(function(M){if(!!M)if(P)try{M[o||t].set(r)}catch(G){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else M[o||t]=r})}a&&a(r)},i.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(t){Object.keys(e.guiParams[t]).forEach(function(r){var o=e.guiParams[t][r];typeof o.value!="undefined"&&e.setTargetValue(t,r,o.value,o.paramMap)})})},s}(),f={None:l.NoToneMapping,Linear:l.LinearToneMapping,Reinhard:l.ReinhardToneMapping,Cineon:l.CineonToneMapping,ACESFilmic:l.ACESFilmicToneMapping},d={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:l.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},p=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.width,t=n.height,r=n.rendererParams,o=r.context,u=r.alpha,a=r.devicePixelRatio,h=r.antialias,w=r.powerPreference,P=r.toneMapping,y=r.toneMappingExposure,S=r.outputEncoding,M=r.logarithmicDepthBuffer,G=r.preserveDrawingBuffer,B=new l.WebGLRenderer({context:o,alpha:u,antialias:h,powerPreference:w,logarithmicDepthBuffer:M,preserveDrawingBuffer:G});B.setSize(e,t),B.setPixelRatio(a),B.autoClear=!1,B.toneMapping=f[P],B.toneMappingExposure=y,B.outputEncoding=S,this.renderer=B}var i=s.prototype;return i.setSize=function(e,t){this.renderer.setSize(e,t)},i.render=function(){var e=this.options,t=e.scene,r=e.camera;this.renderer.render(t,r)},i.setGui=function(e){var t=this,r=new U({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:f,target:function(){return t.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return t.renderer}}}});r.showGui(e)},i.dispose=function(){var e,t,r;(e=this.renderer)===null||e===void 0||e.clear(),(t=this.renderer)===null||t===void 0||t.dispose(),(r=this.renderer)===null||r===void 0||r.renderLists.dispose()},s}(),b={fov:45,near:1,far:1e3},_=function(){"use strict";function s(n){R(this,s),this.oldCameraPosition=new l.Vector3,this.oldCameraRotation=new l.Euler,this.customCamera=!1,this.options=n;var e=n.width,t=n.height,r=n.cameraParams;if(r instanceof l.Camera)this.camera=r,this.customCamera=!0;else{var o=r.fov,u=r.far,a=r.near,h=new l.PerspectiveCamera(o,e/t,a,u);h.position.set(0,0,400),h.lookAt(0,0,0),this.camera=h}}var i=s.prototype;return i.checkCameraChange=function(){var e=this.camera,t=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!t},i.setSize=function(e,t){this.camera instanceof l.PerspectiveCamera&&(this.camera.aspect=e/t),this.camera.updateProjectionMatrix()},i.setGui=function(e){var t=this,r=new U({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}}});this.camera instanceof l.PerspectiveCamera&&(r.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}),r.showGui(e)},s}(),L=K(54),j={background:null},N=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.camera,t=n.sceneParams,r=t.background,o=new l.Scene;r&&(o.background=r),o.add(e),this.scene=o}var i=s.prototype;return i.addAxesHelper=function(){var e,t=new l.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(t)},i.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(t){(0,L.disposeMesh)(t)})},s}(),ae=require("three/examples/jsm/controls/OrbitControls"),de={},he=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.camera,t=n.controlParams,r=n.mapControl,o=t.domElement,u=r?new ae.MapControls(e,o):new ae.OrbitControls(e,o);u.minPolarAngle=Math.PI*.15,u.maxPolarAngle=Math.PI*.85,u.enableDamping=!0,u.dampingFactor=.063,u.autoRotate=!1,u.autoRotateSpeed=-60,u.enableZoom=!0,u.zoomSpeed=.2,this.control=u}var i=s.prototype;return i.limitPan=function(e){var t=e.maxX,r=t===void 0?1/0:t,o=e.minX,u=o===void 0?-1/0:o,a=e.maxZ,h=a===void 0?1/0:a,w=e.minZ,P=w===void 0?-1/0:w,y=e.maxY,S=y===void 0?1/0:y,M=e.minY,G=M===void 0?-1/0:M,B=this.limitPanV||new l.Vector3,W=this.control,se=this.options.camera,V=new l.Vector3(u,G,P),re=new l.Vector3(r,S,h);this.limitPanV=B,B.copy(W.target),W.target.clamp(V,re),B.sub(W.target),se.position.sub(B)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},s}(),ve=require("three/examples/jsm/renderers/CSS3DRenderer"),ce=new l.Vector3,v=new l.Matrix4,c=new l.Matrix4,g=new l.Vector3,O=new l.Vector3,x=function s(){"use strict";var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};R(this,s);var n=function(M,G){return g.setFromMatrixPosition(M.matrixWorld),O.setFromMatrixPosition(G.matrixWorld),g.distanceToSquared(O)},e=function(M){var G=[];return M.traverse(function(B){B.isCSS2DObject&&G.push(B)}),G},t=function(M){for(var G=e(M).sort(function(re,ue){if(re.renderOrder!==ue.renderOrder)return ue.renderOrder-re.renderOrder;var le=w.objects.get(re).distanceToCameraSquared,ye=w.objects.get(ue).distanceToCameraSquared;return le-ye}),B=G.length,W=0,se=G.length;W<se;W++){var V=G[W].userData.zIndexFix||0;G[W].element.style.zIndex=B-W+V}},r=this,o,u,a,h,w={objects:new WeakMap},P=i.element!==void 0?i.element:document.createElement("div");P.style.overflow="hidden",this.domElement=P,this.getSize=function(){return{width:o,height:u}},this.render=function(S,M){S.autoUpdate===!0&&S.updateMatrixWorld(),M.parent===null&&M.updateMatrixWorld(),v.copy(M.matrixWorldInverse),c.multiplyMatrices(M.projectionMatrix,v),y(S,S,M),t(S)},this.setSize=function(S,M){o=S,u=M,a=o/2,h=u/2,P.style.width="".concat(S,"px"),P.style.height="".concat(M,"px")};function y(S,M,G){if(S.isCSS2DObject){ce.setFromMatrixPosition(S.matrixWorld),ce.applyMatrix4(c);var B=S.visible===!0&&ce.z>=-1&&ce.z<=1&&S.layers.test(G.layers)===!0;if(S.element.style.display=B===!0?"":"none",B===!0){S.onBeforeRender(r,M,G);var W=S.element;W.style.transform="translate(-50%,-50%) translate(".concat(ce.x*a+a,"px,").concat(-ce.y*h+h,"px)"),W.parentNode!==P&&P.appendChild(W),S.onAfterRender(r,M,G)}var se={distanceToCameraSquared:n(G,S)};w.objects.set(S,se)}for(var V=0,re=S.children.length;V<re;V++)y(S.children[V],M,G)}},Z={zIndex:"auto"},ee=function(){"use strict";function s(n){R(this,s),this.container=n}var i=s.prototype;return i.addRenderer=function(e,t){var r=this.container,o=r.offsetWidth,u=r.offsetHeight,a=e==="css2d"?new x:new ve.CSS3DRenderer;a.domElement.style.position="absolute",a.domElement.style.top="0",a.domElement.style.pointerEvents="none",a.domElement.style.zIndex=t.zIndex,a.setSize(o,u),r.appendChild(a.domElement),e==="css2d"?this.css2Drenderer=a:e==="css3d"&&(this.css3Drenderer=a)},i.setSize=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.setSize(e,t),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,t)},i.render=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.render(e,t),(o=this.css3Drenderer)===null||o===void 0||o.render(e,t)},i.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},s}(),J=require("three/examples/jsm/postprocessing/EffectComposer"),te=require("three/examples/jsm/postprocessing/RenderPass"),Y=require("three/examples/jsm/postprocessing/ShaderPass"),pe=require("three/examples/jsm/shaders/CopyShader"),me=require("three/examples/jsm/shaders/GammaCorrectionShader"),fe=require("three/examples/jsm/postprocessing/SMAAPass"),Fe=require("three/examples/jsm/postprocessing/SSAARenderPass"),Ue=require("three/examples/jsm/shaders/FXAAShader"),ke=function(){try{var s=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&s.getContext("webgl2"))}catch(i){return!1}},bt=0,Ve=1,ge=!1,Re=ke()!==!1,Ie=`varying vec2 vUv;
|
|
1
|
+
(function(){var Be={187:function(j){"use strict";var A=typeof Reflect=="object"?Reflect:null,S=A&&typeof A.apply=="function"?A.apply:function(c,v,m){return Function.prototype.apply.call(c,v,m)},G;A&&typeof A.ownKeys=="function"?G=A.ownKeys:Object.getOwnPropertySymbols?G=function(c){return Object.getOwnPropertyNames(c).concat(Object.getOwnPropertySymbols(c))}:G=function(c){return Object.getOwnPropertyNames(c)};function D(f){console&&console.warn&&console.warn(f)}var E=Number.isNaN||function(c){return c!==c};function g(){g.init.call(this)}j.exports=g,j.exports.once=Q,g.EventEmitter=g,g.prototype._events=void 0,g.prototype._eventsCount=0,g.prototype._maxListeners=void 0;var B=10;function H(f){if(typeof f!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof f)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return B},set:function(f){if(typeof f!="number"||f<0||E(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");B=f}}),g.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},g.prototype.setMaxListeners=function(c){if(typeof c!="number"||c<0||E(c))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+c+".");return this._maxListeners=c,this};function U(f){return f._maxListeners===void 0?g.defaultMaxListeners:f._maxListeners}g.prototype.getMaxListeners=function(){return U(this)},g.prototype.emit=function(c){for(var v=[],m=1;m<arguments.length;m++)v.push(arguments[m]);var P=c==="error",L=this._events;if(L!==void 0)P=P&&L.error===void 0;else if(!P)return!1;if(P){var T;if(v.length>0&&(T=v[0]),T instanceof Error)throw T;var J=new Error("Unhandled error."+(T?" ("+T.message+")":""));throw J.context=T,J}var K=L[c];if(K===void 0)return!1;if(typeof K=="function")S(K,this,v);else for(var W=K.length,q=ae(K,W),m=0;m<W;++m)S(q[m],this,v);return!0};function x(f,c,v,m){var P,L,T;if(H(v),L=f._events,L===void 0?(L=f._events=Object.create(null),f._eventsCount=0):(L.newListener!==void 0&&(f.emit("newListener",c,v.listener?v.listener:v),L=f._events),T=L[c]),T===void 0)T=L[c]=v,++f._eventsCount;else if(typeof T=="function"?T=L[c]=m?[v,T]:[T,v]:m?T.unshift(v):T.push(v),P=U(f),P>0&&T.length>P&&!T.warned){T.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+T.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=f,J.type=c,J.count=T.length,D(J)}return f}g.prototype.addListener=function(c,v){return x(this,c,v,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(c,v){return x(this,c,v,!0)};function k(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(f,c,v){var m={fired:!1,wrapFn:void 0,target:f,type:c,listener:v},P=k.bind(m);return P.listener=v,m.wrapFn=P,P}g.prototype.once=function(c,v){return H(v),this.on(c,l(this,c,v)),this},g.prototype.prependOnceListener=function(c,v){return H(v),this.prependListener(c,l(this,c,v)),this},g.prototype.removeListener=function(c,v){var m,P,L,T,J;if(H(v),P=this._events,P===void 0)return this;if(m=P[c],m===void 0)return this;if(m===v||m.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete P[c],P.removeListener&&this.emit("removeListener",c,m.listener||v));else if(typeof m!="function"){for(L=-1,T=m.length-1;T>=0;T--)if(m[T]===v||m[T].listener===v){J=m[T].listener,L=T;break}if(L<0)return this;L===0?m.shift():ne(m,L),m.length===1&&(P[c]=m[0]),P.removeListener!==void 0&&this.emit("removeListener",c,J||v)}return this},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(c){var v,m,P;if(m=this._events,m===void 0)return this;if(m.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):m[c]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete m[c]),this;if(arguments.length===0){var L=Object.keys(m),T;for(P=0;P<L.length;++P)T=L[P],T!=="removeListener"&&this.removeAllListeners(T);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=m[c],typeof v=="function")this.removeListener(c,v);else if(v!==void 0)for(P=v.length-1;P>=0;P--)this.removeListener(c,v[P]);return this};function N(f,c,v){var m=f._events;if(m===void 0)return[];var P=m[c];return P===void 0?[]:typeof P=="function"?v?[P.listener||P]:[P]:v?X(P):ae(P,P.length)}g.prototype.listeners=function(c){return N(this,c,!0)},g.prototype.rawListeners=function(c){return N(this,c,!1)},g.listenerCount=function(f,c){return typeof f.listenerCount=="function"?f.listenerCount(c):ee.call(f,c)},g.prototype.listenerCount=ee;function ee(f){var c=this._events;if(c!==void 0){var v=c[f];if(typeof v=="function")return 1;if(v!==void 0)return v.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function ae(f,c){for(var v=new Array(c),m=0;m<c;++m)v[m]=f[m];return v}function ne(f,c){for(;c+1<f.length;c++)f[c]=f[c+1];f.pop()}function X(f){for(var c=new Array(f.length),v=0;v<c.length;++v)c[v]=f[v].listener||f[v];return c}function Q(f,c){return new Promise(function(v,m){function P(T){f.removeListener(c,L),m(T)}function L(){typeof f.removeListener=="function"&&f.removeListener("error",P),v([].slice.call(arguments))}R(f,c,L,{once:!0}),c!=="error"&&Y(f,P,{once:!0})})}function Y(f,c,v){typeof f.on=="function"&&R(f,"error",c,v)}function R(f,c,v,m){if(typeof f.on=="function")m.once?f.once(c,v):f.on(c,v);else if(typeof f.addEventListener=="function")f.addEventListener(c,function P(L){m.once&&f.removeEventListener(c,P),v(L)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(j){var A=function(S){"use strict";var G=Object.prototype,D=G.hasOwnProperty,E,g=typeof Symbol=="function"?Symbol:{},B=g.iterator||"@@iterator",H=g.asyncIterator||"@@asyncIterator",U=g.toStringTag||"@@toStringTag";function x(p,d,b){return Object.defineProperty(p,d,{value:b,enumerable:!0,configurable:!0,writable:!0}),p[d]}try{x({},"")}catch(p){x=function(d,b,M){return d[b]=M}}function k(p,d,b,M){var O=d&&d.prototype instanceof Q?d:Q,$=Object.create(O.prototype),se=new q(M||[]);return $._invoke=T(p,b,se),$}S.wrap=k;function l(p,d,b){try{return{type:"normal",arg:p.call(d,b)}}catch(M){return{type:"throw",arg:M}}}var N="suspendedStart",ee="suspendedYield",ae="executing",ne="completed",X={};function Q(){}function Y(){}function R(){}var f={};x(f,B,function(){return this});var c=Object.getPrototypeOf,v=c&&c(c(ve([])));v&&v!==G&&D.call(v,B)&&(f=v);var m=R.prototype=Q.prototype=Object.create(f);Y.prototype=R,x(m,"constructor",R),x(R,"constructor",Y),Y.displayName=x(R,U,"GeneratorFunction");function P(p){["next","throw","return"].forEach(function(d){x(p,d,function(b){return this._invoke(d,b)})})}S.isGeneratorFunction=function(p){var d=typeof p=="function"&&p.constructor;return d?d===Y||(d.displayName||d.name)==="GeneratorFunction":!1},S.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,R):(p.__proto__=R,x(p,U,"GeneratorFunction")),p.prototype=Object.create(m),p},S.awrap=function(p){return{__await:p}};function L(p,d){function b($,se,ie,oe){var te=l(p[$],p,se);if(te.type==="throw")oe(te.arg);else{var pe=te.arg,me=pe.value;return me&&typeof me=="object"&&D.call(me,"__await")?d.resolve(me.__await).then(function(he){b("next",he,ie,oe)},function(he){b("throw",he,ie,oe)}):d.resolve(me).then(function(he){pe.value=he,ie(pe)},function(he){return b("throw",he,ie,oe)})}}var M;function O($,se){function ie(){return new d(function(oe,te){b($,se,oe,te)})}return M=M?M.then(ie,ie):ie()}this._invoke=O}P(L.prototype),x(L.prototype,H,function(){return this}),S.AsyncIterator=L,S.async=function(p,d,b,M,O){O===void 0&&(O=Promise);var $=new L(k(p,d,b,M),O);return S.isGeneratorFunction(d)?$:$.next().then(function(se){return se.done?se.value:$.next()})};function T(p,d,b){var M=N;return function($,se){if(M===ae)throw new Error("Generator is already running");if(M===ne){if($==="throw")throw se;return de()}for(b.method=$,b.arg=se;;){var ie=b.delegate;if(ie){var oe=J(ie,b);if(oe){if(oe===X)continue;return oe}}if(b.method==="next")b.sent=b._sent=b.arg;else if(b.method==="throw"){if(M===N)throw M=ne,b.arg;b.dispatchException(b.arg)}else b.method==="return"&&b.abrupt("return",b.arg);M=ae;var te=l(p,d,b);if(te.type==="normal"){if(M=b.done?ne:ee,te.arg===X)continue;return{value:te.arg,done:b.done}}else te.type==="throw"&&(M=ne,b.method="throw",b.arg=te.arg)}}}function J(p,d){var b=p.iterator[d.method];if(b===E){if(d.delegate=null,d.method==="throw"){if(p.iterator.return&&(d.method="return",d.arg=E,J(p,d),d.method==="throw"))return X;d.method="throw",d.arg=new TypeError("The iterator does not provide a 'throw' method")}return X}var M=l(b,p.iterator,d.arg);if(M.type==="throw")return d.method="throw",d.arg=M.arg,d.delegate=null,X;var O=M.arg;if(!O)return d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,X;if(O.done)d[p.resultName]=O.value,d.next=p.nextLoc,d.method!=="return"&&(d.method="next",d.arg=E);else return O;return d.delegate=null,X}P(m),x(m,U,"Generator"),x(m,B,function(){return this}),x(m,"toString",function(){return"[object Generator]"});function K(p){var d={tryLoc:p[0]};1 in p&&(d.catchLoc=p[1]),2 in p&&(d.finallyLoc=p[2],d.afterLoc=p[3]),this.tryEntries.push(d)}function W(p){var d=p.completion||{};d.type="normal",delete d.arg,p.completion=d}function q(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(K,this),this.reset(!0)}S.keys=function(p){var d=[];for(var b in p)d.push(b);return d.reverse(),function M(){for(;d.length;){var O=d.pop();if(O in p)return M.value=O,M.done=!1,M}return M.done=!0,M}};function ve(p){if(p){var d=p[B];if(d)return d.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var b=-1,M=function O(){for(;++b<p.length;)if(D.call(p,b))return O.value=p[b],O.done=!1,O;return O.value=E,O.done=!0,O};return M.next=M}}return{next:de}}S.values=ve;function de(){return{value:E,done:!0}}return q.prototype={constructor:q,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=E,this.done=!1,this.delegate=null,this.method="next",this.arg=E,this.tryEntries.forEach(W),!p)for(var d in this)d.charAt(0)==="t"&&D.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=E)},stop:function(){this.done=!0;var p=this.tryEntries[0],d=p.completion;if(d.type==="throw")throw d.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var d=this;function b(oe,te){return $.type="throw",$.arg=p,d.next=oe,te&&(d.method="next",d.arg=E),!!te}for(var M=this.tryEntries.length-1;M>=0;--M){var O=this.tryEntries[M],$=O.completion;if(O.tryLoc==="root")return b("end");if(O.tryLoc<=this.prev){var se=D.call(O,"catchLoc"),ie=D.call(O,"finallyLoc");if(se&&ie){if(this.prev<O.catchLoc)return b(O.catchLoc,!0);if(this.prev<O.finallyLoc)return b(O.finallyLoc)}else if(se){if(this.prev<O.catchLoc)return b(O.catchLoc,!0)}else if(ie){if(this.prev<O.finallyLoc)return b(O.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,d){for(var b=this.tryEntries.length-1;b>=0;--b){var M=this.tryEntries[b];if(M.tryLoc<=this.prev&&D.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var O=M;break}}O&&(p==="break"||p==="continue")&&O.tryLoc<=d&&d<=O.finallyLoc&&(O=null);var $=O?O.completion:{};return $.type=p,$.arg=d,O?(this.method="next",this.next=O.finallyLoc,X):this.complete($)},complete:function(p,d){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&d&&(this.next=d),X},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var b=this.tryEntries[d];if(b.finallyLoc===p)return this.complete(b.completion,b.afterLoc),W(b),X}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var b=this.tryEntries[d];if(b.tryLoc===p){var M=b.completion;if(M.type==="throw"){var O=M.arg;W(b)}return O}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,b){return this.delegate={iterator:ve(p),resultName:d,nextLoc:b},this.method==="next"&&(this.arg=E),X}},S}(j.exports);try{regeneratorRuntime=A}catch(S){typeof globalThis=="object"?globalThis.regeneratorRuntime=A:Function("r","regeneratorRuntime = r")(A)}},182:function(j,A,S){"use strict";S.d(A,{Z:function(){return G}});function G(D){if(D.geometry&&D.geometry.dispose(),D.material){var E=Array.isArray(D.material)?D.material:[D.material];E.forEach(function(g){var B,H,U,x,k,l,N,ee,ae,ne,X,Q,Y;(B=g.map)===null||B===void 0||B.dispose(),(H=g.lightMap)===null||H===void 0||H.dispose(),(U=g.bumpMap)===null||U===void 0||U.dispose(),(x=g.normalMap)===null||x===void 0||x.dispose(),(k=g.specularMap)===null||k===void 0||k.dispose(),(l=g.envMap)===null||l===void 0||l.dispose(),(N=g.alphaMap)===null||N===void 0||N.dispose(),(ee=g.aoMap)===null||ee===void 0||ee.dispose(),(ae=g.displacementMap)===null||ae===void 0||ae.dispose(),(ne=g.emissiveMap)===null||ne===void 0||ne.dispose(),(X=g.gradientMap)===null||X===void 0||X.dispose(),(Q=g.metalnessMap)===null||Q===void 0||Q.dispose(),(Y=g.roughnessMap)===null||Y===void 0||Y.dispose(),g.dispose()})}}},54:function(j,A,S){"use strict";S.d(A,{disposeMesh:function(){return g.Z},isPlainObject:function(){return U.Z}});var G=S(666),D=S.n(G),E=null,g=S(182),B=S(644);function H(Q){if(Q.material){var Y=Array.isArray(Q.material)?Q.material:[Q.material];Y.forEach(function(R){var f,c;(f=R.color)===null||f===void 0||f.convertSRGBToLinear(),(c=R.emissive)===null||c===void 0||c.convertSRGBToLinear(),R.map&&(R.map.encoding=THREE.sRGBEncoding),R.emissiveMap&&(R.emissiveMap.encoding=THREE.sRGBEncoding)})}}var U=S(975),x=S(568),k=S(924),l=require("idb-keyval"),N=S(620),ee=null,ae=null,ne=function(){var Q=(0,x.Z)(D().mark(function Y(R,f){var c,v,m,P,L,T;return D().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return c=f.version,K.next=4,(0,l.get)(R);case 4:if(m=K.sent,!(m&&m[c])){K.next=9;break}v=m[c],K.next=15;break;case 9:return K.next=11,(0,N.Z)(fetch(R).then(function(W){if(W.ok)return W.blob();throw new Error}));case 11:P=K.sent,L=P.res,T=P.err,T||(v=L,(0,l.set)(R,(0,k.Z)({},c,L)));case 15:return K.abrupt("return",v?{url:URL.createObjectURL(v)}:{url:R});case 16:case"end":return K.stop()}},Y)}));return function(R,f){return Q.apply(this,arguments)}}(),X=S(977)},975:function(j,A,S){"use strict";S.d(A,{Z:function(){return D}});function G(E){return Object.prototype.toString.call(E)==="[object Object]"}function D(E){if(G(E)===!1)return!1;var g=E.constructor;if(g===void 0)return!0;var B=g.prototype;return!(G(B)===!1||B.hasOwnProperty("isPrototypeOf")===!1)}},620:function(j,A,S){"use strict";S.d(A,{Z:function(){return D}});var G=S(42);function D(E){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.then(function(B){return(0,G.Z)({err:null,res:B},g)}).catch(function(B){return(0,G.Z)({err:B,res:void 0},g)})}},977:function(j,A,S){"use strict";var G=S(644),D=S.n(G),E=new Map,g=function(H){return{generateTopUV:function(U,x,k,l,N){var ee=x[k*3],ae=x[k*3+1],ne=x[l*3],X=x[l*3+1],Q=x[N*3],Y=x[N*3+1],R;if(E.has(U))R=E.get(U);else{var f=H&&H.Box3||new THREE.Box3;if(!H||!H.Box3){var c=U.parameters.shapes.getPoints();f.setFromArray(c.map(function(L){return[L.x,L.y,0]}).flat())}var v=f.getSize(new THREE.Vector3);R={box:f,size:v},E.set(U,R)}var m=R.box,P=R.size;return[new THREE.Vector2((ee-m.min.x)/P.x,(ae-m.min.y)/P.y),new THREE.Vector2((ne-m.min.x)/P.x,(X-m.min.y)/P.y),new THREE.Vector2((Q-m.min.x)/P.x,(Y-m.min.y)/P.y)]},generateSideWallUV:function(U,x,k,l,N,ee){var ae=x[k*3],ne=x[k*3+1],X=x[k*3+2],Q=x[l*3],Y=x[l*3+1],R=x[l*3+2],f=x[N*3],c=x[N*3+1],v=x[N*3+2],m=x[ee*3],P=x[ee*3+1],L=x[ee*3+2],T;if(E.has(x))T=E.get(x);else{var J=new THREE.Box3;J.setFromArray(x);var K=J.getSize(new THREE.Vector3);T={box:J,size:K},E.set(x,T)}var W=T.box,q=T.size;return Math.abs(ne-Y)<.01?[new THREE.Vector2((ae-W.min.x)/q.x,(X-W.min.z)/q.z),new THREE.Vector2((Q-W.min.x)/q.x,(R-W.min.z)/q.z),new THREE.Vector2((f-W.min.x)/q.x,(v-W.min.z)/q.z),new THREE.Vector2((m-W.min.x)/q.x,(L-W.min.z)/q.z)]:[new THREE.Vector2((ne-W.min.y)/q.x,(X-W.min.z)/q.z),new THREE.Vector2((Y-W.min.y)/q.x,(R-W.min.z)/q.z),new THREE.Vector2((c-W.min.y)/q.x,(v-W.min.z)/q.z),new THREE.Vector2((P-W.min.y)/q.x,(L-W.min.z)/q.z)]}}},B=function(){E.clear()}},644:function(j){"use strict";j.exports=require("three")},568:function(j,A,S){"use strict";S.d(A,{Z:function(){return D}});function G(E,g,B,H,U,x,k){try{var l=E[x](k),N=l.value}catch(ee){B(ee);return}l.done?g(N):Promise.resolve(N).then(H,U)}function D(E){return function(){var g=this,B=arguments;return new Promise(function(H,U){var x=E.apply(g,B);function k(N){G(x,H,U,k,l,"next",N)}function l(N){G(x,H,U,k,l,"throw",N)}k(void 0)})}}},924:function(j,A,S){"use strict";S.d(A,{Z:function(){return G}});function G(D,E,g){return E in D?Object.defineProperty(D,E,{value:g,enumerable:!0,configurable:!0,writable:!0}):D[E]=g,D}},42:function(j,A,S){"use strict";S.d(A,{Z:function(){return D}});var G=S(924);function D(E){for(var g=1;g<arguments.length;g++){var B=arguments[g]!=null?arguments[g]:{},H=Object.keys(B);typeof Object.getOwnPropertySymbols=="function"&&(H=H.concat(Object.getOwnPropertySymbols(B).filter(function(U){return Object.getOwnPropertyDescriptor(B,U).enumerable}))),H.forEach(function(U){(0,G.Z)(E,U,B[U])})}return E}}},Oe={};function re(j){var A=Oe[j];if(A!==void 0)return A.exports;var S=Oe[j]={exports:{}};return Be[j](S,S.exports,re),S.exports}(function(){re.n=function(j){var A=j&&j.__esModule?function(){return j.default}:function(){return j};return re.d(A,{a:A}),A}})(),function(){re.d=function(j,A){for(var S in A)re.o(A,S)&&!re.o(j,S)&&Object.defineProperty(j,S,{enumerable:!0,get:A[S]})}}(),function(){re.o=function(j,A){return Object.prototype.hasOwnProperty.call(j,A)}}(),function(){re.r=function(j){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(j,"__esModule",{value:!0})}}();var Pe={};(function(){"use strict";re.r(Pe),re.d(Pe,{BaseObject:function(){return pt},GUIObject:function(){return R},Pencil:function(){return xe},default:function(){return xe}});function j(s,i){if(!(s instanceof i))throw new TypeError("Cannot call a class as a function")}function A(s,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(s,e.key,e)}}function S(s,i,n){return i&&A(s.prototype,i),n&&A(s,n),s}var G=re(42);function D(s,i){var n=Object.keys(s);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(s);i&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(s,t).enumerable})),n.push.apply(n,e)}return n}function E(s,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(i)):D(Object(i)).forEach(function(n){Object.defineProperty(s,n,Object.getOwnPropertyDescriptor(i,n))}),s}function g(s,i){(i==null||i>s.length)&&(i=s.length);for(var n=0,e=new Array(i);n<i;n++)e[n]=s[n];return e}function B(s){if(Array.isArray(s))return g(s)}function H(s){if(typeof Symbol!="undefined"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}function U(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function x(s,i){if(!!s){if(typeof s=="string")return g(s,i);var n=Object.prototype.toString.call(s).slice(8,-1);if(n==="Object"&&s.constructor&&(n=s.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(s,i)}}function k(s){return B(s)||H(s)||x(s)||U()}var l=re(644),N=re(187),ee=require("deepmerge"),ae=re.n(ee),ne=require("three/examples/jsm/libs/stats.module"),X=re.n(ne),Q=require("lil-gui"),Y=re.n(Q),R=function(){"use strict";function s(n){j(this,s),this.guiParams={},n&&(this.guiParams=n)}var i=s.prototype;return i.showGui=function(e){var t=this;!e||Object.keys(this.guiParams).forEach(function(r){var o=e.addFolder(r),u=t.guiParams[r];Object.keys(u).forEach(function(a){var h=u[a],C=h.min,_=h.max,y=h.step,w=h.name,z=h.paramMap,V=h.items,F=h.value,Z=h.target,le=a.toLowerCase().indexOf("color")>-1,I,ue=typeof F=="undefined"&&Z,ce=ue?Z():u[a],fe=ue?a:"value";V?I=o.add(ce,fe,V):le?I=o.addColor(ce,fe):I=o.add(ce,fe),I=I.name(w||a),typeof C!="undefined"&&(I=I.min(C)),typeof _!="undefined"&&(I=I.max(_)),typeof y!="undefined"&&(I=I.step(y)),I=I.onChange(function(){t.setTargetValue(r,a,ce[fe],z)}),ue&&I.listen()})})},i.setTargetValue=function(e,t,r,o){var u=this.guiParams[e][t],a=u.onChange,h=u.target,C=u.value,_=t.toLowerCase().indexOf("color")>-1,y=typeof C=="undefined"&&h;if(h&&!y){var w=h();Array.isArray(w)||(w=[w]),w.forEach(function(z){if(!!z)if(_)try{z[o||t].set(r)}catch(V){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else z[o||t]=r})}a&&a(r)},i.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(t){Object.keys(e.guiParams[t]).forEach(function(r){var o=e.guiParams[t][r];typeof o.value!="undefined"&&e.setTargetValue(t,r,o.value,o.paramMap)})})},s}(),f={None:l.NoToneMapping,Linear:l.LinearToneMapping,Reinhard:l.ReinhardToneMapping,Cineon:l.CineonToneMapping,ACESFilmic:l.ACESFilmicToneMapping},c={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:l.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},v=function(){"use strict";function s(n){j(this,s),this.options=n;var e=n.width,t=n.height,r=n.rendererParams,o=r.context,u=r.alpha,a=r.devicePixelRatio,h=r.antialias,C=r.powerPreference,_=r.toneMapping,y=r.toneMappingExposure,w=r.outputEncoding,z=r.logarithmicDepthBuffer,V=r.preserveDrawingBuffer,F=new l.WebGLRenderer({context:o,alpha:u,antialias:h,powerPreference:C,logarithmicDepthBuffer:z,preserveDrawingBuffer:V});F.setSize(e,t),F.setPixelRatio(a),F.autoClear=!1,F.toneMapping=f[_],F.toneMappingExposure=y,F.outputEncoding=w,this.renderer=F}var i=s.prototype;return i.setSize=function(e,t){this.renderer.setSize(e,t)},i.render=function(){var e=this.options,t=e.scene,r=e.camera;this.renderer.render(t,r)},i.setGui=function(e){var t=this,r=new R({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:f,target:function(){return t.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return t.renderer}}}});r.showGui(e)},i.dispose=function(){var e,t,r;(e=this.renderer)===null||e===void 0||e.clear(),(t=this.renderer)===null||t===void 0||t.dispose(),(r=this.renderer)===null||r===void 0||r.renderLists.dispose()},s}(),m={fov:45,near:1,far:1e3},P=function(){"use strict";function s(n){j(this,s),this.oldCameraPosition=new l.Vector3,this.oldCameraRotation=new l.Euler,this.customCamera=!1,this.options=n;var e=n.width,t=n.height,r=n.cameraParams;if(r instanceof l.Camera)this.camera=r,this.customCamera=!0;else{var o=r.fov,u=r.far,a=r.near,h=new l.PerspectiveCamera(o,e/t,a,u);h.position.set(0,0,400),h.lookAt(0,0,0),this.camera=h}}var i=s.prototype;return i.checkCameraChange=function(){var e=this.camera,t=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!t},i.setSize=function(e,t){this.camera instanceof l.PerspectiveCamera&&(this.camera.aspect=e/t),this.camera.updateProjectionMatrix()},i.setGui=function(e){var t=this,r=new R({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}}});this.camera instanceof l.PerspectiveCamera&&(r.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}),r.showGui(e)},s}(),L=re(54),T={background:null},J=function(){"use strict";function s(n){j(this,s),this.options=n;var e=n.camera,t=n.sceneParams,r=t.background,o=new l.Scene;r&&(o.background=r),o.add(e),this.scene=o}var i=s.prototype;return i.addAxesHelper=function(){var e,t=new l.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(t)},i.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(t){(0,L.disposeMesh)(t)})},s}(),K=require("three/examples/jsm/controls/OrbitControls"),W={},q=function(){"use strict";function s(n){j(this,s),this.options=n;var e=n.camera,t=n.controlParams,r=n.mapControl,o=t.domElement,u=r?new K.MapControls(e,o):new K.OrbitControls(e,o);u.minPolarAngle=Math.PI*.15,u.maxPolarAngle=Math.PI*.85,u.enableDamping=!0,u.dampingFactor=.063,u.autoRotate=!1,u.autoRotateSpeed=-60,u.enableZoom=!0,u.zoomSpeed=.2,this.control=u}var i=s.prototype;return i.limitPan=function(e){var t=e.maxX,r=t===void 0?1/0:t,o=e.minX,u=o===void 0?-1/0:o,a=e.maxZ,h=a===void 0?1/0:a,C=e.minZ,_=C===void 0?-1/0:C,y=e.maxY,w=y===void 0?1/0:y,z=e.minY,V=z===void 0?-1/0:z,F=this.limitPanV||new l.Vector3,Z=this.control,le=this.options.camera,I=new l.Vector3(u,V,_),ue=new l.Vector3(r,w,h);this.limitPanV=F,F.copy(Z.target),Z.target.clamp(I,ue),F.sub(Z.target),le.position.sub(F)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},s}(),ve=require("three/examples/jsm/renderers/CSS3DRenderer"),de=new l.Vector3,p=new l.Matrix4,d=new l.Matrix4,b=new l.Vector3,M=new l.Vector3,O=function s(){"use strict";var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};j(this,s);var n=function(z,V){return b.setFromMatrixPosition(z.matrixWorld),M.setFromMatrixPosition(V.matrixWorld),b.distanceToSquared(M)},e=function(z){var V=[];return z.traverse(function(F){F.isCSS2DObject&&V.push(F)}),V},t=function(z){for(var V=e(z).sort(function(ue,ce){if(ue.renderOrder!==ce.renderOrder)return ce.renderOrder-ue.renderOrder;var fe=C.objects.get(ue).distanceToCameraSquared,ye=C.objects.get(ce).distanceToCameraSquared;return fe-ye}),F=V.length,Z=0,le=V.length;Z<le;Z++){var I=V[Z].userData.zIndexFix||0;V[Z].element.style.zIndex=F-Z+I}},r=this,o,u,a,h,C={objects:new WeakMap},_=i.element!==void 0?i.element:document.createElement("div");_.style.overflow="hidden",this.domElement=_,this.getSize=function(){return{width:o,height:u}},this.render=function(w,z){w.autoUpdate===!0&&w.updateMatrixWorld(),z.parent===null&&z.updateMatrixWorld(),p.copy(z.matrixWorldInverse),d.multiplyMatrices(z.projectionMatrix,p),y(w,w,z),t(w)},this.setSize=function(w,z){o=w,u=z,a=o/2,h=u/2,_.style.width="".concat(w,"px"),_.style.height="".concat(z,"px")};function y(w,z,V){if(w.isCSS2DObject){de.setFromMatrixPosition(w.matrixWorld),de.applyMatrix4(d);var F=w.visible===!0&&de.z>=-1&&de.z<=1&&w.layers.test(V.layers)===!0;if(w.element.style.display=F===!0?"":"none",F===!0){w.onBeforeRender(r,z,V);var Z=w.element;Z.style.transform="translate(-50%,-50%) translate(".concat(de.x*a+a,"px,").concat(-de.y*h+h,"px)"),Z.parentNode!==_&&_.appendChild(Z),w.onAfterRender(r,z,V)}var le={distanceToCameraSquared:n(V,w)};C.objects.set(w,le)}for(var I=0,ue=w.children.length;I<ue;I++)y(w.children[I],z,V)}},$={zIndex:"auto"},se=function(){"use strict";function s(n){j(this,s),this.container=n}var i=s.prototype;return i.addRenderer=function(e,t){var r=this.container,o=r.offsetWidth,u=r.offsetHeight,a=e==="css2d"?new O:new ve.CSS3DRenderer;a.domElement.style.position="absolute",a.domElement.style.top="0",a.domElement.style.pointerEvents="none",a.domElement.style.zIndex=t.zIndex,a.setSize(o,u),r.appendChild(a.domElement),e==="css2d"?this.css2Drenderer=a:e==="css3d"&&(this.css3Drenderer=a)},i.setSize=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.setSize(e,t),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,t)},i.render=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.render(e,t),(o=this.css3Drenderer)===null||o===void 0||o.render(e,t)},i.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},s}(),ie=require("three/examples/jsm/postprocessing/EffectComposer"),oe=require("three/examples/jsm/postprocessing/RenderPass"),te=require("three/examples/jsm/postprocessing/ShaderPass"),pe=require("three/examples/jsm/shaders/CopyShader"),me=require("three/examples/jsm/shaders/GammaCorrectionShader"),he=require("three/examples/jsm/postprocessing/SMAAPass"),Ve=require("three/examples/jsm/postprocessing/SSAARenderPass"),Fe=require("three/examples/jsm/shaders/FXAAShader"),Ue=function(){try{var s=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&s.getContext("webgl2"))}catch(i){return!1}},bt=0,ke=1,ge=!1,Re=Ue()!==!1,Ie=`varying vec2 vUv;
|
|
2
2
|
|
|
3
3
|
void main() {
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ void main() {
|
|
|
6
6
|
|
|
7
7
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
8
8
|
|
|
9
|
-
}`,
|
|
9
|
+
}`,He=`uniform sampler2D baseTexture;
|
|
10
10
|
uniform sampler2D bloomTexture;
|
|
11
11
|
|
|
12
12
|
varying vec2 vUv;
|
|
@@ -15,7 +15,7 @@ void main() {
|
|
|
15
15
|
|
|
16
16
|
gl_FragColor = (texture2D(baseTexture, vUv) + vec4(1.0) * texture2D(bloomTexture, vUv));
|
|
17
17
|
|
|
18
|
-
}`;function
|
|
18
|
+
}`;function _e(s,i){return _e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_e(s,i)}function Te(s,i){return _e(s,i)}function Ne(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(i&&i.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),i&&Te(s,i)}function We(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function we(s){return we=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},we(s)}function Ee(s){return we(s)}function Ze(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function Xe(s){return s&&s.constructor===Symbol?"symbol":typeof s}function qe(s,i){return i&&(Xe(i)==="object"||typeof i=="function")?i:Ze(s)}function Qe(s){var i=We();return function(){var e=Ee(s),t;if(i){var r=Ee(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return qe(this,t)}}var Me=require("three/examples/jsm/postprocessing/Pass"),je=require("three/examples/jsm/shaders/LuminosityHighPassShader"),Se=function(s){"use strict";Ne(n,s);var i=Qe(n);function n(t,r,o,u){j(this,n);var a;a=i.call(this),a.strength=r!==void 0?r:1,a.radius=o,a.threshold=u,a.resolution=t!==void 0?new l.Vector2(t.x,t.y):new l.Vector2(256,256),a.clearColor=new l.Color(0,0,0);var h={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat};a.renderTargetsHorizontal=[],a.renderTargetsVertical=[],a.nMips=5;var C=Math.round(a.resolution.x/2),_=Math.round(a.resolution.y/2);a.renderTargetBright=new l.WebGLRenderTarget(C,_,h),a.renderTargetBright.texture.name="UnrealBloomPass.bright",a.renderTargetBright.texture.generateMipmaps=!1;for(var y=0;y<a.nMips;y++){var w=new l.WebGLRenderTarget(C,_,h);w.texture.name="UnrealBloomPass.h".concat(y),w.texture.generateMipmaps=!1,a.renderTargetsHorizontal.push(w);var z=new l.WebGLRenderTarget(C,_,h);z.texture.name="UnrealBloomPass.v".concat(y),z.texture.generateMipmaps=!1,a.renderTargetsVertical.push(z),C=Math.round(C/2),_=Math.round(_/2)}je.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var V=je.LuminosityHighPassShader;a.highPassUniforms=l.UniformsUtils.clone(V.uniforms),a.highPassUniforms.luminosityThreshold.value=u,a.highPassUniforms.smoothWidth.value=.01,a.materialHighPassFilter=new l.ShaderMaterial({uniforms:a.highPassUniforms,vertexShader:V.vertexShader,fragmentShader:V.fragmentShader,defines:{}}),a.separableBlurMaterials=[];var F=[3,5,7,9,11];C=Math.round(a.resolution.x/2),_=Math.round(a.resolution.y/2);for(var Z=0;Z<a.nMips;Z++)a.separableBlurMaterials.push(a.getSeperableBlurMaterial(F[Z])),a.separableBlurMaterials[Z].uniforms.texSize.value=new l.Vector2(C,_),C=Math.round(C/2),_=Math.round(_/2);a.compositeMaterial=a.getCompositeMaterial(a.nMips),a.compositeMaterial.uniforms.blurTexture1.value=a.renderTargetsVertical[0].texture,a.compositeMaterial.uniforms.blurTexture2.value=a.renderTargetsVertical[1].texture,a.compositeMaterial.uniforms.blurTexture3.value=a.renderTargetsVertical[2].texture,a.compositeMaterial.uniforms.blurTexture4.value=a.renderTargetsVertical[3].texture,a.compositeMaterial.uniforms.blurTexture5.value=a.renderTargetsVertical[4].texture,a.compositeMaterial.uniforms.bloomStrength.value=r,a.compositeMaterial.uniforms.bloomRadius.value=.1,a.compositeMaterial.needsUpdate=!0;var le=[1,.8,.6,.4,.2];a.compositeMaterial.uniforms.bloomFactors.value=le,a.bloomTintColors=[new l.Vector3(1,1,1),new l.Vector3(1,1,1),new l.Vector3(1,1,1),new l.Vector3(1,1,1),new l.Vector3(1,1,1)],a.compositeMaterial.uniforms.bloomTintColors.value=a.bloomTintColors,pe.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var I=pe.CopyShader;return a.copyUniforms=l.UniformsUtils.clone(I.uniforms),a.copyUniforms.opacity.value=1,a.materialCopy=new l.ShaderMaterial({uniforms:a.copyUniforms,vertexShader:I.vertexShader,fragmentShader:I.fragmentShader,blending:l.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),a.enabled=!0,a.needsSwap=!1,a._oldClearColor=new l.Color,a.oldClearAlpha=1,a.basic=new l.MeshBasicMaterial,a.fsQuad=new Me.FullScreenQuad(void 0),a}var e=n.prototype;return e.dispose=function(){for(var r=0;r<this.renderTargetsHorizontal.length;r++)this.renderTargetsHorizontal[r].dispose();for(var o=0;o<this.renderTargetsVertical.length;o++)this.renderTargetsVertical[o].dispose();this.renderTargetBright.dispose()},e.setSize=function(r,o){var u=Math.round(r/2),a=Math.round(o/2);this.renderTargetBright.setSize(u,a);for(var h=0;h<this.nMips;h++)this.renderTargetsHorizontal[h].setSize(u,a),this.renderTargetsVertical[h].setSize(u,a),this.separableBlurMaterials[h].uniforms.texSize.value=new l.Vector2(u,a),u=Math.round(u/2),a=Math.round(a/2)},e.render=function(r,o,u,a,h){r.getClearColor(this._oldClearColor),this.oldClearAlpha=r.getClearAlpha();var C=r.autoClear;r.autoClear=!1,r.setClearColor(this.clearColor,0),h&&r.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=u.texture,r.setRenderTarget(null),r.clear(),this.fsQuad.render(r)),this.highPassUniforms.tDiffuse.value=u.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,r.setRenderTarget(this.renderTargetBright),r.clear(),this.fsQuad.render(r);for(var _=this.renderTargetBright,y=0;y<this.nMips;y++)this.fsQuad.material=this.separableBlurMaterials[y],this.separableBlurMaterials[y].uniforms.colorTexture.value=_.texture,this.separableBlurMaterials[y].uniforms.direction.value=n.BlurDirectionX,r.setRenderTarget(this.renderTargetsHorizontal[y]),r.clear(),this.fsQuad.render(r),this.separableBlurMaterials[y].uniforms.colorTexture.value=this.renderTargetsHorizontal[y].texture,this.separableBlurMaterials[y].uniforms.direction.value=n.BlurDirectionY,r.setRenderTarget(this.renderTargetsVertical[y]),r.clear(),this.fsQuad.render(r),_=this.renderTargetsVertical[y];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,r.setRenderTarget(this.renderTargetsHorizontal[0]),r.clear(),this.fsQuad.render(r),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,h&&r.state.buffers.stencil.setTest(!0),this.renderToScreen?(r.setRenderTarget(null),this.fsQuad.render(r)):(r.setRenderTarget(u),this.fsQuad.render(r)),r.setClearColor(this._oldClearColor,this.oldClearAlpha),r.autoClear=C},e.getSeperableBlurMaterial=function(r){return new l.ShaderMaterial({defines:{KERNEL_RADIUS:r,SIGMA:r},uniforms:{colorTexture:{value:null},texSize:{value:new l.Vector2(.5,.5)},direction:{value:new l.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
|
|
19
19
|
void main() {
|
|
20
20
|
vUv = uv;
|
|
21
21
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
@@ -54,4 +54,4 @@ void main() {
|
|
|
54
54
|
lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
|
|
55
55
|
lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
|
|
56
56
|
lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
|
|
57
|
-
}`})},n}(je.Pass);we.BlurDirectionX=new l.Vector2(1,0),we.BlurDirectionY=new l.Vector2(0,1);var Ye={threshold:.2,strength:.5,radius:0},Ke=new l.MeshBasicMaterial({color:"black"}),$e=new l.SpriteMaterial({color:"#000"}),Je=function(){"use strict";function s(n,e){R(this,s),this.materials={},this.bloomLayer=new l.Layers,this.active=!0,this.composerController=n,this.options=e;var t=n.renderer,r=n.renderPass,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,w=new we(new l.Vector2(a,h),e.strength,e.radius,e.threshold);this.bloomPass=w;var P=new J.EffectComposer(t);P.renderToScreen=!1,P.addPass(r),P.addPass(this.bloomPass),this.bloomComposer=P,this.bloomLayer.set(Ve);var y=new l.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:P.renderTarget2.texture}},vertexShader:Ie,fragmentShader:Ne,defines:{}}),S=new Y.ShaderPass(y,"baseTexture");S.needsSwap=!0,this.finalPass=S,o.addPass(S)}var i=s.prototype;return i.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},i.render=function(e){if(!!this.active){var t=this,r=t.bloomComposer,o=t.bloomLayer,u=t.materials;e.traverse(function(a){var h=a;h.material&&o.test(h.layers)===!1&&(u[h.uuid]=h.material,h.material=h.isSprite?$e:Ke)}),r.render(),e.traverse(function(a){var h=a;u[h.uuid]&&(h.material=u[h.uuid],delete u[h.uuid])})}},i.setSize=function(e,t){this.bloomComposer.setSize(e,t)},i.setGui=function(e){var t=this,r=new U({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return t.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return t.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return t.bloomPass}}}});r.showGui(e)},i.dispose=function(){this.bloomPass.dispose(),this.materials={}},s}(),et=require("three/examples/jsm/postprocessing/OutlinePass"),tt={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},rt=function(){"use strict";function s(n,e){R(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,w=new et.OutlinePass(new l.Vector2(a,h),t,r);w.selectedObjects=this.selectedObjects,this.outlinePass=w,o.addPass(w),this.setGui()}var i=s.prototype;return i.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},i.setGui=function(){var e=this,t=new U({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});t.setTargetValueByParams(),this.outlineGui=t},i.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},s}();function nt(s,i){if(s==null)return{};var n={},e=Object.keys(s),t,r;for(r=0;r<e.length;r++)t=e[r],!(i.indexOf(t)>=0)&&(n[t]=s[t]);return n}function it(s,i){if(s==null)return{};var n=nt(s,i),e,t;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);for(t=0;t<r.length;t++)e=r[t],!(i.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(s,e)||(n[e]=s[e]))}return n}var at=require("three/examples/jsm/postprocessing/SSRPass"),st=require("three/examples/jsm/objects/ReflectorForSSRPass"),ot={maxDistance:10,selects:!0},ut={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},lt=function(){"use strict";function s(n,e){R(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.renderer,u=n.finalComposer,a=n.getSize(),h=a.width,w=a.height,P=new at.SSRPass({renderer:o,scene:t,camera:r,width:h,height:w,groundReflector:null,selects:this.selectedObjects});this.ssrPass=P,u.addPass(P),this.setGui()}var i=s.prototype;return i.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,z.Z)({},ut,e),r=t.width,o=t.height,u=it(t,["width","height"]),a=this.composerController,h=a.scene,w=a.getSize(),P=new l.PlaneGeometry(r,o),y=new st.ReflectorForSSRPass(P,E((0,z.Z)({},u),{textureWidth:w.width,textureHeight:w.height}));y.material.depthWrite=!1,y.rotation.x=-Math.PI/2,y.visible=!1,h.add(y),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=y},i.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},i.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},i.setSize=function(e,t){var r=this.groundReflector;r&&(r.getRenderTarget().setSize(e,t),r.resolution.set(e,t))},i.setGui=function(){var e=this,t=new U({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(r){r?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});t.setTargetValueByParams(),this.ssrGui=t},i.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},s}(),ct=function(){"use strict";function s(n){R(this,s),this.active=!0,this.options=n;var e=n.renderer,t=n.scene,r=n.camera,o=this.createRenderTarget(),u=new J.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=r}var i=s.prototype;return i.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,r=e.type,o=e.encoding,u=this.getSize(),a={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat,encoding:o,type:r},h;if(+l.REVISION<138&&t>0){var w=new l.WebGLMultisampleRenderTarget(u.width,u.height,a);w.samples=t,h=w}else if(+l.REVISION>=138&&t>0){var P=new l.WebGLRenderTarget(u.width,u.height,E((0,z.Z)({},a),{samples:t}));h=P}else{var y=new l.WebGLRenderTarget(u.width,u.height,a);h=y}return h.texture.name="EffectComposer.rt1",h},i.addRenderPasss=function(){var e=this.options,t=e.scene,r=e.camera,o=new te.RenderPass(t,r);this.finalComposer.addPass(o),this.renderPass=o},i.addCopyPass=function(){var e=new Y.ShaderPass(pe.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},i.addGammaCorrectionPass=function(){var e=new Y.ShaderPass(me.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},i.addFXAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=new Y.ShaderPass(Ue.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,r)},i.addSMAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=this.options.renderer,u=new fe.SMAAPass(t*o.getPixelRatio(),r*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},i.addSSAAPass=function(){var e=this.options,t=e.scene,r=e.camera,o=new Fe.SSAARenderPass(t,r,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},i.addBloomPass=function(e){var t=new Je(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},i.addOutlinePass=function(e){var t=new rt(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},i.addSSRPass=function(e){var t=new lt(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},i.getSize=function(){var e=this.options.renderer;return e.getSize(new l.Vector2)},i.enable=function(){this.active||(this.active=!0)},i.disable=function(){!this.active||(this.active=!1)},i.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(r){return r!==e.renderPass&&r!==e.copyPass?r.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},i.setSize=function(e,t){var r,o;this.finalComposer.setSize(e,t),(r=this.bloomController)===null||r===void 0||r.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},i.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var r=this.options.renderer,o=r.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*o)}},i.render=function(){var e;if(!!this.active){var t=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(t),this.finalComposer.render()}},i.dispose=function(){var e,t,r;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(r=this.ssrController)===null||r===void 0||r.dispose(),this.finalComposer.passes.forEach(function(o){var u,a,h;(u=o.fsQuad)===null||u===void 0||u.dispose(),(a=o.fsQuad)===null||a===void 0||(h=a.material)===null||h===void 0||h.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},s}(),Ce=function(){"use strict";function s(n){R(this,s),this.raycaster=new l.Raycaster,this.installPlugins=new Map,this.event=new Q.EventEmitter,this.clock=new l.Clock,this.options=oe()(s.options,n,{isMergeableObject:L.isPlainObject});var e=this.options,t=e.container,r=e.stats,o=e.gui;if(o){var u=new(A());u.open(!1),this.gui=u}if(r){var a=new(I());a.showPanel(0),a.dom.style.position="absolute",t.appendChild(a.dom),this.stats=a}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var i=s.prototype;return i.use=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var u;(u=e).install.apply(u,[this].concat(X(r))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this,t=this.options,r=t.container,o=t.isdev,u=t.axesHelper,a=t.renderer,h=t.scene,w=t.camera,P=this.getSize(),y=P.width,S=P.height,M=new _({isdev:o,width:y,height:S,cameraParams:w});this.gui&&M.setGui(this.gui);var G=M.camera,B=new N({camera:G,sceneParams:h}),W=B.scene,se=new p({width:y,height:S,scene:W,camera:G,isdev:o,rendererParams:E((0,z.Z)({},a),{outputEncoding:l.LinearEncoding,antialias:!1})});this.gui&&se.setGui(this.gui);var V=se.renderer;u&&B.addAxesHelper(),this.sceneController=B,this.rendererController=se,this.cameraController=M,r.appendChild(V.domElement);var re=new ResizeObserver(function(ue){var le=!0,ye=!1,De=void 0;try{for(var xe=ue[Symbol.iterator](),ze;!(le=(ze=xe.next()).done);le=!0){var mt=ze.value,Ge=mt.contentRect;e.handeleResize(Ge.width,Ge.height)}}catch(gt){ye=!0,De=gt}finally{try{!le&&xe.return!=null&&xe.return()}finally{if(ye)throw De}}});re.observe(r),this.resizeObserver=re},i.initComposer=function(){var e=this.options,t=e.bloom,r=e.outline,o=e.ssr,u=e.renderer,a=e.bloomParams,h=e.outlineParams,w=e.ssrParams,P=e.multisampling,y=u.antialias;y==="msaa"&&!Re&&(y=!1,console.warn("MSAA is not supported on this browser"));var S=new ct({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:y==="msaa"?P:0,type:l.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=S,y==="ssaa"&&S.addSSAAPass(),o&&S.addSSRPass(w),t&&S.addBloomPass(a),r&&S.addOutlinePass(h),u.outputEncoding===l.sRGBEncoding&&S.addGammaCorrectionPass(),y==="fxaa"?S.addFXAAPass():y==="smaa"&&S.addSMAAPass(),S.checkCopyPass(),this.event.on("passcheck",function(){S.checkCopyPass()})},i.initCSSRenderer=function(){var e=this.options,t=e.container,r=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,a=e.css3DRendererParams;if(r||o){var h=new ee(t);r&&h.addRenderer("css2d",u),o&&h.addRenderer("css3d",a),this.cssRendererController=h}},i.initControl=function(){var e=this.options,t=e.control,r=e.mapControl,o=e.controlParams;if(t){var u=new he({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:r});this.controlController=u}},i.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},i.handeleResize=function(e,t){var r=this,o=r.rendererController,u=r.cameraController,a=r.composerController,h=r.cssRendererController;u==null||u.setSize(e,t),o==null||o.setSize(e,t),a==null||a.setSize(e,t),h==null||h.setSize(e,t),this.installPlugins.forEach(function(w,P){var y;(y=P.resize)===null||y===void 0||y.call(P,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},i.pick=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,a=o.options,h=a.container,w=new l.Vector2,P=h.getBoundingClientRect();if(w.x=(e.clientX-P.left)/(P.right-P.left)*2-1,w.y=-((e.clientY-P.top)/(P.bottom-P.top))*2+1,this.camera&&this.scene){u.setFromCamera(w,this.camera);var y=u.intersectObjects(t||this.scene.children,r);if(y.length)return{object:y[0].object,intersects:y}}},i.render=function(){var e,t,r,o,u=this,a=u.renderer,h=u.scene,w=u.camera,P=u.clock;if(!(!a||!h||!w||this.options.staticRender&&!this.cameraController.checkCameraChange())){var y=P.getDelta(),S=P.getElapsedTime();if(a.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(G,B){var W;(W=B.update)===null||W===void 0||W.call(B,y,S)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var M;(M=this.rendererController)===null||M===void 0||M.render()}(r=this.cssRendererController)===null||r===void 0||r.render(h,w),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:y,elapsed:S})}},i.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},i.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},i.dispose=function(){var e,t,r,o,u,a,h;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(w,P){var y;(y=P.dispose)===null||y===void 0||y.call(P)}),(t=this.controlController)===null||t===void 0||t.dispose(),(r=this.cssRendererController)===null||r===void 0||r.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(u=this.composerController)===null||u===void 0||u.dispose(),(a=this.rendererController)===null||a===void 0||a.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(h=this.gui)===null||h===void 0||h.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},C(s,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),s}();Ce.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,renderer:E((0,z.Z)({},d),{antialias:Re?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:j,camera:b,bloom:!1,bloomParams:Ye,outline:!1,outlineParams:tt,css2DRenderer:!1,ssr:!1,ssrParams:ot,css2DRendererParams:(0,z.Z)({},Z),css3DRenderer:!1,css3DRendererParams:(0,z.Z)({},Z)};function ft(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(s){return!1}}function be(s,i,n){return ft()?be=Reflect.construct:be=function(t,r,o){var u=[null];u.push.apply(u,r);var a=Function.bind.apply(t,u),h=new a;return o&&Me(h,o.prototype),h},be.apply(null,arguments)}function Le(s,i,n){return be.apply(null,arguments)}var dt=K(620);function ht(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(e,t){n.resolve=e,n.reject=t}),s&&(n.promise=(0,dt.Z)(n.promise,i)),n}var vt=require("three/examples/jsm/renderers/CSS2DRenderer"),Ae=function(s){s&&((0,L.disposeMesh)(s),s.children.forEach(function(i){i.userData.BaseObject_||Ae(i)}))},pt=function(){"use strict";function s(){R(this,s),this.objecttype__="BaseObject",this.userData={},this.pm=ht(),this.visible=!1}var i=s.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(e,t){},i.resize=function(e,t){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(l.Mesh,X(t)),this},i.createGroup=function(){return this.object3d=new l.Group,this},i.createPoints=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(l.Points,X(t)),this},i.createCSS2DObject=function(e){return this.object3d=new vt.CSS2DObject(e),this},i.createCSS3DObject=function(e){return this.object3d=new ve.CSS3DObject(e),this},i.createCSS3DSprite=function(e){return this.object3d=new ve.CSS3DSprite(e),this},i.createSprite=function(e){return this.object3d=new l.Sprite(e),this},i.add=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).add.apply(o,X(t)),this},i.remove=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).remove.apply(o,X(t)),this},i.getSize=function(){var e=new l.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new l.Vector3)}},i.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},i.dispose=function(){Ae(this.object3d)},C(s,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),s}()})(),module.exports=Pe})();
|
|
57
|
+
}`})},n}(Me.Pass);Se.BlurDirectionX=new l.Vector2(1,0),Se.BlurDirectionY=new l.Vector2(0,1);var Ye={threshold:.2,strength:.5,radius:0},Ke=new l.MeshBasicMaterial({color:"black"}),$e=new l.SpriteMaterial({color:"#000"}),Je=function(){"use strict";function s(n,e){j(this,s),this.materials={},this.bloomLayer=new l.Layers,this.active=!0,this.composerController=n,this.options=e;var t=n.renderer,r=n.renderPass,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,C=new Se(new l.Vector2(a,h),e.strength,e.radius,e.threshold);this.bloomPass=C;var _=new ie.EffectComposer(t);_.renderToScreen=!1,_.addPass(r),_.addPass(this.bloomPass),this.bloomComposer=_,this.bloomLayer.set(ke);var y=new l.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:_.renderTarget2.texture}},vertexShader:Ie,fragmentShader:He,defines:{}}),w=new te.ShaderPass(y,"baseTexture");w.needsSwap=!0,this.finalPass=w,o.addPass(w)}var i=s.prototype;return i.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},i.render=function(e){if(!!this.active){var t=this,r=t.bloomComposer,o=t.bloomLayer,u=t.materials;e.traverse(function(a){var h=a;h.material&&o.test(h.layers)===!1&&(u[h.uuid]=h.material,h.material=h.isSprite?$e:Ke)}),r.render(),e.traverse(function(a){var h=a;u[h.uuid]&&(h.material=u[h.uuid],delete u[h.uuid])})}},i.setSize=function(e,t){this.bloomComposer.setSize(e,t)},i.setGui=function(e){var t=this,r=new R({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return t.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return t.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return t.bloomPass}}}});r.showGui(e)},i.dispose=function(){this.bloomPass.dispose(),this.materials={}},s}(),et=require("three/examples/jsm/postprocessing/OutlinePass"),tt={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},rt=function(){"use strict";function s(n,e){j(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,C=new et.OutlinePass(new l.Vector2(a,h),t,r);C.selectedObjects=this.selectedObjects,this.outlinePass=C,o.addPass(C),this.setGui()}var i=s.prototype;return i.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},i.setGui=function(){var e=this,t=new R({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});t.setTargetValueByParams(),this.outlineGui=t},i.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},s}();function nt(s,i){if(s==null)return{};var n={},e=Object.keys(s),t,r;for(r=0;r<e.length;r++)t=e[r],!(i.indexOf(t)>=0)&&(n[t]=s[t]);return n}function it(s,i){if(s==null)return{};var n=nt(s,i),e,t;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);for(t=0;t<r.length;t++)e=r[t],!(i.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(s,e)||(n[e]=s[e]))}return n}var at=require("three/examples/jsm/postprocessing/SSRPass"),st=require("three/examples/jsm/objects/ReflectorForSSRPass"),ot={maxDistance:10,selects:!0},ut={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},lt=function(){"use strict";function s(n,e){j(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.renderer,u=n.finalComposer,a=n.getSize(),h=a.width,C=a.height,_=new at.SSRPass({renderer:o,scene:t,camera:r,width:h,height:C,groundReflector:null,selects:this.selectedObjects});this.ssrPass=_,u.addPass(_),this.setGui()}var i=s.prototype;return i.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,G.Z)({},ut,e),r=t.width,o=t.height,u=it(t,["width","height"]),a=this.composerController,h=a.scene,C=a.getSize(),_=new l.PlaneGeometry(r,o),y=new st.ReflectorForSSRPass(_,E((0,G.Z)({},u),{textureWidth:C.width,textureHeight:C.height}));y.material.depthWrite=!1,y.rotation.x=-Math.PI/2,y.visible=!1,h.add(y),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=y},i.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},i.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},i.setSize=function(e,t){var r=this.groundReflector;r&&(r.getRenderTarget().setSize(e,t),r.resolution.set(e,t))},i.setGui=function(){var e=this,t=new R({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(r){r?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});t.setTargetValueByParams(),this.ssrGui=t},i.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},s}(),ct=function(){"use strict";function s(n){j(this,s),this.active=!0,this.options=n;var e=n.renderer,t=n.scene,r=n.camera,o=this.createRenderTarget(),u=new ie.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=r}var i=s.prototype;return i.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,r=e.type,o=e.encoding,u=this.getSize(),a={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat,encoding:o,type:r},h;if(+l.REVISION<138&&t>0){var C=new l.WebGLMultisampleRenderTarget(u.width,u.height,a);C.samples=t,h=C}else if(+l.REVISION>=138&&t>0){var _=new l.WebGLRenderTarget(u.width,u.height,E((0,G.Z)({},a),{samples:t}));h=_}else{var y=new l.WebGLRenderTarget(u.width,u.height,a);h=y}return h.texture.name="EffectComposer.rt1",h},i.addRenderPasss=function(){var e=this.options,t=e.scene,r=e.camera,o=new oe.RenderPass(t,r);this.finalComposer.addPass(o),this.renderPass=o},i.addCopyPass=function(){var e=new te.ShaderPass(pe.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},i.addGammaCorrectionPass=function(){var e=new te.ShaderPass(me.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},i.addFXAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=new te.ShaderPass(Fe.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,r)},i.addSMAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=this.options.renderer,u=new he.SMAAPass(t*o.getPixelRatio(),r*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},i.addSSAAPass=function(){var e=this.options,t=e.scene,r=e.camera,o=new Ve.SSAARenderPass(t,r,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},i.addBloomPass=function(e){var t=new Je(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},i.addOutlinePass=function(e){var t=new rt(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},i.addSSRPass=function(e){var t=new lt(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},i.getSize=function(){var e=this.options.renderer;return e.getSize(new l.Vector2)},i.enable=function(){this.active||(this.active=!0)},i.disable=function(){!this.active||(this.active=!1)},i.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(r){return r!==e.renderPass&&r!==e.copyPass?r.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},i.setSize=function(e,t){var r,o;this.finalComposer.setSize(e,t),(r=this.bloomController)===null||r===void 0||r.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},i.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var r=this.options.renderer,o=r.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*o)}},i.render=function(){var e;if(!!this.active){var t=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(t),this.finalComposer.render()}},i.dispose=function(){var e,t,r;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(r=this.ssrController)===null||r===void 0||r.dispose(),this.finalComposer.passes.forEach(function(o){var u,a,h;(u=o.fsQuad)===null||u===void 0||u.dispose(),(a=o.fsQuad)===null||a===void 0||(h=a.material)===null||h===void 0||h.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},s}(),xe=function(){"use strict";function s(n){j(this,s),this.raycaster=new l.Raycaster,this.installPlugins=new Map,this.event=new N.EventEmitter,this.clock=new l.Clock,this.options=ae()(s.options,n,{isMergeableObject:L.isPlainObject});var e=this.options,t=e.container,r=e.stats,o=e.gui;if(o){var u=new(Y());u.open(!1),this.gui=u}if(r){var a=new(X());a.showPanel(0),a.dom.style.position="absolute",t.appendChild(a.dom),this.stats=a}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var i=s.prototype;return i.use=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var u;(u=e).install.apply(u,[this].concat(k(r))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this,t=this.options,r=t.container,o=t.isdev,u=t.axesHelper,a=t.renderer,h=t.scene,C=t.camera,_=this.getSize(),y=_.width,w=_.height,z=new P({isdev:o,width:y,height:w,cameraParams:C});this.gui&&z.setGui(this.gui);var V=z.camera,F=new J({camera:V,sceneParams:h}),Z=F.scene,le=new v({width:y,height:w,scene:Z,camera:V,isdev:o,rendererParams:E((0,G.Z)({},a),{outputEncoding:l.LinearEncoding,antialias:!1})});this.gui&&le.setGui(this.gui);var I=le.renderer;u&&F.addAxesHelper(),this.sceneController=F,this.rendererController=le,this.cameraController=z,r.appendChild(I.domElement);var ue=new ResizeObserver(function(ce){var fe=!0,ye=!1,ze=void 0;try{for(var Ce=ce[Symbol.iterator](),De;!(fe=(De=Ce.next()).done);fe=!0){var mt=De.value,Ge=mt.contentRect;e.handeleResize(Ge.width,Ge.height)}}catch(gt){ye=!0,ze=gt}finally{try{!fe&&Ce.return!=null&&Ce.return()}finally{if(ye)throw ze}}});ue.observe(r),this.resizeObserver=ue},i.initComposer=function(){var e=this.options,t=e.bloom,r=e.outline,o=e.ssr,u=e.renderer,a=e.bloomParams,h=e.outlineParams,C=e.ssrParams,_=e.multisampling,y=u.antialias;y==="msaa"&&!Re&&(y=!1,console.warn("MSAA is not supported on this browser"));var w=new ct({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:y==="msaa"?_:0,type:l.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=w,y==="ssaa"&&w.addSSAAPass(),o&&w.addSSRPass(C),t&&w.addBloomPass(a),r&&w.addOutlinePass(h),u.outputEncoding===l.sRGBEncoding&&w.addGammaCorrectionPass(),y==="fxaa"?w.addFXAAPass():y==="smaa"&&w.addSMAAPass(),w.checkCopyPass(),this.event.on("passcheck",function(){w.checkCopyPass()})},i.initCSSRenderer=function(){var e=this.options,t=e.container,r=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,a=e.css3DRendererParams;if(r||o){var h=new se(t);r&&h.addRenderer("css2d",u),o&&h.addRenderer("css3d",a),this.cssRendererController=h}},i.initControl=function(){var e=this.options,t=e.control,r=e.mapControl,o=e.controlParams;if(t){var u=new q({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:r});this.controlController=u}},i.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},i.handeleResize=function(e,t){var r=this,o=r.rendererController,u=r.cameraController,a=r.composerController,h=r.cssRendererController;u==null||u.setSize(e,t),o==null||o.setSize(e,t),a==null||a.setSize(e,t),h==null||h.setSize(e,t),this.installPlugins.forEach(function(C,_){var y;(y=_.resize)===null||y===void 0||y.call(_,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},i.pick=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,a=o.options,h=a.container,C=new l.Vector2,_=h.getBoundingClientRect();if(C.x=(e.clientX-_.left)/(_.right-_.left)*2-1,C.y=-((e.clientY-_.top)/(_.bottom-_.top))*2+1,this.camera&&this.scene){u.setFromCamera(C,this.camera);var y=u.intersectObjects(t||this.scene.children,r);if(y.length)return{object:y[0].object,intersects:y}}},i.render=function(){var e,t,r,o,u=this,a=u.renderer,h=u.scene,C=u.camera,_=u.clock;if(!(!a||!h||!C||this.options.staticRender&&!this.cameraController.checkCameraChange())){var y=_.getDelta(),w=_.getElapsedTime();if(a.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(V,F){var Z;(Z=F.update)===null||Z===void 0||Z.call(F,y,w)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var z;(z=this.rendererController)===null||z===void 0||z.render()}(r=this.cssRendererController)===null||r===void 0||r.render(h,C),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:y,elapsed:w})}},i.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},i.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},i.dispose=function(){var e,t,r,o,u,a,h;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(C,_){var y;(y=_.dispose)===null||y===void 0||y.call(_)}),(t=this.controlController)===null||t===void 0||t.dispose(),(r=this.cssRendererController)===null||r===void 0||r.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(u=this.composerController)===null||u===void 0||u.dispose(),(a=this.rendererController)===null||a===void 0||a.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(h=this.gui)===null||h===void 0||h.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},S(s,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),s}();xe.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,renderer:E((0,G.Z)({},c),{antialias:Re?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:T,camera:m,bloom:!1,bloomParams:Ye,outline:!1,outlineParams:tt,css2DRenderer:!1,ssr:!1,ssrParams:ot,css2DRendererParams:(0,G.Z)({},$),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},$)};function ft(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(s){return!1}}function be(s,i,n){return ft()?be=Reflect.construct:be=function(t,r,o){var u=[null];u.push.apply(u,r);var a=Function.bind.apply(t,u),h=new a;return o&&Te(h,o.prototype),h},be.apply(null,arguments)}function Le(s,i,n){return be.apply(null,arguments)}var dt=re(620);function ht(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(e,t){n.resolve=e,n.reject=t}),s&&(n.promise=(0,dt.Z)(n.promise,i)),n}var vt=require("three/examples/jsm/renderers/CSS2DRenderer"),Ae=function(s){s&&((0,L.disposeMesh)(s),s.children.forEach(function(i){i.userData.BaseObject_||Ae(i)}))},pt=function(){"use strict";function s(){j(this,s),this.objecttype__="BaseObject",this.userData={},this.pm=ht(),this.visible=!1}var i=s.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(e,t){},i.resize=function(e,t){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(l.Mesh,k(t)),this},i.createGroup=function(){return this.object3d=new l.Group,this},i.createPoints=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(l.Points,k(t)),this},i.createCSS2DObject=function(e){return this.object3d=new vt.CSS2DObject(e),this},i.createCSS3DObject=function(e){return this.object3d=new ve.CSS3DObject(e),this},i.createCSS3DSprite=function(e){return this.object3d=new ve.CSS3DSprite(e),this},i.createSprite=function(e){return this.object3d=new l.Sprite(e),this},i.add=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).add.apply(o,k(t)),this},i.remove=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).remove.apply(o,k(t)),this},i.getSize=function(){var e=new l.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new l.Vector3)}},i.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},i.dispose=function(){Ae(this.object3d)},S(s,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),s}()})(),module.exports=Pe})();
|