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