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