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