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