gl-draw 0.0.6 → 0.0.7

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