gl-draw 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/objects/index.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -54,4 +54,4 @@ void main() {
|
|
|
54
54
|
lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
|
|
55
55
|
lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
|
|
56
56
|
lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
|
|
57
|
-
}`})},n}(Le.Pass);Se.BlurDirectionX=new v.Vector2(1,0),Se.BlurDirectionY=new v.Vector2(0,1);var Xe={threshold:.2,strength:.5,radius:0},qe=new v.MeshBasicMaterial({color:"black"}),Qe=new v.SpriteMaterial({color:"#000"}),Ye=function(){"use strict";function o(n,e){O(this,o),this.materials={},this.bloomLayer=new v.Layers,this.active=!0,this.composerController=n,this.options=e;var r=n.renderer,t=n.renderPass,a=n.finalComposer,u=n.getSize(),i=u.width,d=u.height,y=new Se(new v.Vector2(i,d),e.strength,e.radius,e.threshold);this.bloomPass=y;var _=new S.EffectComposer(r);_.renderToScreen=!1,_.addPass(t),_.addPass(this.bloomPass),this.bloomComposer=_,this.bloomLayer.set(ke);var P=new v.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:_.renderTarget2.texture}},vertexShader:Ve,fragmentShader:Ie,defines:{}}),R=new Q.ShaderPass(P,"baseTexture");R.needsSwap=!0,this.finalPass=R,a.addPass(R)}var s=o.prototype;return s.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},s.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},s.render=function(e){if(!!this.active){var r=this,t=r.bloomComposer,a=r.bloomLayer,u=r.materials;e.traverse(function(i){var d=i;d.material&&a.test(d.layers)===!1&&(u[d.uuid]=d.material,d.material=d.isSprite?Qe:qe)}),t.render(),e.traverse(function(i){var d=i;u[d.uuid]&&(d.material=u[d.uuid],delete u[d.uuid])})}},s.setSize=function(e,r){this.bloomComposer.setSize(e,r)},s.setGui=function(e){var r=this,t=new l;t.guiParams={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.showGuiParams(e)},s.dispose=function(){this.bloomPass.dispose(),this.materials={}},o}(),Ke=require("three/examples/jsm/postprocessing/OutlinePass"),$e={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},Je=function(){"use strict";function o(n,e){O(this,o),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var r=n.scene,t=n.camera,a=n.finalComposer,u=n.getSize(),i=u.width,d=u.height,y=new Ke.OutlinePass(new v.Vector2(i,d),r,t);y.selectedObjects=this.selectedObjects,this.outlinePass=y,a.addPass(y),this.setGui()}var s=o.prototype;return s.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},s.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},s.setGui=function(){var e=this,r=new l;r.guiParams={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.setGuiTargetValueByParams(),this.outlineGui=r},s.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},o}();function et(o,s){if(o==null)return{};var n={},e=Object.keys(o),r,t;for(t=0;t<e.length;t++)r=e[t],!(s.indexOf(r)>=0)&&(n[r]=o[r]);return n}function tt(o,s){if(o==null)return{};var n=et(o,s),e,r;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);for(r=0;r<t.length;r++)e=t[r],!(s.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(o,e)||(n[e]=o[e]))}return n}var rt=require("three/examples/jsm/postprocessing/SSRPass"),nt=require("three/examples/jsm/objects/ReflectorForSSRPass"),it={maxDistance:10,selects:!0},at={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},st=function(){"use strict";function o(n,e){O(this,o),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var r=n.scene,t=n.camera,a=n.renderer,u=n.finalComposer,i=n.getSize(),d=i.width,y=i.height,_=new rt.SSRPass({renderer:a,scene:r,camera:t,width:d,height:y,groundReflector:null,selects:this.selectedObjects});this.ssrPass=_,u.addPass(_),this.setGui()}var s=o.prototype;return s.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(0,G.Z)({},at,e),t=r.width,a=r.height,u=tt(r,["width","height"]),i=this.composerController,d=i.scene,y=i.getSize(),_=new v.PlaneGeometry(t,a),P=new nt.ReflectorForSSRPass(_,M((0,G.Z)({},u),{textureWidth:y.width,textureHeight:y.height}));P.material.depthWrite=!1,P.rotation.x=-Math.PI/2,P.visible=!1,d.add(P),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=P},s.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},s.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},s.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},s.setSize=function(e,r){var t=this.groundReflector;t&&(t.getRenderTarget().setSize(e,r),t.resolution.set(e,r))},s.setGui=function(){var e=this,r=new l;r.guiParams={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(t){t?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.setGuiTargetValueByParams(),this.ssrGui=r},s.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},o}(),ot=function(){"use strict";function o(n){O(this,o),this.active=!0,this.options=n;var e=n.renderer,r=n.scene,t=n.camera,a=this.createRenderTarget(),u=new S.EffectComposer(e,a);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=r,this.renderTarget=a,this.camera=t}var s=o.prototype;return s.createRenderTarget=function(){var e=this.options.composerParams,r=e.multisampling,t=e.type,a=e.encoding,u=this.getSize(),i={minFilter:v.LinearFilter,magFilter:v.LinearFilter,format:v.RGBAFormat,encoding:a,type:t},d;if(+v.REVISION<138&&r>0){var y=new v.WebGLMultisampleRenderTarget(u.width,u.height,i);y.samples=r,d=y}else if(+v.REVISION>=138&&r>0){var _=new v.WebGLRenderTarget(u.width,u.height,M((0,G.Z)({},i),{samples:r}));d=_}else{var P=new v.WebGLRenderTarget(u.width,u.height,i);d=P}return d.texture.name="EffectComposer.rt1",d},s.addRenderPasss=function(){var e=this.options,r=e.scene,t=e.camera,a=new H.RenderPass(r,t);this.finalComposer.addPass(a),this.renderPass=a},s.addCopyPass=function(){var e=new Q.ShaderPass(K.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},s.addGammaCorrectionPass=function(){var e=new Q.ShaderPass(re.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},s.addFXAAPass=function(){var e=this.getSize(),r=e.width,t=e.height,a=new Q.ShaderPass(de.FXAAShader);this.finalComposer.addPass(a),this.fxaaPass=a,this.setFXAAPassSize(r,t)},s.addSMAAPass=function(){var e=this.getSize(),r=e.width,t=e.height,a=this.options.renderer,u=new J.SMAAPass(r*a.getPixelRatio(),t*a.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},s.addSSAAPass=function(){var e=this.options,r=e.scene,t=e.camera,a=new ve.SSAARenderPass(r,t,0,0);a.unbiased=!0,a.sampleLevel=1,this.finalComposer.addPass(a),this.ssaaPass=a},s.addBloomPass=function(e){var r=new Ye(this,e);r.disable(),this.options.gui&&r.setGui(this.options.gui),this.bloomController=r},s.addOutlinePass=function(e){var r=new Je(this,e);r.disable(),this.options.gui&&r.outlineGui.showGuiParams(this.options.gui),this.outlineController=r},s.addSSRPass=function(e){var r=new st(this,e);r.disable(),this.options.gui&&r.ssrGui.showGuiParams(this.options.gui),this.ssrController=r},s.getSize=function(){var e=this.options.renderer;return e.getSize(new v.Vector2)},s.enable=function(){this.active||(this.active=!0)},s.disable=function(){!this.active||(this.active=!1)},s.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()},s.setSize=function(e,r){var t,a;this.finalComposer.setSize(e,r),(t=this.bloomController)===null||t===void 0||t.setSize(e,r),(a=this.ssrController)===null||a===void 0||a.setSize(e,r),this.setFXAAPassSize(e,r)},s.setFXAAPassSize=function(e,r){if(!!this.fxaaPass){var t=this.options.renderer,a=t.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*a),this.fxaaPass.material.uniforms.resolution.value.y=1/(r*a)}},s.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()}},s.dispose=function(){var e,r,t,a,u;(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(),(a=this.finalComposer)===null||a===void 0||a.passes.forEach(function(i){var d,y,_;(d=i.fsQuad)===null||d===void 0||d.dispose(),(y=i.fsQuad)===null||y===void 0||(_=y.material)===null||_===void 0||_.dispose()}),(u=this.renderTarget)===null||u===void 0||u.dispose(),this.renderer=void 0,this.scene=void 0,this.camera=void 0,this.finalComposer=void 0,this.renderTarget=void 0,this.renderPass=void 0,this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},o}(),Ce=function(){"use strict";function o(n){O(this,o),this.raycaster=new v.Raycaster,this.installPlugins=new Map,this.event=new ie.EventEmitter,this.clock=new v.Clock,this.options=F()(o.options,n,{isMergeableObject:z.isPlainObject});var e=this.options,r=e.container,t=e.stats,a=e.gui;if(a){var u=new(f());u.open(!1),this.gui=u}if(t){var i=new(L());i.showPanel(0),i.dom.style.position="absolute",r.appendChild(i.dom),this.stats=i}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var s=o.prototype;return s.use=function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var u;(u=e).install.apply(u,[this].concat(I(t))),this.installPlugins.set(e,!0)}},s.init=function(){var e=this,r=this.options,t=r.container,a=r.isdev,u=r.axesHelper,i=r.renderer,d=r.scene,y=r.camera,_=this.getSize(),P=_.width,R=_.height,Z=new j({isdev:a,width:P,height:R,cameraParams:y});this.gui&&Z.setGui(this.gui);var X=Z.camera,ee=new le({camera:X,sceneParams:d}),te=ee.scene,se=new w({width:P,height:R,scene:te,camera:X,isdev:a,rendererParams:M((0,G.Z)({},i),{outputEncoding:v.LinearEncoding,antialias:!1})});this.gui&&se.setGui(this.gui);var ue=se.renderer;u&&ee.addAxesHelper(),this.sceneController=ee,this.rendererController=se,this.cameraController=Z,t.appendChild(ue.domElement);var Y=new ResizeObserver(function(pe){var fe=!0,he=!1,ze=void 0;try{for(var xe=pe[Symbol.iterator](),Be;!(fe=(Be=xe.next()).done);fe=!0){var dt=Be.value,Fe=dt.contentRect;e.handeleResize(Fe.width,Fe.height)}}catch(ht){he=!0,ze=ht}finally{try{!fe&&xe.return!=null&&xe.return()}finally{if(he)throw ze}}});Y.observe(t),this.resizeObserver=Y},s.initComposer=function(){var e=this.options,r=e.bloom,t=e.outline,a=e.ssr,u=e.renderer,i=e.bloomParams,d=e.outlineParams,y=e.ssrParams,_=e.multisampling,P=u.antialias;P==="msaa"&&!Re&&(P=!1,console.warn("MSAA is not supported on this browser"));var R=new ot({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:P==="msaa"?_:0,type:v.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=R,P==="ssaa"&&R.addSSAAPass(),a&&R.addSSRPass(y),r&&R.addBloomPass(i),t&&R.addOutlinePass(d),u.outputEncoding===v.sRGBEncoding&&R.addGammaCorrectionPass(),P==="fxaa"?R.addFXAAPass():P==="smaa"&&R.addSMAAPass(),R.checkCopyPass(),this.event.on("passcheck",function(){R.checkCopyPass()})},s.initCSSRenderer=function(){var e=this.options,r=e.container,t=e.css2DRenderer,a=e.css3DRenderer,u=e.css2DRendererParams,i=e.css3DRendererParams;if(t||a){var d=new x(r);t&&d.addRenderer("css2d",u),a&&d.addRenderer("css3d",i),this.cssRendererController=d}},s.initControl=function(){var e=this.options,r=e.control,t=e.mapControl,a=e.controlParams;if(r){var u=new ge({camera:this.camera,controlParams:{domElement:(a==null?void 0:a.domElement)||this.renderer.domElement},mapControl:t});this.controlController=u}},s.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},s.handeleResize=function(e,r){var t=this,a=t.rendererController,u=t.cameraController,i=t.composerController,d=t.cssRendererController;u==null||u.setSize(e,r),a==null||a.setSize(e,r),i==null||i.setSize(e,r),d==null||d.setSize(e,r),this.installPlugins.forEach(function(y,_){var P;(P=_.resize)===null||P===void 0||P.call(_,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},s.pick=function(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=this,u=a.raycaster,i=a.options,d=i.container,y=new v.Vector2,_=d.getBoundingClientRect();if(y.x=(e.clientX-_.left)/(_.right-_.left)*2-1,y.y=-((e.clientY-_.top)/(_.bottom-_.top))*2+1,this.camera&&this.scene){u.setFromCamera(y,this.camera);var P=u.intersectObjects(r||this.scene.children,t);if(P.length)return{object:P[0].object,intersects:P}}},s.render=function(){var e,r,t,a,u=this,i=u.renderer,d=u.scene,y=u.camera,_=u.clock;if(!(!i||!d||!y||this.options.staticRender&&!this.cameraController.checkCameraChange())){var P=_.getDelta(),R=_.getElapsedTime();if(i.clear(),N().update(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(X,ee){var te;(te=ee.update)===null||te===void 0||te.call(ee,P,R)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var Z;(Z=this.rendererController)===null||Z===void 0||Z.render()}(t=this.cssRendererController)===null||t===void 0||t.render(d,y),(a=this.stats)===null||a===void 0||a.update(),this.event.emit("render",{delta:P,elapsed:R})}},s.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},s.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},s.dispose=function(){var e,r,t,a,u,i,d,y;this.stop(),N().removeAll(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.resizeObserver=void 0,this.installPlugins.forEach(function(_,P){var R;(R=P.dispose)===null||R===void 0||R.call(P)}),(r=this.controlController)===null||r===void 0||r.dispose(),(t=this.cssRendererController)===null||t===void 0||t.dispose(),(a=this.cameraController)===null||a===void 0||a.dispose(),(u=this.sceneController)===null||u===void 0||u.dispose(),(i=this.composerController)===null||i===void 0||i.dispose(),(d=this.rendererController)===null||d===void 0||d.dispose(),this.controlController=void 0,this.cssRendererController=void 0,this.cameraController=void 0,this.sceneController=void 0,this.composerController=void 0,this.rendererController=void 0,(y=this.gui)===null||y===void 0||y.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},C(o,[{key:"renderer",get:function(){var e;return(e=this.rendererController)===null||e===void 0?void 0:e.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){var e;return(e=this.cameraController)===null||e===void 0?void 0:e.camera}},{key:"scene",get:function(){var e;return(e=this.sceneController)===null||e===void 0?void 0:e.scene}}]),o}();Ce.options={isdev:be,stats:be,gui:be,axesHelper:be,control:!1,renderer:M((0,G.Z)({},b),{antialias:Re?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:ae,camera:E,bloom:!1,bloomParams:Xe,outline:!1,outlineParams:$e,css2DRenderer:!1,ssr:!1,ssrParams:it,css2DRendererParams:(0,G.Z)({},g),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},g),staticPath:"/"};function ut(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(o){return!1}}function Pe(o,s,n){return ut()?Pe=Reflect.construct:Pe=function(r,t,a){var u=[null];u.push.apply(u,t);var i=Function.bind.apply(r,u),d=new i;return a&&Te(d,a.prototype),d},Pe.apply(null,arguments)}function Ge(o,s,n){return Pe.apply(null,arguments)}var lt=q(484);function ct(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(e,r){n.resolve=e,n.reject=r}),o&&(n.promise=(0,lt.Z)(n.promise,s)),n}var De=function(o){console.log(o),o&&((0,z.disposeMesh)(o),o.children.forEach(function(s){s.userData.BaseObject_||De(s)}))},ft=function(o){"use strict";je(n,o);var s=Ee(n);function n(r){O(this,n);var t;return t=s.call(this),t.objecttype__="BaseObject",t.userData={},t.pm=ct(),t.visible=!1,t}var e=n.prototype;return e.init=function(){},e.create=function(){},e.render=function(){},e.update=function(t,a){},e.resize=function(t,a){},e.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},e.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},e.isVisible=function(){return this.visible},e.createMesh=function(){for(var t=arguments.length,a=new Array(t),u=0;u<t;u++)a[u]=arguments[u];return this.object3d=Ge(v.Mesh,I(a)),this},e.createGroup=function(){return this.object3d=new v.Group,this},e.createPoints=function(){for(var t=arguments.length,a=new Array(t),u=0;u<t;u++)a[u]=arguments[u];return this.object3d=Ge(v.Points,I(a)),this},e.createCSS2DObject=function(t){return this.object3d=new h.CSS2DObject(t),this},e.createCSS3DObject=function(t){return this.object3d=new c.CSS3DObject(t),this},e.createCSS3DSprite=function(t){return this.object3d=new c.CSS3DSprite(t),this},e.createSprite=function(t){return this.object3d=new v.Sprite(t),this},e.add=function(){for(var t=arguments.length,a=new Array(t),u=0;u<t;u++)a[u]=arguments[u];var i;return(i=this.object3d).add.apply(i,I(a)),this},e.remove=function(){for(var t=arguments.length,a=new Array(t),u=0;u<t;u++)a[u]=arguments[u];var i;return(i=this.object3d).remove.apply(i,I(a)),this},e.getSize=function(){var t=new v.Box3().setFromObject(this.object3d);return{min:t.min,max:t.max,size:t.getSize(new v.Vector3)}},e.traverse=function(t){t(this),this.children.forEach(function(a){a.traverse(t)})},e.dispose=function(){console.log(this),De(this.object3d)},C(n,[{key:"parent",get:function(){var t=this.object3d.parent;return(t==null?void 0:t.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(t){return t.userData.BaseObject_}).filter(function(t){return!!t})}}]),n}(l)})(),module.exports=ye})();
|
|
57
|
+
}`})},n}(Le.Pass);Se.BlurDirectionX=new v.Vector2(1,0),Se.BlurDirectionY=new v.Vector2(0,1);var Xe={threshold:.2,strength:.5,radius:0},qe=new v.MeshBasicMaterial({color:"black"}),Qe=new v.SpriteMaterial({color:"#000"}),Ye=function(){"use strict";function o(n,e){O(this,o),this.materials={},this.bloomLayer=new v.Layers,this.active=!0,this.composerController=n,this.options=e;var r=n.renderer,t=n.renderPass,a=n.finalComposer,u=n.getSize(),i=u.width,d=u.height,y=new Se(new v.Vector2(i,d),e.strength,e.radius,e.threshold);this.bloomPass=y;var _=new S.EffectComposer(r);_.renderToScreen=!1,_.addPass(t),_.addPass(this.bloomPass),this.bloomComposer=_,this.bloomLayer.set(ke);var P=new v.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:_.renderTarget2.texture}},vertexShader:Ve,fragmentShader:Ie,defines:{}}),R=new Q.ShaderPass(P,"baseTexture");R.needsSwap=!0,this.finalPass=R,a.addPass(R)}var s=o.prototype;return s.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},s.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},s.render=function(e){if(!!this.active){var r=this,t=r.bloomComposer,a=r.bloomLayer,u=r.materials;e.traverse(function(i){var d=i;d.material&&a.test(d.layers)===!1&&(u[d.uuid]=d.material,d.material=d.isSprite?Qe:qe)}),t.render(),e.traverse(function(i){var d=i;u[d.uuid]&&(d.material=u[d.uuid],delete u[d.uuid])})}},s.setSize=function(e,r){this.bloomComposer.setSize(e,r)},s.setGui=function(e){var r=this,t=new l;t.guiParams={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.showGuiParams(e)},s.dispose=function(){this.bloomPass.dispose(),this.materials={}},o}(),Ke=require("three/examples/jsm/postprocessing/OutlinePass"),$e={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},Je=function(){"use strict";function o(n,e){O(this,o),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var r=n.scene,t=n.camera,a=n.finalComposer,u=n.getSize(),i=u.width,d=u.height,y=new Ke.OutlinePass(new v.Vector2(i,d),r,t);y.selectedObjects=this.selectedObjects,this.outlinePass=y,a.addPass(y),this.setGui()}var s=o.prototype;return s.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},s.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},s.setGui=function(){var e=this,r=new l;r.guiParams={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.setGuiTargetValueByParams(),this.outlineGui=r},s.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},o}();function et(o,s){if(o==null)return{};var n={},e=Object.keys(o),r,t;for(t=0;t<e.length;t++)r=e[t],!(s.indexOf(r)>=0)&&(n[r]=o[r]);return n}function tt(o,s){if(o==null)return{};var n=et(o,s),e,r;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);for(r=0;r<t.length;r++)e=t[r],!(s.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(o,e)||(n[e]=o[e]))}return n}var rt=require("three/examples/jsm/postprocessing/SSRPass"),nt=require("three/examples/jsm/objects/ReflectorForSSRPass"),it={maxDistance:10,selects:!0},at={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},st=function(){"use strict";function o(n,e){O(this,o),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var r=n.scene,t=n.camera,a=n.renderer,u=n.finalComposer,i=n.getSize(),d=i.width,y=i.height,_=new rt.SSRPass({renderer:a,scene:r,camera:t,width:d,height:y,groundReflector:null,selects:this.selectedObjects});this.ssrPass=_,u.addPass(_),this.setGui()}var s=o.prototype;return s.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(0,G.Z)({},at,e),t=r.width,a=r.height,u=tt(r,["width","height"]),i=this.composerController,d=i.scene,y=i.getSize(),_=new v.PlaneGeometry(t,a),P=new nt.ReflectorForSSRPass(_,M((0,G.Z)({},u),{textureWidth:y.width,textureHeight:y.height}));P.material.depthWrite=!1,P.rotation.x=-Math.PI/2,P.visible=!1,d.add(P),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=P},s.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},s.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},s.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},s.setSize=function(e,r){var t=this.groundReflector;t&&(t.getRenderTarget().setSize(e,r),t.resolution.set(e,r))},s.setGui=function(){var e=this,r=new l;r.guiParams={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(t){t?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.setGuiTargetValueByParams(),this.ssrGui=r},s.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},o}(),ot=function(){"use strict";function o(n){O(this,o),this.active=!0,this.options=n;var e=n.renderer,r=n.scene,t=n.camera,a=this.createRenderTarget(),u=new S.EffectComposer(e,a);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=r,this.renderTarget=a,this.camera=t}var s=o.prototype;return s.createRenderTarget=function(){var e=this.options.composerParams,r=e.multisampling,t=e.type,a=e.encoding,u=this.getSize(),i={minFilter:v.LinearFilter,magFilter:v.LinearFilter,format:v.RGBAFormat,encoding:a,type:t},d;if(+v.REVISION<138&&r>0){var y=new v.WebGLMultisampleRenderTarget(u.width,u.height,i);y.samples=r,d=y}else if(+v.REVISION>=138&&r>0){var _=new v.WebGLRenderTarget(u.width,u.height,M((0,G.Z)({},i),{samples:r}));d=_}else{var P=new v.WebGLRenderTarget(u.width,u.height,i);d=P}return d.texture.name="EffectComposer.rt1",d},s.addRenderPasss=function(){var e=this.options,r=e.scene,t=e.camera,a=new H.RenderPass(r,t);this.finalComposer.addPass(a),this.renderPass=a},s.addCopyPass=function(){var e=new Q.ShaderPass(K.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},s.addGammaCorrectionPass=function(){var e=new Q.ShaderPass(re.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},s.addFXAAPass=function(){var e=this.getSize(),r=e.width,t=e.height,a=new Q.ShaderPass(de.FXAAShader);this.finalComposer.addPass(a),this.fxaaPass=a,this.setFXAAPassSize(r,t)},s.addSMAAPass=function(){var e=this.getSize(),r=e.width,t=e.height,a=this.options.renderer,u=new J.SMAAPass(r*a.getPixelRatio(),t*a.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},s.addSSAAPass=function(){var e=this.options,r=e.scene,t=e.camera,a=new ve.SSAARenderPass(r,t,0,0);a.unbiased=!0,a.sampleLevel=1,this.finalComposer.addPass(a),this.ssaaPass=a},s.addBloomPass=function(e){var r=new Ye(this,e);r.disable(),this.options.gui&&r.setGui(this.options.gui),this.bloomController=r},s.addOutlinePass=function(e){var r=new Je(this,e);r.disable(),this.options.gui&&r.outlineGui.showGuiParams(this.options.gui),this.outlineController=r},s.addSSRPass=function(e){var r=new st(this,e);r.disable(),this.options.gui&&r.ssrGui.showGuiParams(this.options.gui),this.ssrController=r},s.getSize=function(){var e=this.options.renderer;return e.getSize(new v.Vector2)},s.enable=function(){this.active||(this.active=!0)},s.disable=function(){!this.active||(this.active=!1)},s.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()},s.setSize=function(e,r){var t,a;this.finalComposer.setSize(e,r),(t=this.bloomController)===null||t===void 0||t.setSize(e,r),(a=this.ssrController)===null||a===void 0||a.setSize(e,r),this.setFXAAPassSize(e,r)},s.setFXAAPassSize=function(e,r){if(!!this.fxaaPass){var t=this.options.renderer,a=t.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*a),this.fxaaPass.material.uniforms.resolution.value.y=1/(r*a)}},s.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()}},s.dispose=function(){var e,r,t,a,u;(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(),(a=this.finalComposer)===null||a===void 0||a.passes.forEach(function(i){var d,y,_;(d=i.fsQuad)===null||d===void 0||d.dispose(),(y=i.fsQuad)===null||y===void 0||(_=y.material)===null||_===void 0||_.dispose()}),(u=this.renderTarget)===null||u===void 0||u.dispose(),this.renderer=void 0,this.scene=void 0,this.camera=void 0,this.finalComposer=void 0,this.renderTarget=void 0,this.renderPass=void 0,this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},o}(),Ce=function(){"use strict";function o(n){O(this,o),this.raycaster=new v.Raycaster,this.installPlugins=new Map,this.event=new ie.EventEmitter,this.clock=new v.Clock,this.options=F()(o.options,n,{isMergeableObject:z.isPlainObject});var e=this.options,r=e.container,t=e.stats,a=e.gui;if(a){var u=new(f());u.open(!1),this.gui=u}if(t){var i=new(L());i.showPanel(0),i.dom.style.position="absolute",r.appendChild(i.dom),this.stats=i}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var s=o.prototype;return s.use=function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var u;(u=e).install.apply(u,[this].concat(I(t))),this.installPlugins.set(e,!0)}},s.init=function(){var e=this,r=this.options,t=r.container,a=r.isdev,u=r.axesHelper,i=r.renderer,d=r.scene,y=r.camera,_=this.getSize(),P=_.width,R=_.height,Z=new j({isdev:a,width:P,height:R,cameraParams:y});this.gui&&Z.setGui(this.gui);var X=Z.camera,ee=new le({camera:X,sceneParams:d}),te=ee.scene,se=new w({width:P,height:R,scene:te,camera:X,isdev:a,rendererParams:M((0,G.Z)({},i),{outputEncoding:v.LinearEncoding,antialias:!1})});this.gui&&se.setGui(this.gui);var ue=se.renderer;u&&ee.addAxesHelper(),this.sceneController=ee,this.rendererController=se,this.cameraController=Z,t.appendChild(ue.domElement);var Y=new ResizeObserver(function(pe){var fe=!0,he=!1,ze=void 0;try{for(var xe=pe[Symbol.iterator](),Be;!(fe=(Be=xe.next()).done);fe=!0){var dt=Be.value,Fe=dt.contentRect;e.handeleResize(Fe.width,Fe.height)}}catch(ht){he=!0,ze=ht}finally{try{!fe&&xe.return!=null&&xe.return()}finally{if(he)throw ze}}});Y.observe(t),this.resizeObserver=Y},s.initComposer=function(){var e=this.options,r=e.bloom,t=e.outline,a=e.ssr,u=e.renderer,i=e.bloomParams,d=e.outlineParams,y=e.ssrParams,_=e.multisampling,P=u.antialias;P==="msaa"&&!Re&&(P=!1,console.warn("MSAA is not supported on this browser"));var R=new ot({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:P==="msaa"?_:0,type:v.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=R,P==="ssaa"&&R.addSSAAPass(),a&&R.addSSRPass(y),r&&R.addBloomPass(i),t&&R.addOutlinePass(d),u.outputEncoding===v.sRGBEncoding&&R.addGammaCorrectionPass(),P==="fxaa"?R.addFXAAPass():P==="smaa"&&R.addSMAAPass(),R.checkCopyPass(),this.event.on("passcheck",function(){R.checkCopyPass()})},s.initCSSRenderer=function(){var e=this.options,r=e.container,t=e.css2DRenderer,a=e.css3DRenderer,u=e.css2DRendererParams,i=e.css3DRendererParams;if(t||a){var d=new x(r);t&&d.addRenderer("css2d",u),a&&d.addRenderer("css3d",i),this.cssRendererController=d}},s.initControl=function(){var e=this.options,r=e.control,t=e.mapControl,a=e.controlParams;if(r){var u=new ge({camera:this.camera,controlParams:{domElement:(a==null?void 0:a.domElement)||this.renderer.domElement},mapControl:t});this.controlController=u}},s.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},s.handeleResize=function(e,r){var t=this,a=t.rendererController,u=t.cameraController,i=t.composerController,d=t.cssRendererController;u==null||u.setSize(e,r),a==null||a.setSize(e,r),i==null||i.setSize(e,r),d==null||d.setSize(e,r),this.installPlugins.forEach(function(y,_){var P;(P=_.resize)===null||P===void 0||P.call(_,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},s.pick=function(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=this,u=a.raycaster,i=a.options,d=i.container,y=new v.Vector2,_=d.getBoundingClientRect();if(y.x=(e.clientX-_.left)/(_.right-_.left)*2-1,y.y=-((e.clientY-_.top)/(_.bottom-_.top))*2+1,this.camera&&this.scene){u.setFromCamera(y,this.camera);var P=u.intersectObjects(r||this.scene.children,t);if(P.length)return{object:P[0].object,intersects:P}}},s.render=function(){var e,r,t,a,u=this,i=u.renderer,d=u.scene,y=u.camera,_=u.clock;if(!(!i||!d||!y||this.options.staticRender&&!this.cameraController.checkCameraChange())){var P=_.getDelta(),R=_.getElapsedTime();if(i.clear(),N().update(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(X,ee){var te;(te=ee.update)===null||te===void 0||te.call(ee,P,R)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var Z;(Z=this.rendererController)===null||Z===void 0||Z.render()}(t=this.cssRendererController)===null||t===void 0||t.render(d,y),(a=this.stats)===null||a===void 0||a.update(),this.event.emit("render",{delta:P,elapsed:R})}},s.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},s.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},s.dispose=function(){var e,r,t,a,u,i,d,y;this.stop(),N().removeAll(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.resizeObserver=void 0,this.installPlugins.forEach(function(_,P){var R;(R=P.dispose)===null||R===void 0||R.call(P)}),(r=this.controlController)===null||r===void 0||r.dispose(),(t=this.cssRendererController)===null||t===void 0||t.dispose(),(a=this.cameraController)===null||a===void 0||a.dispose(),(u=this.sceneController)===null||u===void 0||u.dispose(),(i=this.composerController)===null||i===void 0||i.dispose(),(d=this.rendererController)===null||d===void 0||d.dispose(),this.controlController=void 0,this.cssRendererController=void 0,this.cameraController=void 0,this.sceneController=void 0,this.composerController=void 0,this.rendererController=void 0,(y=this.gui)===null||y===void 0||y.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},C(o,[{key:"renderer",get:function(){var e;return(e=this.rendererController)===null||e===void 0?void 0:e.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){var e;return(e=this.cameraController)===null||e===void 0?void 0:e.camera}},{key:"scene",get:function(){var e;return(e=this.sceneController)===null||e===void 0?void 0:e.scene}}]),o}();Ce.options={isdev:be,stats:be,gui:be,axesHelper:be,control:!1,renderer:M((0,G.Z)({},b),{antialias:Re?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:ae,camera:E,bloom:!1,bloomParams:Xe,outline:!1,outlineParams:$e,css2DRenderer:!1,ssr:!1,ssrParams:it,css2DRendererParams:(0,G.Z)({},g),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},g),staticPath:"/"};function ut(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(o){return!1}}function Pe(o,s,n){return ut()?Pe=Reflect.construct:Pe=function(r,t,a){var u=[null];u.push.apply(u,t);var i=Function.bind.apply(r,u),d=new i;return a&&Te(d,a.prototype),d},Pe.apply(null,arguments)}function Ge(o,s,n){return Pe.apply(null,arguments)}var lt=q(484);function ct(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(e,r){n.resolve=e,n.reject=r}),o&&(n.promise=(0,lt.Z)(n.promise,s)),n}var De=function(o){o&&((0,z.disposeMesh)(o),o.children.forEach(function(s){s.userData.BaseObject_||De(s)}))},ft=function(o){"use strict";je(n,o);var s=Ee(n);function n(r){O(this,n);var t;return t=s.call(this),t.objecttype__="BaseObject",t.userData={},t.pm=ct(),t.visible=!1,t}var e=n.prototype;return e.init=function(){},e.create=function(){},e.render=function(){},e.update=function(t,a){},e.resize=function(t,a){},e.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},e.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},e.isVisible=function(){return this.visible},e.createMesh=function(){for(var t=arguments.length,a=new Array(t),u=0;u<t;u++)a[u]=arguments[u];return this.object3d=Ge(v.Mesh,I(a)),this},e.createGroup=function(){return this.object3d=new v.Group,this},e.createPoints=function(){for(var t=arguments.length,a=new Array(t),u=0;u<t;u++)a[u]=arguments[u];return this.object3d=Ge(v.Points,I(a)),this},e.createCSS2DObject=function(t){return this.object3d=new h.CSS2DObject(t),this},e.createCSS3DObject=function(t){return this.object3d=new c.CSS3DObject(t),this},e.createCSS3DSprite=function(t){return this.object3d=new c.CSS3DSprite(t),this},e.createSprite=function(t){return this.object3d=new v.Sprite(t),this},e.add=function(){for(var t=arguments.length,a=new Array(t),u=0;u<t;u++)a[u]=arguments[u];var i;return(i=this.object3d).add.apply(i,I(a)),this},e.remove=function(){for(var t=arguments.length,a=new Array(t),u=0;u<t;u++)a[u]=arguments[u];var i;return(i=this.object3d).remove.apply(i,I(a)),this},e.getSize=function(){var t=new v.Box3().setFromObject(this.object3d);return{min:t.min,max:t.max,size:t.getSize(new v.Vector3)}},e.traverse=function(t){t(this),this.children.forEach(function(a){a.traverse(t)})},e.dispose=function(){De(this.object3d)},C(n,[{key:"parent",get:function(){var t=this.object3d.parent;return(t==null?void 0:t.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(t){return t.userData.BaseObject_}).filter(function(t){return!!t})}}]),n}(l)})(),module.exports=ye})();
|
package/dist/objects/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){var Me={666:function(A){var C=function(b){"use strict";var E=Object.prototype,M=E.hasOwnProperty,k,S=typeof Symbol=="function"?Symbol:{},z=S.iterator||"@@iterator",Z=S.asyncIterator||"@@asyncIterator",R=S.toStringTag||"@@toStringTag";function L(c,s,f){return Object.defineProperty(c,s,{value:f,enumerable:!0,configurable:!0,writable:!0}),c[s]}try{L({},"")}catch(c){L=function(s,f,d){return s[f]=d}}function I(c,s,f,d){var m=s&&s.prototype instanceof x?s:x,T=Object.create(m.prototype),Y=new de(d||[]);return T._invoke=J(c,f,Y),T}b.wrap=I;function $(c,s,f){try{return{type:"normal",arg:c.call(s,f)}}catch(d){return{type:"throw",arg:d}}}var G="suspendedStart",l="suspendedYield",ie="executing",U="completed",B={};function x(){}function V(){}function D(){}var q={};L(q,z,function(){return this});var ee=Object.getPrototypeOf,te=ee&&ee(ee(ce([])));te&&te!==E&&M.call(te,z)&&(q=te);var Q=D.prototype=x.prototype=Object.create(q);V.prototype=D,L(Q,"constructor",D),L(D,"constructor",V),V.displayName=L(D,R,"GeneratorFunction");function re(c){["next","throw","return"].forEach(function(s){L(c,s,function(f){return this._invoke(s,f)})})}b.isGeneratorFunction=function(c){var s=typeof c=="function"&&c.constructor;return s?s===V||(s.displayName||s.name)==="GeneratorFunction":!1},b.mark=function(c){return Object.setPrototypeOf?Object.setPrototypeOf(c,D):(c.__proto__=D,L(c,R,"GeneratorFunction")),c.prototype=Object.create(Q),c},b.awrap=function(c){return{__await:c}};function oe(c,s){function f(T,Y,K,H){var X=$(c[T],c,Y);if(X.type==="throw")H(X.arg);else{var me=X.arg,ue=me.value;return ue&&typeof ue=="object"&&M.call(ue,"__await")?s.resolve(ue.__await).then(function(ae){f("next",ae,K,H)},function(ae){f("throw",ae,K,H)}):s.resolve(ue).then(function(ae){me.value=ae,K(me)},function(ae){return f("throw",ae,K,H)})}}var d;function m(T,Y){function K(){return new s(function(H,X){f(T,Y,H,X)})}return d=d?d.then(K,K):K()}this._invoke=m}re(oe.prototype),L(oe.prototype,Z,function(){return this}),b.AsyncIterator=oe,b.async=function(c,s,f,d,m){m===void 0&&(m=Promise);var T=new oe(I(c,s,f,d),m);return b.isGeneratorFunction(s)?T:T.next().then(function(Y){return Y.done?Y.value:T.next()})};function J(c,s,f){var d=G;return function(T,Y){if(d===ie)throw new Error("Generator is already running");if(d===U){if(T==="throw")throw Y;return ye()}for(f.method=T,f.arg=Y;;){var K=f.delegate;if(K){var H=se(K,f);if(H){if(H===B)continue;return H}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(d===G)throw d=U,f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);d=ie;var X=$(c,s,f);if(X.type==="normal"){if(d=f.done?U:l,X.arg===B)continue;return{value:X.arg,done:f.done}}else X.type==="throw"&&(d=U,f.method="throw",f.arg=X.arg)}}}function se(c,s){var f=c.iterator[s.method];if(f===k){if(s.delegate=null,s.method==="throw"){if(c.iterator.return&&(s.method="return",s.arg=k,se(c,s),s.method==="throw"))return B;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return B}var d=$(f,c.iterator,s.arg);if(d.type==="throw")return s.method="throw",s.arg=d.arg,s.delegate=null,B;var m=d.arg;if(!m)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,B;if(m.done)s[c.resultName]=m.value,s.next=c.nextLoc,s.method!=="return"&&(s.method="next",s.arg=k);else return m;return s.delegate=null,B}re(Q),L(Q,R,"Generator"),L(Q,z,function(){return this}),L(Q,"toString",function(){return"[object Generator]"});function pe(c){var s={tryLoc:c[0]};1 in c&&(s.catchLoc=c[1]),2 in c&&(s.finallyLoc=c[2],s.afterLoc=c[3]),this.tryEntries.push(s)}function ve(c){var s=c.completion||{};s.type="normal",delete s.arg,c.completion=s}function de(c){this.tryEntries=[{tryLoc:"root"}],c.forEach(pe,this),this.reset(!0)}b.keys=function(c){var s=[];for(var f in c)s.push(f);return s.reverse(),function d(){for(;s.length;){var m=s.pop();if(m in c)return d.value=m,d.done=!1,d}return d.done=!0,d}};function ce(c){if(c){var s=c[z];if(s)return s.call(c);if(typeof c.next=="function")return c;if(!isNaN(c.length)){var f=-1,d=function m(){for(;++f<c.length;)if(M.call(c,f))return m.value=c[f],m.done=!1,m;return m.value=k,m.done=!0,m};return d.next=d}}return{next:ye}}b.values=ce;function ye(){return{value:k,done:!0}}return de.prototype={constructor:de,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=k,this.done=!1,this.delegate=null,this.method="next",this.arg=k,this.tryEntries.forEach(ve),!c)for(var s in this)s.charAt(0)==="t"&&M.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=k)},stop:function(){this.done=!0;var c=this.tryEntries[0],s=c.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var s=this;function f(H,X){return T.type="throw",T.arg=c,s.next=H,X&&(s.method="next",s.arg=k),!!X}for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d],T=m.completion;if(m.tryLoc==="root")return f("end");if(m.tryLoc<=this.prev){var Y=M.call(m,"catchLoc"),K=M.call(m,"finallyLoc");if(Y&&K){if(this.prev<m.catchLoc)return f(m.catchLoc,!0);if(this.prev<m.finallyLoc)return f(m.finallyLoc)}else if(Y){if(this.prev<m.catchLoc)return f(m.catchLoc,!0)}else if(K){if(this.prev<m.finallyLoc)return f(m.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(c,s){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc<=this.prev&&M.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var m=d;break}}m&&(c==="break"||c==="continue")&&m.tryLoc<=s&&s<=m.finallyLoc&&(m=null);var T=m?m.completion:{};return T.type=c,T.arg=s,m?(this.method="next",this.next=m.finallyLoc,B):this.complete(T)},complete:function(c,s){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&s&&(this.next=s),B},finish:function(c){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.finallyLoc===c)return this.complete(f.completion,f.afterLoc),ve(f),B}},catch:function(c){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.tryLoc===c){var d=f.completion;if(d.type==="throw"){var m=d.arg;ve(f)}return m}}throw new Error("illegal catch attempt")},delegateYield:function(c,s,f){return this.delegate={iterator:ce(c),resultName:s,nextLoc:f},this.method==="next"&&(this.arg=k),B}},b}(A.exports);try{regeneratorRuntime=C}catch(b){typeof globalThis=="object"?globalThis.regeneratorRuntime=C:Function("r","regeneratorRuntime = r")(C)}},695:function(A,C,b){"use strict";b.d(C,{Z:function(){return E}});function E(M){if(M.geometry&&M.geometry.dispose(),M.material){var k=Array.isArray(M.material)?M.material:[M.material];k.forEach(function(S){var z,Z,R,L,I,$,G,l,ie,U,B,x,V;(z=S.map)===null||z===void 0||z.dispose(),(Z=S.lightMap)===null||Z===void 0||Z.dispose(),(R=S.bumpMap)===null||R===void 0||R.dispose(),(L=S.normalMap)===null||L===void 0||L.dispose(),(I=S.specularMap)===null||I===void 0||I.dispose(),($=S.envMap)===null||$===void 0||$.dispose(),(G=S.alphaMap)===null||G===void 0||G.dispose(),(l=S.aoMap)===null||l===void 0||l.dispose(),(ie=S.displacementMap)===null||ie===void 0||ie.dispose(),(U=S.emissiveMap)===null||U===void 0||U.dispose(),(B=S.gradientMap)===null||B===void 0||B.dispose(),(x=S.metalnessMap)===null||x===void 0||x.dispose(),(V=S.roughnessMap)===null||V===void 0||V.dispose(),S.dispose()})}}},519:function(A,C,b){"use strict";b.d(C,{disposeMesh:function(){return S.Z}});var E=b(666),M=b.n(E),k=null,S=b(695),z=b(644);function Z(U){if(U.material){var B=Array.isArray(U.material)?U.material:[U.material];B.forEach(function(x){var V,D;(V=x.color)===null||V===void 0||V.convertSRGBToLinear(),(D=x.emissive)===null||D===void 0||D.convertSRGBToLinear(),x.map&&(x.map.encoding=THREE.sRGBEncoding),x.emissiveMap&&(x.emissiveMap.encoding=THREE.sRGBEncoding)})}}var R=b(568),L=b(924),I=require("idb-keyval"),$=b(484),G=null,l=null,ie=function(){var U=(0,R.Z)(M().mark(function B(x,V){var D,q,ee,te,Q,re;return M().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return D=V.version,J.next=4,(0,I.get)(x);case 4:if(ee=J.sent,!(ee&&ee[D])){J.next=9;break}q=ee[D],J.next=15;break;case 9:return J.next=11,(0,$.Z)(fetch(x).then(function(se){if(se.ok)return se.blob();throw new Error}));case 11:te=J.sent,Q=te.res,re=te.err,re||(q=Q,(0,I.set)(x,(0,L.Z)({},D,Q)));case 15:return J.abrupt("return",q?{url:URL.createObjectURL(q)}:{url:x});case 16:case"end":return J.stop()}},B)}));return function(x,V){return U.apply(this,arguments)}}()},484:function(A,C,b){"use strict";b.d(C,{Z:function(){return M}});var E=b(42);function M(k){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return k.then(function(z){return(0,E.Z)({err:null,res:z},S)}).catch(function(z){return(0,E.Z)({err:z,res:void 0},S)})}},644:function(A){"use strict";A.exports=require("three")},568:function(A,C,b){"use strict";b.d(C,{Z:function(){return M}});function E(k,S,z,Z,R,L,I){try{var $=k[L](I),G=$.value}catch(l){z(l);return}$.done?S(G):Promise.resolve(G).then(Z,R)}function M(k){return function(){var S=this,z=arguments;return new Promise(function(Z,R){var L=k.apply(S,z);function I(G){E(L,Z,R,I,$,"next",G)}function $(G){E(L,Z,R,I,$,"throw",G)}I(void 0)})}}},924:function(A,C,b){"use strict";b.d(C,{Z:function(){return E}});function E(M,k,S){return k in M?Object.defineProperty(M,k,{value:S,enumerable:!0,configurable:!0,writable:!0}):M[k]=S,M}},42:function(A,C,b){"use strict";b.d(C,{Z:function(){return M}});var E=b(924);function M(k){for(var S=1;S<arguments.length;S++){var z=arguments[S]!=null?arguments[S]:{},Z=Object.keys(z);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(z).filter(function(R){return Object.getOwnPropertyDescriptor(z,R).enumerable}))),Z.forEach(function(R){(0,E.Z)(k,R,z[R])})}return k}}},Se={};function N(A){var C=Se[A];if(C!==void 0)return C.exports;var b=Se[A]={exports:{}};return Me[A](b,b.exports,N),b.exports}(function(){N.n=function(A){var C=A&&A.__esModule?function(){return A.default}:function(){return A};return N.d(C,{a:C}),C}})(),function(){N.d=function(A,C){for(var b in C)N.o(C,b)&&!N.o(A,b)&&Object.defineProperty(A,b,{enumerable:!0,get:C[b]})}}(),function(){N.o=function(A,C){return Object.prototype.hasOwnProperty.call(A,C)}}(),function(){N.r=function(A){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})}}();var be={};(function(){"use strict";N.r(be),N.d(be,{Image:function(){return Y},Line:function(){return Le},MeshLine:function(){return ne},MeshLineMaterial:function(){return we},MeshLineRaycast:function(){return Ae},Node:function(){return ae},Text:function(){return f},Video:function(){return me}});function A(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function C(t,a){return C=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},C(t,a)}function b(t,a){return C(t,a)}function E(t,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(a&&a.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),a&&b(t,a)}var M=N(42);function k(t,a){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);a&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function S(t,a){return a=a!=null?a:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):k(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}),t}function z(){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(t){return!1}}function Z(t){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Z(t)}function R(t){return Z(t)}function L(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function I(t){return t&&t.constructor===Symbol?"symbol":typeof t}function $(t,a){return a&&(I(a)==="object"||typeof a=="function")?a:L(t)}function G(t){var a=z();return function(){var n=R(t),i;if(a){var e=R(this).constructor;i=Reflect.construct(n,arguments,e)}else i=n.apply(this,arguments);return $(this,i)}}var l=N(644);function ie(){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(t){return!1}}function U(t,a,r){return ie()?U=Reflect.construct:U=function(i,e,o){var u=[null];u.push.apply(u,e);var h=Function.bind.apply(i,u),p=new h;return o&&b(p,o.prototype),p},U.apply(null,arguments)}function B(t,a,r){return U.apply(null,arguments)}function x(t,a){for(var r=0;r<a.length;r++){var n=a[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function V(t,a,r){return a&&x(t.prototype,a),r&&x(t,r),t}function D(t,a){(a==null||a>t.length)&&(a=t.length);for(var r=0,n=new Array(a);r<a;r++)n[r]=t[r];return n}function q(t){if(Array.isArray(t))return D(t)}function ee(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function te(){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 Q(t,a){if(!!t){if(typeof t=="string")return D(t,a);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return D(t,a)}}function re(t){return q(t)||ee(t)||Q(t)||te()}var oe=N(484);function J(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,i){r.resolve=n,r.reject=i}),t&&(r.promise=(0,oe.Z)(r.promise,a)),r}var se=require("@tweenjs/tween.js"),pe=N.n(se),ve=function(){"use strict";function t(){A(this,t),this.guiParams={}}var a=t.prototype;return a.showGuiParams=function(n){var i=this;!n||Object.keys(this.guiParams).forEach(function(e){var o=n.addFolder(e),u=i.guiParams[e];Object.keys(u).forEach(function(h){var p=u[h],_=p.min,y=p.max,g=p.step,P=p.name,w=p.to,O=p.paramMap,v=p.items,F=p.value,W=p.target,ge=h.toLowerCase().indexOf("color")>-1,j,le=typeof F=="undefined"&&W,he=le?W():u[h],fe=le?h:"value";v?j=o.add(he,fe,v):ge?j=o.addColor(he,fe):j=o.add(he,fe),j=j.name(P||h),typeof _!="undefined"&&(j=j.min(_)),typeof y!="undefined"&&(j=j.max(y)),typeof g!="undefined"&&(j=j.step(g)),j=j.onChange(function(){i.setGuiTargetValue(e,h,he[fe],O)}),(w||le)&&j.listen()})})},a.setGuiTargetValue=function(n,i,e,o){var u=this.guiParams[n][i],h=u.onChange,p=u.target,_=u.value,y=i.toLowerCase().indexOf("color")>-1,g=typeof _=="undefined"&&p;if(p&&!g){var P=p();Array.isArray(P)||(P=[P]),P.forEach(function(w){if(!!w)if(y)try{w[o||i].set(e)}catch(O){i!=="color"&&!o&&console.warn("".concat(i," is not a color,set paramMap"))}else w[o||i]=e})}h&&h(e)},a.setGuiTargetValueByParams=function(){var n=this;Object.keys(this.guiParams).forEach(function(i){Object.keys(n.guiParams[i]).forEach(function(e){var o=n.guiParams[i][e];typeof o.value!="undefined"&&n.setGuiTargetValue(i,e,o.value,o.paramMap)})})},a.guiParamTween=function(n,i,e){var o=e.duration,u=o===void 0?0:o,h=this,p=this.guiParams[n][i],_=p.to,y=p.paramMap,g=y===void 0?"":y;return new(pe()).Tween(this.guiParams[n][i]).to({value:_},u).onUpdate(function(P){h.setGuiTargetValue(n,i,P.value,g)})},t}(),de=require("three/examples/jsm/renderers/CSS2DRenderer"),ce=require("three/examples/jsm/renderers/CSS3DRenderer"),ye=N(519),c=function(t){console.log(t),t&&((0,ye.disposeMesh)(t),t.children.forEach(function(a){a.userData.BaseObject_||c(a)}))},s=function(t){"use strict";E(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.objecttype__="BaseObject",e.userData={},e.pm=J(),e.visible=!1,e}var n=r.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(e,o){},n.resize=function(e,o){},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,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];return this.object3d=B(l.Mesh,re(o)),this},n.createGroup=function(){return this.object3d=new l.Group,this},n.createPoints=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];return this.object3d=B(l.Points,re(o)),this},n.createCSS2DObject=function(e){return this.object3d=new de.CSS2DObject(e),this},n.createCSS3DObject=function(e){return this.object3d=new ce.CSS3DObject(e),this},n.createCSS3DSprite=function(e){return this.object3d=new ce.CSS3DSprite(e),this},n.createSprite=function(e){return this.object3d=new l.Sprite(e),this},n.add=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];var h;return(h=this.object3d).add.apply(h,re(o)),this},n.remove=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];var h;return(h=this.object3d).remove.apply(h,re(o)),this},n.getSize=function(){var e=new l.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new l.Vector3)}},n.traverse=function(e){e(this),this.children.forEach(function(o){o.traverse(e)})},n.dispose=function(){console.log(this),c(this.object3d)},V(r,[{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})}}]),r}(ve),f=function(t){"use strict";E(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.width=0,e.options=(0,M.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},i),e}var n=r.prototype;return n.init=function(){var e=document.createElement("canvas");this.canvas=e},n.create=function(){var e=this.options,o=e.position,u=e.lookAt,h=e.sprite,p=e.text,_=e.sizeAttenuation;if(h){var y=new l.Sprite(new l.SpriteMaterial({transparent:!0,sizeAttenuation:_}));this.object3d=y}else{var g=new l.MeshBasicMaterial({side:l.DoubleSide,transparent:!0}),P=new l.PlaneGeometry(1,1,1,1);this.createMesh(P,g)}this.object3d.position.copy(o),u&&this.object3d.lookAt(u),this.setText(p)},n.setText=function(e,o){var u=(0,M.Z)(S((0,M.Z)({},this.options),{text:e}),o||{}),h=u.text,p=u.fontSize,_=u.fontFamily,y=u.fontWeight,g=u.flipX,P=u.scale,w=this.canvas;w.width=p*h.length*2,w.height=p;var O=w.getContext("2d");O.font="".concat(y," ").concat(p,"px/1 ").concat(_);var v=O.measureText(h).width;w.width=v,this.width=v,O=w.getContext("2d"),O.clearRect(0,0,w.width,w.height),g&&O.scale(-1,1),O.font="".concat(y," ").concat(p,"px/1 ").concat(_),O.textBaseline="middle",O.fillStyle="#ffffff",O.fillText(h,g?v*-1:0,w.height/2),O.restore();var F=new l.Texture(w);F.anisotropy=16,F.needsUpdate=!0;var W=this.object3d;W.material.map&&W.material.map.dispose(),W.material.map=F,W.material.needsUpdate=!0,W.scale.set(F.image.width*P,F.image.height*P,1)},r}(s),d=N(568),m=N(666),T=N.n(m),Y=function(t){"use strict";E(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.options=i,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,d.Z)(T().mark(function o(){var u,h,p,_,y,g,P,w,O,v;return T().wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return u=e.options,h=u.transparent,p=u.blending,_=u.src,y=u.depthWrite,g=u.alphaTest,P=u.sprite,w=u.sizeAttenuation,W.next=3,new l.TextureLoader().loadAsync(_);case 3:return O=W.sent,v=P?new l.SpriteMaterial({map:O,transparent:h!=null?h:!1,blending:p!=null?p:l.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:g!=null?g:0,sizeAttenuation:w!=null?w:!0}):new l.MeshBasicMaterial({map:O,transparent:h!=null?h:!1,blending:p!=null?p:l.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:g!=null?g:0}),W.abrupt("return",v);case 6:case"end":return W.stop()}},o)}))()},n.create=function(){var e=this;return(0,d.Z)(T().mark(function o(){var u,h,p,_,y,g,P,w;return T().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(u=e.options,h=u.scale,p=u.position,_=u.src,y=u.cache,g=u.sprite,!(y&&!y.get(_))){v.next=7;break}return y.init(_),v.next=5,e.getMaterial();case 5:P=v.sent,y.set(_,P);case 7:if(!y){v.next=13;break}return v.next=10,y.get(_);case 10:v.t0=v.sent,v.next=16;break;case 13:return v.next=15,e.getMaterial();case 15:v.t0=v.sent;case 16:w=v.t0,e.texture=w.map,g?e.createSprite(w):e.createMesh(new l.PlaneBufferGeometry(1,1),w),h&&e.object3d.scale.set(w.map.image.width*h,w.map.image.height*h,1),p&&e.object3d.position.copy(p);case 21:case"end":return v.stop()}},o)}))()},r}(s);function K(t,a){for(;!Object.prototype.hasOwnProperty.call(t,a)&&(t=R(t),t!==null););return t}function H(t,a,r){return typeof Reflect!="undefined"&&Reflect.get?H=Reflect.get:H=function(i,e,o){var u=K(i,e);if(!!u){var h=Object.getOwnPropertyDescriptor(u,e);return h.get?h.get.call(o||i):h.value}},H(t,a,r)}function X(t,a,r){return H(t,a,r)}var me=function(t){"use strict";E(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.options=(0,M.Z)({},{autoPlay:!0,loop:!0},i),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,u=e.transparent,h=e.blending,p=e.depthWrite,_=e.format,y=e.autoPlay,g=e.loop,P=e.alphaTest,w=e.sprite,O=J(),v=document.createElement("video");return v.addEventListener("loadedmetadata",function(){var F=new l.VideoTexture(v);F.format=_!=null?_:l.RGBAFormat,F.needsUpdate=!0;var W=w?new l.SpriteMaterial({map:F,transparent:u!=null?u:!1,blending:h!=null?h:l.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:P!=null?P:0}):new l.MeshBasicMaterial({map:F,transparent:u!=null?u:!1,blending:h!=null?h:l.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:P!=null?P:0});O.resolve(W)},!1),v.src=o,v.muted=!0,v.autoplay=y,v.loop=g,v.preload="auto",O.promise},n.create=function(){var e=this;return(0,d.Z)(T().mark(function o(){var u,h,p,_,y,g,P,w;return T().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(u=e.options,h=u.scale,p=u.position,_=u.src,y=u.cache,g=u.sprite,!(y&&!y.get(_))){v.next=7;break}return y.init(_),v.next=5,e.getMaterial();case 5:P=v.sent,y.set(_,P);case 7:if(!y){v.next=13;break}return v.next=10,y.get(_);case 10:v.t0=v.sent,v.next=16;break;case 13:return v.next=15,e.getMaterial();case 15:v.t0=v.sent;case 16:w=v.t0,e.video=w.map.image,g?e.createSprite(w):e.createMesh(new l.PlaneBufferGeometry(1,1),w),h&&e.object3d.scale.set(e.video.videoWidth*h,e.video.videoHeight*h,1),p&&e.object3d.position.copy(p);case 21:case"end":return v.stop()}},o)}))()},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),X(R(r.prototype),"dispose",this).call(this)},r}(s),ue=function(t){"use strict";E(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.options=(0,M.Z)({},i),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,u=e.children,h=document.createElement("div");h.appendChild(u),this.createCSS2DObject(h),o&&this.object3d.position.copy(o)},n.getMaterial=function(e){return(0,d.Z)(T().mark(function o(){var u,h,p,_;return T().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return u=document.createElement("canvas"),u.width=256,u.height=256,h=u.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),p=new l.CanvasTexture(u),_=new l.SpriteMaterial({map:p,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",_);case 9:case"end":return g.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,u=o===void 0?!1:o,h=e.scale,p=h===void 0?new l.Vector3(1,1,1):h,_=e.position,y=_===void 0?new l.Vector3(0,0,0):_,g=e.cache,P=this;return(0,d.Z)(T().mark(function w(){var O,v,F,W;return T().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:if(O="node-create-pick-object",!(g&&!g.get(O))){j.next=7;break}return g.init(O),j.next=5,P.getMaterial(u);case 5:v=j.sent,g.set(O,v);case 7:if(!g){j.next=13;break}return j.next=10,g.get(O);case 10:j.t0=j.sent,j.next=16;break;case 13:return j.next=15,P.getMaterial(u);case 15:j.t0=j.sent;case 16:F=j.t0,W=new l.Sprite(F),W.scale.set(F.map.image.width*p.x,F.map.image.height*p.y,1),W.position.copy(y),P.add(W),P.pickObject=W;case 22:case"end":return j.stop()}},w)}))()},r}(s),ae=ue,Oe=`
|
|
1
|
+
(function(){var Me={666:function(A){var C=function(b){"use strict";var E=Object.prototype,M=E.hasOwnProperty,k,S=typeof Symbol=="function"?Symbol:{},z=S.iterator||"@@iterator",Z=S.asyncIterator||"@@asyncIterator",R=S.toStringTag||"@@toStringTag";function L(c,s,h){return Object.defineProperty(c,s,{value:h,enumerable:!0,configurable:!0,writable:!0}),c[s]}try{L({},"")}catch(c){L=function(s,h,d){return s[h]=d}}function I(c,s,h,d){var m=s&&s.prototype instanceof x?s:x,T=Object.create(m.prototype),Y=new de(d||[]);return T._invoke=J(c,h,Y),T}b.wrap=I;function $(c,s,h){try{return{type:"normal",arg:c.call(s,h)}}catch(d){return{type:"throw",arg:d}}}var G="suspendedStart",l="suspendedYield",ie="executing",U="completed",B={};function x(){}function V(){}function D(){}var q={};L(q,z,function(){return this});var ee=Object.getPrototypeOf,te=ee&&ee(ee(ce([])));te&&te!==E&&M.call(te,z)&&(q=te);var Q=D.prototype=x.prototype=Object.create(q);V.prototype=D,L(Q,"constructor",D),L(D,"constructor",V),V.displayName=L(D,R,"GeneratorFunction");function re(c){["next","throw","return"].forEach(function(s){L(c,s,function(h){return this._invoke(s,h)})})}b.isGeneratorFunction=function(c){var s=typeof c=="function"&&c.constructor;return s?s===V||(s.displayName||s.name)==="GeneratorFunction":!1},b.mark=function(c){return Object.setPrototypeOf?Object.setPrototypeOf(c,D):(c.__proto__=D,L(c,R,"GeneratorFunction")),c.prototype=Object.create(Q),c},b.awrap=function(c){return{__await:c}};function oe(c,s){function h(T,Y,K,H){var X=$(c[T],c,Y);if(X.type==="throw")H(X.arg);else{var me=X.arg,ue=me.value;return ue&&typeof ue=="object"&&M.call(ue,"__await")?s.resolve(ue.__await).then(function(ae){h("next",ae,K,H)},function(ae){h("throw",ae,K,H)}):s.resolve(ue).then(function(ae){me.value=ae,K(me)},function(ae){return h("throw",ae,K,H)})}}var d;function m(T,Y){function K(){return new s(function(H,X){h(T,Y,H,X)})}return d=d?d.then(K,K):K()}this._invoke=m}re(oe.prototype),L(oe.prototype,Z,function(){return this}),b.AsyncIterator=oe,b.async=function(c,s,h,d,m){m===void 0&&(m=Promise);var T=new oe(I(c,s,h,d),m);return b.isGeneratorFunction(s)?T:T.next().then(function(Y){return Y.done?Y.value:T.next()})};function J(c,s,h){var d=G;return function(T,Y){if(d===ie)throw new Error("Generator is already running");if(d===U){if(T==="throw")throw Y;return ye()}for(h.method=T,h.arg=Y;;){var K=h.delegate;if(K){var H=se(K,h);if(H){if(H===B)continue;return H}}if(h.method==="next")h.sent=h._sent=h.arg;else if(h.method==="throw"){if(d===G)throw d=U,h.arg;h.dispatchException(h.arg)}else h.method==="return"&&h.abrupt("return",h.arg);d=ie;var X=$(c,s,h);if(X.type==="normal"){if(d=h.done?U:l,X.arg===B)continue;return{value:X.arg,done:h.done}}else X.type==="throw"&&(d=U,h.method="throw",h.arg=X.arg)}}}function se(c,s){var h=c.iterator[s.method];if(h===k){if(s.delegate=null,s.method==="throw"){if(c.iterator.return&&(s.method="return",s.arg=k,se(c,s),s.method==="throw"))return B;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return B}var d=$(h,c.iterator,s.arg);if(d.type==="throw")return s.method="throw",s.arg=d.arg,s.delegate=null,B;var m=d.arg;if(!m)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,B;if(m.done)s[c.resultName]=m.value,s.next=c.nextLoc,s.method!=="return"&&(s.method="next",s.arg=k);else return m;return s.delegate=null,B}re(Q),L(Q,R,"Generator"),L(Q,z,function(){return this}),L(Q,"toString",function(){return"[object Generator]"});function pe(c){var s={tryLoc:c[0]};1 in c&&(s.catchLoc=c[1]),2 in c&&(s.finallyLoc=c[2],s.afterLoc=c[3]),this.tryEntries.push(s)}function ve(c){var s=c.completion||{};s.type="normal",delete s.arg,c.completion=s}function de(c){this.tryEntries=[{tryLoc:"root"}],c.forEach(pe,this),this.reset(!0)}b.keys=function(c){var s=[];for(var h in c)s.push(h);return s.reverse(),function d(){for(;s.length;){var m=s.pop();if(m in c)return d.value=m,d.done=!1,d}return d.done=!0,d}};function ce(c){if(c){var s=c[z];if(s)return s.call(c);if(typeof c.next=="function")return c;if(!isNaN(c.length)){var h=-1,d=function m(){for(;++h<c.length;)if(M.call(c,h))return m.value=c[h],m.done=!1,m;return m.value=k,m.done=!0,m};return d.next=d}}return{next:ye}}b.values=ce;function ye(){return{value:k,done:!0}}return de.prototype={constructor:de,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=k,this.done=!1,this.delegate=null,this.method="next",this.arg=k,this.tryEntries.forEach(ve),!c)for(var s in this)s.charAt(0)==="t"&&M.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=k)},stop:function(){this.done=!0;var c=this.tryEntries[0],s=c.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var s=this;function h(H,X){return T.type="throw",T.arg=c,s.next=H,X&&(s.method="next",s.arg=k),!!X}for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d],T=m.completion;if(m.tryLoc==="root")return h("end");if(m.tryLoc<=this.prev){var Y=M.call(m,"catchLoc"),K=M.call(m,"finallyLoc");if(Y&&K){if(this.prev<m.catchLoc)return h(m.catchLoc,!0);if(this.prev<m.finallyLoc)return h(m.finallyLoc)}else if(Y){if(this.prev<m.catchLoc)return h(m.catchLoc,!0)}else if(K){if(this.prev<m.finallyLoc)return h(m.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(c,s){for(var h=this.tryEntries.length-1;h>=0;--h){var d=this.tryEntries[h];if(d.tryLoc<=this.prev&&M.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var m=d;break}}m&&(c==="break"||c==="continue")&&m.tryLoc<=s&&s<=m.finallyLoc&&(m=null);var T=m?m.completion:{};return T.type=c,T.arg=s,m?(this.method="next",this.next=m.finallyLoc,B):this.complete(T)},complete:function(c,s){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&s&&(this.next=s),B},finish:function(c){for(var s=this.tryEntries.length-1;s>=0;--s){var h=this.tryEntries[s];if(h.finallyLoc===c)return this.complete(h.completion,h.afterLoc),ve(h),B}},catch:function(c){for(var s=this.tryEntries.length-1;s>=0;--s){var h=this.tryEntries[s];if(h.tryLoc===c){var d=h.completion;if(d.type==="throw"){var m=d.arg;ve(h)}return m}}throw new Error("illegal catch attempt")},delegateYield:function(c,s,h){return this.delegate={iterator:ce(c),resultName:s,nextLoc:h},this.method==="next"&&(this.arg=k),B}},b}(A.exports);try{regeneratorRuntime=C}catch(b){typeof globalThis=="object"?globalThis.regeneratorRuntime=C:Function("r","regeneratorRuntime = r")(C)}},695:function(A,C,b){"use strict";b.d(C,{Z:function(){return E}});function E(M){if(M.geometry&&M.geometry.dispose(),M.material){var k=Array.isArray(M.material)?M.material:[M.material];k.forEach(function(S){var z,Z,R,L,I,$,G,l,ie,U,B,x,V;(z=S.map)===null||z===void 0||z.dispose(),(Z=S.lightMap)===null||Z===void 0||Z.dispose(),(R=S.bumpMap)===null||R===void 0||R.dispose(),(L=S.normalMap)===null||L===void 0||L.dispose(),(I=S.specularMap)===null||I===void 0||I.dispose(),($=S.envMap)===null||$===void 0||$.dispose(),(G=S.alphaMap)===null||G===void 0||G.dispose(),(l=S.aoMap)===null||l===void 0||l.dispose(),(ie=S.displacementMap)===null||ie===void 0||ie.dispose(),(U=S.emissiveMap)===null||U===void 0||U.dispose(),(B=S.gradientMap)===null||B===void 0||B.dispose(),(x=S.metalnessMap)===null||x===void 0||x.dispose(),(V=S.roughnessMap)===null||V===void 0||V.dispose(),S.dispose()})}}},519:function(A,C,b){"use strict";b.d(C,{disposeMesh:function(){return S.Z}});var E=b(666),M=b.n(E),k=null,S=b(695),z=b(644);function Z(U){if(U.material){var B=Array.isArray(U.material)?U.material:[U.material];B.forEach(function(x){var V,D;(V=x.color)===null||V===void 0||V.convertSRGBToLinear(),(D=x.emissive)===null||D===void 0||D.convertSRGBToLinear(),x.map&&(x.map.encoding=THREE.sRGBEncoding),x.emissiveMap&&(x.emissiveMap.encoding=THREE.sRGBEncoding)})}}var R=b(568),L=b(924),I=require("idb-keyval"),$=b(484),G=null,l=null,ie=function(){var U=(0,R.Z)(M().mark(function B(x,V){var D,q,ee,te,Q,re;return M().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return D=V.version,J.next=4,(0,I.get)(x);case 4:if(ee=J.sent,!(ee&&ee[D])){J.next=9;break}q=ee[D],J.next=15;break;case 9:return J.next=11,(0,$.Z)(fetch(x).then(function(se){if(se.ok)return se.blob();throw new Error}));case 11:te=J.sent,Q=te.res,re=te.err,re||(q=Q,(0,I.set)(x,(0,L.Z)({},D,Q)));case 15:return J.abrupt("return",q?{url:URL.createObjectURL(q)}:{url:x});case 16:case"end":return J.stop()}},B)}));return function(x,V){return U.apply(this,arguments)}}()},484:function(A,C,b){"use strict";b.d(C,{Z:function(){return M}});var E=b(42);function M(k){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return k.then(function(z){return(0,E.Z)({err:null,res:z},S)}).catch(function(z){return(0,E.Z)({err:z,res:void 0},S)})}},644:function(A){"use strict";A.exports=require("three")},568:function(A,C,b){"use strict";b.d(C,{Z:function(){return M}});function E(k,S,z,Z,R,L,I){try{var $=k[L](I),G=$.value}catch(l){z(l);return}$.done?S(G):Promise.resolve(G).then(Z,R)}function M(k){return function(){var S=this,z=arguments;return new Promise(function(Z,R){var L=k.apply(S,z);function I(G){E(L,Z,R,I,$,"next",G)}function $(G){E(L,Z,R,I,$,"throw",G)}I(void 0)})}}},924:function(A,C,b){"use strict";b.d(C,{Z:function(){return E}});function E(M,k,S){return k in M?Object.defineProperty(M,k,{value:S,enumerable:!0,configurable:!0,writable:!0}):M[k]=S,M}},42:function(A,C,b){"use strict";b.d(C,{Z:function(){return M}});var E=b(924);function M(k){for(var S=1;S<arguments.length;S++){var z=arguments[S]!=null?arguments[S]:{},Z=Object.keys(z);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(z).filter(function(R){return Object.getOwnPropertyDescriptor(z,R).enumerable}))),Z.forEach(function(R){(0,E.Z)(k,R,z[R])})}return k}}},Se={};function N(A){var C=Se[A];if(C!==void 0)return C.exports;var b=Se[A]={exports:{}};return Me[A](b,b.exports,N),b.exports}(function(){N.n=function(A){var C=A&&A.__esModule?function(){return A.default}:function(){return A};return N.d(C,{a:C}),C}})(),function(){N.d=function(A,C){for(var b in C)N.o(C,b)&&!N.o(A,b)&&Object.defineProperty(A,b,{enumerable:!0,get:C[b]})}}(),function(){N.o=function(A,C){return Object.prototype.hasOwnProperty.call(A,C)}}(),function(){N.r=function(A){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})}}();var be={};(function(){"use strict";N.r(be),N.d(be,{Image:function(){return Y},Line:function(){return Le},MeshLine:function(){return ne},MeshLineMaterial:function(){return we},MeshLineRaycast:function(){return Ae},Node:function(){return ae},Text:function(){return h},Video:function(){return me}});function A(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function C(t,a){return C=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},C(t,a)}function b(t,a){return C(t,a)}function E(t,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(a&&a.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),a&&b(t,a)}var M=N(42);function k(t,a){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);a&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function S(t,a){return a=a!=null?a:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):k(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}),t}function z(){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(t){return!1}}function Z(t){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Z(t)}function R(t){return Z(t)}function L(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function I(t){return t&&t.constructor===Symbol?"symbol":typeof t}function $(t,a){return a&&(I(a)==="object"||typeof a=="function")?a:L(t)}function G(t){var a=z();return function(){var n=R(t),i;if(a){var e=R(this).constructor;i=Reflect.construct(n,arguments,e)}else i=n.apply(this,arguments);return $(this,i)}}var l=N(644);function ie(){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(t){return!1}}function U(t,a,r){return ie()?U=Reflect.construct:U=function(i,e,o){var u=[null];u.push.apply(u,e);var f=Function.bind.apply(i,u),p=new f;return o&&b(p,o.prototype),p},U.apply(null,arguments)}function B(t,a,r){return U.apply(null,arguments)}function x(t,a){for(var r=0;r<a.length;r++){var n=a[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function V(t,a,r){return a&&x(t.prototype,a),r&&x(t,r),t}function D(t,a){(a==null||a>t.length)&&(a=t.length);for(var r=0,n=new Array(a);r<a;r++)n[r]=t[r];return n}function q(t){if(Array.isArray(t))return D(t)}function ee(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function te(){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 Q(t,a){if(!!t){if(typeof t=="string")return D(t,a);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return D(t,a)}}function re(t){return q(t)||ee(t)||Q(t)||te()}var oe=N(484);function J(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,i){r.resolve=n,r.reject=i}),t&&(r.promise=(0,oe.Z)(r.promise,a)),r}var se=require("@tweenjs/tween.js"),pe=N.n(se),ve=function(){"use strict";function t(){A(this,t),this.guiParams={}}var a=t.prototype;return a.showGuiParams=function(n){var i=this;!n||Object.keys(this.guiParams).forEach(function(e){var o=n.addFolder(e),u=i.guiParams[e];Object.keys(u).forEach(function(f){var p=u[f],_=p.min,y=p.max,g=p.step,P=p.name,w=p.to,O=p.paramMap,v=p.items,F=p.value,W=p.target,ge=f.toLowerCase().indexOf("color")>-1,j,le=typeof F=="undefined"&&W,fe=le?W():u[f],he=le?f:"value";v?j=o.add(fe,he,v):ge?j=o.addColor(fe,he):j=o.add(fe,he),j=j.name(P||f),typeof _!="undefined"&&(j=j.min(_)),typeof y!="undefined"&&(j=j.max(y)),typeof g!="undefined"&&(j=j.step(g)),j=j.onChange(function(){i.setGuiTargetValue(e,f,fe[he],O)}),(w||le)&&j.listen()})})},a.setGuiTargetValue=function(n,i,e,o){var u=this.guiParams[n][i],f=u.onChange,p=u.target,_=u.value,y=i.toLowerCase().indexOf("color")>-1,g=typeof _=="undefined"&&p;if(p&&!g){var P=p();Array.isArray(P)||(P=[P]),P.forEach(function(w){if(!!w)if(y)try{w[o||i].set(e)}catch(O){i!=="color"&&!o&&console.warn("".concat(i," is not a color,set paramMap"))}else w[o||i]=e})}f&&f(e)},a.setGuiTargetValueByParams=function(){var n=this;Object.keys(this.guiParams).forEach(function(i){Object.keys(n.guiParams[i]).forEach(function(e){var o=n.guiParams[i][e];typeof o.value!="undefined"&&n.setGuiTargetValue(i,e,o.value,o.paramMap)})})},a.guiParamTween=function(n,i,e){var o=e.duration,u=o===void 0?0:o,f=this,p=this.guiParams[n][i],_=p.to,y=p.paramMap,g=y===void 0?"":y;return new(pe()).Tween(this.guiParams[n][i]).to({value:_},u).onUpdate(function(P){f.setGuiTargetValue(n,i,P.value,g)})},t}(),de=require("three/examples/jsm/renderers/CSS2DRenderer"),ce=require("three/examples/jsm/renderers/CSS3DRenderer"),ye=N(519),c=function(t){t&&((0,ye.disposeMesh)(t),t.children.forEach(function(a){a.userData.BaseObject_||c(a)}))},s=function(t){"use strict";E(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.objecttype__="BaseObject",e.userData={},e.pm=J(),e.visible=!1,e}var n=r.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(e,o){},n.resize=function(e,o){},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,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];return this.object3d=B(l.Mesh,re(o)),this},n.createGroup=function(){return this.object3d=new l.Group,this},n.createPoints=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];return this.object3d=B(l.Points,re(o)),this},n.createCSS2DObject=function(e){return this.object3d=new de.CSS2DObject(e),this},n.createCSS3DObject=function(e){return this.object3d=new ce.CSS3DObject(e),this},n.createCSS3DSprite=function(e){return this.object3d=new ce.CSS3DSprite(e),this},n.createSprite=function(e){return this.object3d=new l.Sprite(e),this},n.add=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];var f;return(f=this.object3d).add.apply(f,re(o)),this},n.remove=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];var f;return(f=this.object3d).remove.apply(f,re(o)),this},n.getSize=function(){var e=new l.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new l.Vector3)}},n.traverse=function(e){e(this),this.children.forEach(function(o){o.traverse(e)})},n.dispose=function(){c(this.object3d)},V(r,[{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})}}]),r}(ve),h=function(t){"use strict";E(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.width=0,e.options=(0,M.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},i),e}var n=r.prototype;return n.init=function(){var e=document.createElement("canvas");this.canvas=e},n.create=function(){var e=this.options,o=e.position,u=e.lookAt,f=e.sprite,p=e.text,_=e.sizeAttenuation;if(f){var y=new l.Sprite(new l.SpriteMaterial({transparent:!0,sizeAttenuation:_}));this.object3d=y}else{var g=new l.MeshBasicMaterial({side:l.DoubleSide,transparent:!0}),P=new l.PlaneGeometry(1,1,1,1);this.createMesh(P,g)}this.object3d.position.copy(o),u&&this.object3d.lookAt(u),this.setText(p)},n.setText=function(e,o){var u=(0,M.Z)(S((0,M.Z)({},this.options),{text:e}),o||{}),f=u.text,p=u.fontSize,_=u.fontFamily,y=u.fontWeight,g=u.flipX,P=u.scale,w=this.canvas;w.width=p*f.length*2,w.height=p;var O=w.getContext("2d");O.font="".concat(y," ").concat(p,"px/1 ").concat(_);var v=O.measureText(f).width;w.width=v,this.width=v,O=w.getContext("2d"),O.clearRect(0,0,w.width,w.height),g&&O.scale(-1,1),O.font="".concat(y," ").concat(p,"px/1 ").concat(_),O.textBaseline="middle",O.fillStyle="#ffffff",O.fillText(f,g?v*-1:0,w.height/2),O.restore();var F=new l.Texture(w);F.anisotropy=16,F.needsUpdate=!0;var W=this.object3d;W.material.map&&W.material.map.dispose(),W.material.map=F,W.material.needsUpdate=!0,W.scale.set(F.image.width*P,F.image.height*P,1)},r}(s),d=N(568),m=N(666),T=N.n(m),Y=function(t){"use strict";E(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.options=i,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,d.Z)(T().mark(function o(){var u,f,p,_,y,g,P,w,O,v;return T().wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return u=e.options,f=u.transparent,p=u.blending,_=u.src,y=u.depthWrite,g=u.alphaTest,P=u.sprite,w=u.sizeAttenuation,W.next=3,new l.TextureLoader().loadAsync(_);case 3:return O=W.sent,v=P?new l.SpriteMaterial({map:O,transparent:f!=null?f:!1,blending:p!=null?p:l.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:g!=null?g:0,sizeAttenuation:w!=null?w:!0}):new l.MeshBasicMaterial({map:O,transparent:f!=null?f:!1,blending:p!=null?p:l.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:g!=null?g:0}),W.abrupt("return",v);case 6:case"end":return W.stop()}},o)}))()},n.create=function(){var e=this;return(0,d.Z)(T().mark(function o(){var u,f,p,_,y,g,P,w;return T().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(u=e.options,f=u.scale,p=u.position,_=u.src,y=u.cache,g=u.sprite,!(y&&!y.get(_))){v.next=7;break}return y.init(_),v.next=5,e.getMaterial();case 5:P=v.sent,y.set(_,P);case 7:if(!y){v.next=13;break}return v.next=10,y.get(_);case 10:v.t0=v.sent,v.next=16;break;case 13:return v.next=15,e.getMaterial();case 15:v.t0=v.sent;case 16:w=v.t0,e.texture=w.map,g?e.createSprite(w):e.createMesh(new l.PlaneBufferGeometry(1,1),w),f&&e.object3d.scale.set(w.map.image.width*f,w.map.image.height*f,1),p&&e.object3d.position.copy(p);case 21:case"end":return v.stop()}},o)}))()},r}(s);function K(t,a){for(;!Object.prototype.hasOwnProperty.call(t,a)&&(t=R(t),t!==null););return t}function H(t,a,r){return typeof Reflect!="undefined"&&Reflect.get?H=Reflect.get:H=function(i,e,o){var u=K(i,e);if(!!u){var f=Object.getOwnPropertyDescriptor(u,e);return f.get?f.get.call(o||i):f.value}},H(t,a,r)}function X(t,a,r){return H(t,a,r)}var me=function(t){"use strict";E(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.options=(0,M.Z)({},{autoPlay:!0,loop:!0},i),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,u=e.transparent,f=e.blending,p=e.depthWrite,_=e.format,y=e.autoPlay,g=e.loop,P=e.alphaTest,w=e.sprite,O=J(),v=document.createElement("video");return v.addEventListener("loadedmetadata",function(){var F=new l.VideoTexture(v);F.format=_!=null?_:l.RGBAFormat,F.needsUpdate=!0;var W=w?new l.SpriteMaterial({map:F,transparent:u!=null?u:!1,blending:f!=null?f:l.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:P!=null?P:0}):new l.MeshBasicMaterial({map:F,transparent:u!=null?u:!1,blending:f!=null?f:l.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:P!=null?P:0});O.resolve(W)},!1),v.src=o,v.muted=!0,v.autoplay=y,v.loop=g,v.preload="auto",O.promise},n.create=function(){var e=this;return(0,d.Z)(T().mark(function o(){var u,f,p,_,y,g,P,w;return T().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(u=e.options,f=u.scale,p=u.position,_=u.src,y=u.cache,g=u.sprite,!(y&&!y.get(_))){v.next=7;break}return y.init(_),v.next=5,e.getMaterial();case 5:P=v.sent,y.set(_,P);case 7:if(!y){v.next=13;break}return v.next=10,y.get(_);case 10:v.t0=v.sent,v.next=16;break;case 13:return v.next=15,e.getMaterial();case 15:v.t0=v.sent;case 16:w=v.t0,e.video=w.map.image,g?e.createSprite(w):e.createMesh(new l.PlaneBufferGeometry(1,1),w),f&&e.object3d.scale.set(e.video.videoWidth*f,e.video.videoHeight*f,1),p&&e.object3d.position.copy(p);case 21:case"end":return v.stop()}},o)}))()},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),X(R(r.prototype),"dispose",this).call(this)},r}(s),ue=function(t){"use strict";E(r,t);var a=G(r);function r(i){A(this,r);var e;return e=a.call(this),e.options=(0,M.Z)({},i),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,u=e.children,f=document.createElement("div");f.appendChild(u),this.createCSS2DObject(f),o&&this.object3d.position.copy(o)},n.getMaterial=function(e){return(0,d.Z)(T().mark(function o(){var u,f,p,_;return T().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return u=document.createElement("canvas"),u.width=256,u.height=256,f=u.getContext("2d"),f.fillStyle="#ff0000",f.fillRect(0,0,256,256),p=new l.CanvasTexture(u),_=new l.SpriteMaterial({map:p,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",_);case 9:case"end":return g.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,u=o===void 0?!1:o,f=e.scale,p=f===void 0?new l.Vector3(1,1,1):f,_=e.position,y=_===void 0?new l.Vector3(0,0,0):_,g=e.cache,P=this;return(0,d.Z)(T().mark(function w(){var O,v,F,W;return T().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:if(O="node-create-pick-object",!(g&&!g.get(O))){j.next=7;break}return g.init(O),j.next=5,P.getMaterial(u);case 5:v=j.sent,g.set(O,v);case 7:if(!g){j.next=13;break}return j.next=10,g.get(O);case 10:j.t0=j.sent,j.next=16;break;case 13:return j.next=15,P.getMaterial(u);case 15:j.t0=j.sent;case 16:F=j.t0,W=new l.Sprite(F),W.scale.set(F.map.image.width*p.x,F.map.image.height*p.y,1),W.position.copy(y),P.add(W),P.pickObject=W;case 22:case"end":return j.stop()}},w)}))()},r}(s),ae=ue,Oe=`
|
|
2
2
|
`.concat(l.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
3
|
`).concat(l.ShaderChunk.fog_pars_vertex,`
|
|
4
4
|
attribute vec3 previous;
|
|
@@ -129,4 +129,4 @@ void main() {
|
|
|
129
129
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
130
130
|
`).concat(l.ShaderChunk.fog_fragment,`
|
|
131
131
|
}
|
|
132
|
-
`),ne=function(t){"use strict";E(r,t);var a=G(r);function r(){A(this,r);var n;return n=a.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new l.Matrix4,Object.defineProperties(L(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(l.BufferGeometry);ne.prototype.setMatrixWorld=function(t){this.matrixWorld=t},ne.prototype.setGeometry=function(t,a){this._geometry=t,this.setPoints(t.getAttribute("position").array,a)},ne.prototype.setPoints=function(t,a){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=a,this.positions=[],this.counters=[],t.length&&t[0]instanceof l.Vector3)for(var r=0;r<t.length;r++){var n=t[r],i=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(i),this.counters.push(i)}else for(var r=0;r<t.length;r+=3){var i=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(i),this.counters.push(i)}this.process()};function Ae(t,a){var r=new l.Matrix4,n=new l.Ray,i=new l.Sphere,e=new l.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),i.copy(o.boundingSphere),i.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(i,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var u=new l.Vector3,h=new l.Vector3,p=new l.Vector3,_=this instanceof l.LineSegments?2:1,y=o.index,g=o.attributes;if(y!==null)for(var P=y.array,w=g.position.array,O=g.width.array,v=0,F=P.length-1;v<F;v+=_){var W=P[v],ge=P[v+1];u.fromArray(w,W*3),h.fromArray(w,ge*3);var j=O[Math.floor(v/3)]!==void 0?O[Math.floor(v/3)]:1,le=t.params.Line.threshold+this.material.lineWidth*j/2,he=le*le,fe=n.distanceSqToSegment(u,h,e,p);if(!(fe>he)){e.applyMatrix4(this.matrixWorld);var Pe=t.ray.origin.distanceTo(e);Pe<t.near||Pe>t.far||(a.push({distance:Pe,point:p.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}),v=F)}}}}ne.prototype.raycast=Ae,ne.prototype.compareV3=function(t,a){var r=t*6,n=a*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},ne.prototype.copyV3=function(t){var a=t*6;return[this.positions[a],this.positions[a+1],this.positions[a+2]]},ne.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var a,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?a=this.widthCallback(n/(t-1)):a=1,this.width.push(a),this.width.push(a),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var i=n*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new l.BufferAttribute(new Float32Array(this.positions),3),previous:new l.BufferAttribute(new Float32Array(this.previous),3),next:new l.BufferAttribute(new Float32Array(this.next),3),side:new l.BufferAttribute(new Float32Array(this.side),1),width:new l.BufferAttribute(new Float32Array(this.width),1),uv:new l.BufferAttribute(new Float32Array(this.uvs),2),index:new l.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new l.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function _e(t,a,r,n,i){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=a?t.subarray?t.subarray(a,i&&a+i):t.slice(a,i&&a+i):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}ne.prototype.advance=function(t){var a=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,i=a.length;_e(a,0,r,0,i),_e(a,6,a,0,i-6),a[i-6]=t.x,a[i-5]=t.y,a[i-4]=t.z,a[i-3]=t.x,a[i-2]=t.y,a[i-1]=t.z,_e(a,6,n,0,i-6),n[i-6]=t.x,n[i-5]=t.y,n[i-4]=t.z,n[i-3]=t.x,n[i-2]=t.y,n[i-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},l.ShaderChunk.meshline_vert=Oe,l.ShaderChunk.meshline_frag=xe;var we=function(t){"use strict";E(r,t);var a=G(r);function r(n){A(this,r);var i;return i=a.call(this,{uniforms:Object.assign({},l.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new l.Color(16777215)},opacity:{value:1},resolution:{value:new l.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new l.Vector2(1,1)},offset:{value:new l.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new l.Vector2(0,0)},lightColor:{value:new l.Color(16777215)}}),vertexShader:l.ShaderChunk.meshline_vert,fragmentShader:l.ShaderChunk.meshline_frag}),i.isMeshLineMaterial=!0,i.type="MeshLineMaterial",Object.defineProperties(L(i),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),i.setValues(n),i}return r}(l.ShaderMaterial);we.prototype.copy=function(t){return l.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function Ce(t,a){if(t==null)return{};var r={},n=Object.keys(t),i,e;for(e=0;e<n.length;e++)i=n[e],!(a.indexOf(i)>=0)&&(r[i]=t[i]);return r}function je(t,a){if(t==null)return{};var r=Ce(t,a),n,i;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(i=0;i<e.length;i++)n=e[i],!(a.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var Te={nodes:[],color:new l.Color("red"),lineWidth:3,sizeAttenuation:0},ke=function(t){"use strict";E(r,t);var a=G(r);function r(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,r);var e;return e=a.call(this),e.geometry=new l.BufferGeometry,e.meshline=new ne,e.options=(0,M.Z)({},Te,i),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.nodes,u=e.duration,h=e.delay,p=e.onComplete,_=e.setPointWidth,y=je(e,["nodes","duration","delay","onComplete","setPointWidth"]),g=this.pencil.getSize(),P=g.width,w=g.height;delete y.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,_);var O=new we(S((0,M.Z)({},y),{resolution:new l.Vector2(P,w)}));this.material=O,this.createMesh(this.meshline,O)},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,u=e.delay,h=e.onComplete,p=this.material.uniforms.offset,_=new(pe()).Tween(p.value).to({x:0},o!=null?o:1e3).delay(u!=null?u:0).repeat(1/0);h&&_.onComplete(h),_.start(),this.tween=_},n.dispose=function(){X(R(r.prototype),"dispose",this).call(this),this.tween&&pe().remove(this.tween)},r}(s),Le=ke})(),module.exports=be})();
|
|
132
|
+
`),ne=function(t){"use strict";E(r,t);var a=G(r);function r(){A(this,r);var n;return n=a.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new l.Matrix4,Object.defineProperties(L(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(l.BufferGeometry);ne.prototype.setMatrixWorld=function(t){this.matrixWorld=t},ne.prototype.setGeometry=function(t,a){this._geometry=t,this.setPoints(t.getAttribute("position").array,a)},ne.prototype.setPoints=function(t,a){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=a,this.positions=[],this.counters=[],t.length&&t[0]instanceof l.Vector3)for(var r=0;r<t.length;r++){var n=t[r],i=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(i),this.counters.push(i)}else for(var r=0;r<t.length;r+=3){var i=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(i),this.counters.push(i)}this.process()};function Ae(t,a){var r=new l.Matrix4,n=new l.Ray,i=new l.Sphere,e=new l.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),i.copy(o.boundingSphere),i.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(i,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var u=new l.Vector3,f=new l.Vector3,p=new l.Vector3,_=this instanceof l.LineSegments?2:1,y=o.index,g=o.attributes;if(y!==null)for(var P=y.array,w=g.position.array,O=g.width.array,v=0,F=P.length-1;v<F;v+=_){var W=P[v],ge=P[v+1];u.fromArray(w,W*3),f.fromArray(w,ge*3);var j=O[Math.floor(v/3)]!==void 0?O[Math.floor(v/3)]:1,le=t.params.Line.threshold+this.material.lineWidth*j/2,fe=le*le,he=n.distanceSqToSegment(u,f,e,p);if(!(he>fe)){e.applyMatrix4(this.matrixWorld);var Pe=t.ray.origin.distanceTo(e);Pe<t.near||Pe>t.far||(a.push({distance:Pe,point:p.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}),v=F)}}}}ne.prototype.raycast=Ae,ne.prototype.compareV3=function(t,a){var r=t*6,n=a*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},ne.prototype.copyV3=function(t){var a=t*6;return[this.positions[a],this.positions[a+1],this.positions[a+2]]},ne.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var a,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?a=this.widthCallback(n/(t-1)):a=1,this.width.push(a),this.width.push(a),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var i=n*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new l.BufferAttribute(new Float32Array(this.positions),3),previous:new l.BufferAttribute(new Float32Array(this.previous),3),next:new l.BufferAttribute(new Float32Array(this.next),3),side:new l.BufferAttribute(new Float32Array(this.side),1),width:new l.BufferAttribute(new Float32Array(this.width),1),uv:new l.BufferAttribute(new Float32Array(this.uvs),2),index:new l.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new l.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function _e(t,a,r,n,i){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=a?t.subarray?t.subarray(a,i&&a+i):t.slice(a,i&&a+i):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}ne.prototype.advance=function(t){var a=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,i=a.length;_e(a,0,r,0,i),_e(a,6,a,0,i-6),a[i-6]=t.x,a[i-5]=t.y,a[i-4]=t.z,a[i-3]=t.x,a[i-2]=t.y,a[i-1]=t.z,_e(a,6,n,0,i-6),n[i-6]=t.x,n[i-5]=t.y,n[i-4]=t.z,n[i-3]=t.x,n[i-2]=t.y,n[i-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},l.ShaderChunk.meshline_vert=Oe,l.ShaderChunk.meshline_frag=xe;var we=function(t){"use strict";E(r,t);var a=G(r);function r(n){A(this,r);var i;return i=a.call(this,{uniforms:Object.assign({},l.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new l.Color(16777215)},opacity:{value:1},resolution:{value:new l.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new l.Vector2(1,1)},offset:{value:new l.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new l.Vector2(0,0)},lightColor:{value:new l.Color(16777215)}}),vertexShader:l.ShaderChunk.meshline_vert,fragmentShader:l.ShaderChunk.meshline_frag}),i.isMeshLineMaterial=!0,i.type="MeshLineMaterial",Object.defineProperties(L(i),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),i.setValues(n),i}return r}(l.ShaderMaterial);we.prototype.copy=function(t){return l.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function Ce(t,a){if(t==null)return{};var r={},n=Object.keys(t),i,e;for(e=0;e<n.length;e++)i=n[e],!(a.indexOf(i)>=0)&&(r[i]=t[i]);return r}function je(t,a){if(t==null)return{};var r=Ce(t,a),n,i;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(i=0;i<e.length;i++)n=e[i],!(a.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var Te={nodes:[],color:new l.Color("red"),lineWidth:3,sizeAttenuation:0},ke=function(t){"use strict";E(r,t);var a=G(r);function r(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,r);var e;return e=a.call(this),e.geometry=new l.BufferGeometry,e.meshline=new ne,e.options=(0,M.Z)({},Te,i),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.nodes,u=e.duration,f=e.delay,p=e.onComplete,_=e.setPointWidth,y=je(e,["nodes","duration","delay","onComplete","setPointWidth"]),g=this.pencil.getSize(),P=g.width,w=g.height;delete y.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,_);var O=new we(S((0,M.Z)({},y),{resolution:new l.Vector2(P,w)}));this.material=O,this.createMesh(this.meshline,O)},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,u=e.delay,f=e.onComplete,p=this.material.uniforms.offset,_=new(pe()).Tween(p.value).to({x:0},o!=null?o:1e3).delay(u!=null?u:0).repeat(1/0);f&&_.onComplete(f),_.start(),this.tween=_},n.dispose=function(){X(R(r.prototype),"dispose",this).call(this),this.tween&&pe().remove(this.tween)},r}(s),Le=ke})(),module.exports=be})();
|