gl-draw 0.0.5 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/BaseObject.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/objects/image/index.d.ts +3 -1
- package/dist/objects/index.d.ts +1 -3
- package/dist/objects/index.js +3 -3
- package/dist/objects/node/index.d.ts +21 -0
- package/dist/objects/video/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/objects/css2dbind/index.d.ts +0 -21
- package/dist/objects/spriteImage/index.d.ts +0 -20
- package/dist/objects/spriteVideo/index.d.ts +0 -29
|
@@ -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 {};
|
package/dist/objects/index.d.ts
CHANGED
|
@@ -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
|
|
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';
|
package/dist/objects/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){var je={666:function(A){var C=function(_){"use strict";var T=Object.prototype,M=T.hasOwnProperty,j,S=typeof Symbol=="function"?Symbol:{},R=S.iterator||"@@iterator",V=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 m=s&&s.prototype instanceof O?s:O,G=Object.create(m.prototype),H=new de(b||[]);return G._invoke=$(l,f,H),G}_.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",D="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)})})}_.isGeneratorFunction=function(l){var s=typeof l=="function"&&l.constructor;return s?s===z||(s.displayName||s.name)==="GeneratorFunction":!1},_.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,B):(l.__proto__=B,L(l,k,"GeneratorFunction")),l.prototype=Object.create(J),l},_.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 m(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=m}te(oe.prototype),L(oe.prototype,V,function(){return this}),_.AsyncIterator=oe,_.async=function(l,s,f,b,m){m===void 0&&(m=Promise);var G=new oe(F(l,s,f,b),m);return _.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===D){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=D,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?D:c,N.arg===W)continue;return{value:N.arg,done:f.done}}else N.type==="throw"&&(b=D,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 m=b.arg;if(!m)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,W;if(m.done)s[l.resultName]=m.value,s.next=l.nextLoc,s.method!=="return"&&(s.method="next",s.arg=j);else return m;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)}_.keys=function(l){var s=[];for(var f in l)s.push(f);return s.reverse(),function b(){for(;s.length;){var m=s.pop();if(m in l)return b.value=m,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 m(){for(;++f<l.length;)if(M.call(l,f))return m.value=l[f],m.done=!1,m;return m.value=j,m.done=!0,m};return b.next=b}}return{next:ye}}_.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 m=this.tryEntries[b],G=m.completion;if(m.tryLoc==="root")return f("end");if(m.tryLoc<=this.prev){var H=M.call(m,"catchLoc"),X=M.call(m,"finallyLoc");if(H&&X){if(this.prev<m.catchLoc)return f(m.catchLoc,!0);if(this.prev<m.finallyLoc)return f(m.finallyLoc)}else if(H){if(this.prev<m.catchLoc)return f(m.catchLoc,!0)}else if(X){if(this.prev<m.finallyLoc)return f(m.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 m=b;break}}m&&(l==="break"||l==="continue")&&m.tryLoc<=s&&s<=m.finallyLoc&&(m=null);var G=m?m.completion:{};return G.type=l,G.arg=s,m?(this.method="next",this.next=m.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 m=b.arg;ve(f)}return m}}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}},_}(A.exports);try{regeneratorRuntime=C}catch(_){typeof globalThis=="object"?globalThis.regeneratorRuntime=C:Function("r","regeneratorRuntime = r")(C)}},695:function(A,C,_){"use strict";_.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,V,k,L,F,Z,E,c,ie,D,W,O,z;(R=S.map)===null||R===void 0||R.dispose(),(V=S.lightMap)===null||V===void 0||V.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(),(D=S.emissiveMap)===null||D===void 0||D.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,_){"use strict";_.d(C,{disposeMesh:function(){return S.Z}});var T=_(666),M=_.n(T),j=null,S=_(695),R=_(644);function V(D){if(D.material){var W=Array.isArray(D.material)?D.material:[D.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=_(568),L=_(924),F=require("idb-keyval"),Z=_(484),E=null,c=null,ie=function(){var D=(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 D.apply(this,arguments)}}()},484:function(A,C,_){"use strict";_.d(C,{Z:function(){return M}});var T=_(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,_){"use strict";_.d(C,{Z:function(){return M}});function T(j,S,R,V,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(V,k)}function M(j){return function(){var S=this,R=arguments;return new Promise(function(V,k){var L=j.apply(S,R);function F(E){T(L,V,k,F,Z,"next",E)}function Z(E){T(L,V,k,F,Z,"throw",E)}F(void 0)})}}},924:function(A,C,_){"use strict";_.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,_){"use strict";_.d(C,{Z:function(){return M}});var T=_(924);function M(j){for(var S=1;S<arguments.length;S++){var R=arguments[S]!=null?arguments[S]:{},V=Object.keys(R);typeof Object.getOwnPropertySymbols=="function"&&(V=V.concat(Object.getOwnPropertySymbols(R).filter(function(k){return Object.getOwnPropertyDescriptor(R,k).enumerable}))),V.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 _=Se[A]={exports:{}};return je[A](_,_.exports,U),_.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 _ in C)U.o(C,_)&&!U.o(A,_)&&Object.defineProperty(A,_,{enumerable:!0,get:C[_]})}}(),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 _(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&&_(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 V(t){return V=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},V(t)}function k(t){return V(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 D(t,o,r){return ie()?D=Reflect.construct:D=function(i,e,a){var u=[null];u.push.apply(u,e);var p=Function.bind.apply(i,u),v=new p;return a&&_(v,a.prototype),v},D.apply(null,arguments)}function W(t,o,r){return D.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],d=v.min,y=v.max,P=v.step,g=v.name,w=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 d!="undefined"&&(Y=Y.min(d)),typeof y!="undefined"&&(Y=Y.max(y)),typeof P!="undefined"&&(Y=Y.step(P)),Y=Y.onChange(function(){i.setGuiTargetValue(e,p,he[fe],x)}),(w||ce)&&Y.listen()})})},o.setGuiTargetValue=function(n,i,e,a){var u=this.guiParams[n][i],p=u.onChange,v=u.target,d=u.value,y=i.toLowerCase().indexOf("color")>-1,P=typeof d=="undefined"&&v;if(v&&!P){var g=v();Array.isArray(g)||(g=[g]),g.forEach(function(w){if(!!w)if(y)try{w[a||i].set(e)}catch(x){i!=="color"&&!a&&console.warn("".concat(i," is not a color,set paramMap"))}else w[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],d=v.to,y=v.paramMap,P=y===void 0?"":y;return new(pe()).Tween(this.guiParams[n][i]).to({value:d},u).onUpdate(function(g){p.setGuiTargetValue(n,i,g.value,P)})},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,d=e.sizeAttenuation;if(p){var y=new c.Sprite(new c.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=y}else{var P=new c.MeshBasicMaterial({side:c.DoubleSide,transparent:!0}),g=new c.PlaneGeometry(1,1,1,1);this.createMesh(g,P)}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,d=u.fontFamily,y=u.fontWeight,P=u.flipX,g=u.scale,w=this.canvas;w.width=v*p.length*2,w.height=v;var x=w.getContext("2d");x.font="".concat(y," ").concat(v,"px/1 ").concat(d);var h=x.measureText(p).width;w.width=h,this.width=h,x=w.getContext("2d"),x.clearRect(0,0,w.width,w.height),P&&x.scale(-1,1),x.font="".concat(y," ").concat(v,"px/1 ").concat(d),x.textBaseline="middle",x.fillStyle="#ffffff",x.fillText(p,P?h*-1:0,w.height/2),x.restore();var K=new c.Texture(w);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),m=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)(m().mark(function a(){var u,p,v,d,y,P,g,w;return m().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return u=e.options,p=u.transparent,v=u.blending,d=u.src,y=u.depthWrite,P=u.alphaTest,h.next=3,new c.TextureLoader().loadAsync(d);case 3:return g=h.sent,w=new c.MeshBasicMaterial({map:g,transparent:p!=null?p:!1,blending:v!=null?v:c.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:P!=null?P:0}),h.abrupt("return",w);case 6:case"end":return h.stop()}},a)}))()},n.create=function(){var e=this;return(0,f.Z)(m().mark(function a(){var u,p,v,d,y,P,g,w;return m().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(u=e.options,p=u.scale,v=u.position,d=u.src,y=u.cache,!(y&&!y.get(d))){h.next=7;break}return y.init(d),h.next=5,e.getMaterial();case 5:P=h.sent,y.set(d,P);case 7:if(!y){h.next=13;break}return h.next=10,y.get(d);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,w=new c.PlaneBufferGeometry(g.map.image.width,g.map.image.height),e.createMesh(w,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)(m().mark(function a(){var u,p;return m().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return u=e.options.src,d.next=3,new c.TextureLoader().loadAsync(u);case 3:p=d.sent,e.texture=p;case 5:case"end":return d.stop()}},a)}))()},n.create=function(){var e=this.texture,a=this.options,u=a.scale,p=a.position,v=a.blending,d=a.transparent,y=a.depthWrite,P=a.alphaTest,g=a.sizeAttenuation,w=new c.Sprite(new c.SpriteMaterial({map:e,transparent:d!=null?d:!0,blending:v!=null?v:c.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:P!=null?P:0,sizeAttenuation:g!=null?g:!0}));u&&w.scale.set(e.image.width*u,e.image.height*u,1),p&&w.position.copy(p),this.object3d=w},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,d=e.format,y=e.autoPlay,P=e.loop,g=e.alphaTest,w=$(),x=document.createElement("video");return x.addEventListener("loadedmetadata",function(){var h=new c.VideoTexture(x);h.format=d!=null?d: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});w.resolve(K)},!1),x.src=a,x.muted=!0,x.autoplay=y,x.loop=P,x.preload="auto",w.promise},n.create=function(){var e=this;return(0,f.Z)(m().mark(function a(){var u,p,v,d,y,P,g,w;return m().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(u=e.options,p=u.scale,v=u.position,d=u.src,y=u.cache,!(y&&!y.get(d))){h.next=7;break}return y.init(d),h.next=5,e.getMaterial();case 5:P=h.sent,y.set(d,P);case 7:if(!y){h.next=13;break}return h.next=10,y.get(d);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,w=new c.PlaneBufferGeometry(e.video.videoWidth,e.video.videoHeight),e.createMesh(w,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,d=e.autoPlay,y=e.loop,P=e.alphaTest,g=e.format,w=$(),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:P!=null?P:0});w.resolve(K)},!1),x.src=a,x.muted=!0,x.autoplay=d,x.loop=y,x.preload="auto",w.promise},n.create=function(){var e=this;return(0,f.Z)(m().mark(function a(){var u,p,v,d,y,P,g,w;return m().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(u=e.options,p=u.scale,v=u.position,d=u.src,y=u.cache,!(y&&!y.get(d))){h.next=7;break}return y.init(d),h.next=5,e.getMaterial();case 5:P=h.sent,y.set(d,P);case 7:if(!y){h.next=13;break}return h.next=10,y.get(d);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,w=new c.Sprite(g),p&&w.scale.set(e.video.videoWidth*p,e.video.videoHeight*p,1),v&&w.position.copy(v),e.object3d=w;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=`
|
|
1
|
+
(function(){var Me={666:function(A){var C=function(b){"use strict";var L=Object.prototype,M=L.hasOwnProperty,T,S=typeof Symbol=="function"?Symbol:{},R=S.iterator||"@@iterator",Z=S.asyncIterator||"@@asyncIterator",W=S.toStringTag||"@@toStringTag";function k(l,s,f){return Object.defineProperty(l,s,{value:f,enumerable:!0,configurable:!0,writable:!0}),l[s]}try{k({},"")}catch(l){k=function(s,f,y){return s[f]=y}}function $(l,s,f,y){var d=s&&s.prototype instanceof O?s:O,V=Object.create(d.prototype),X=new de(y||[]);return V._invoke=K(l,f,X),V}b.wrap=$;function H(l,s,f){try{return{type:"normal",arg:l.call(s,f)}}catch(y){return{type:"throw",arg:y}}}var B="suspendedStart",c="suspendedYield",ie="executing",U="completed",z={};function O(){}function D(){}function G(){}var q={};k(q,R,function(){return this});var ee=Object.getPrototypeOf,te=ee&&ee(ee(le([])));te&&te!==L&&M.call(te,R)&&(q=te);var Q=G.prototype=O.prototype=Object.create(q);D.prototype=G,k(Q,"constructor",G),k(G,"constructor",D),D.displayName=k(G,W,"GeneratorFunction");function re(l){["next","throw","return"].forEach(function(s){k(l,s,function(f){return this._invoke(s,f)})})}b.isGeneratorFunction=function(l){var s=typeof l=="function"&&l.constructor;return s?s===D||(s.displayName||s.name)==="GeneratorFunction":!1},b.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,G):(l.__proto__=G,k(l,W,"GeneratorFunction")),l.prototype=Object.create(Q),l},b.awrap=function(l){return{__await:l}};function oe(l,s){function f(V,X,N,J){var Y=H(l[V],l,X);if(Y.type==="throw")J(Y.arg);else{var me=Y.arg,ue=me.value;return ue&&typeof ue=="object"&&M.call(ue,"__await")?s.resolve(ue.__await).then(function(ae){f("next",ae,N,J)},function(ae){f("throw",ae,N,J)}):s.resolve(ue).then(function(ae){me.value=ae,N(me)},function(ae){return f("throw",ae,N,J)})}}var y;function d(V,X){function N(){return new s(function(J,Y){f(V,X,J,Y)})}return y=y?y.then(N,N):N()}this._invoke=d}re(oe.prototype),k(oe.prototype,Z,function(){return this}),b.AsyncIterator=oe,b.async=function(l,s,f,y,d){d===void 0&&(d=Promise);var V=new oe($(l,s,f,y),d);return b.isGeneratorFunction(s)?V:V.next().then(function(X){return X.done?X.value:V.next()})};function K(l,s,f){var y=B;return function(V,X){if(y===ie)throw new Error("Generator is already running");if(y===U){if(V==="throw")throw X;return ye()}for(f.method=V,f.arg=X;;){var N=f.delegate;if(N){var J=se(N,f);if(J){if(J===z)continue;return J}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(y===B)throw y=U,f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);y=ie;var Y=H(l,s,f);if(Y.type==="normal"){if(y=f.done?U:c,Y.arg===z)continue;return{value:Y.arg,done:f.done}}else Y.type==="throw"&&(y=U,f.method="throw",f.arg=Y.arg)}}}function se(l,s){var f=l.iterator[s.method];if(f===T){if(s.delegate=null,s.method==="throw"){if(l.iterator.return&&(s.method="return",s.arg=T,se(l,s),s.method==="throw"))return z;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return z}var y=H(f,l.iterator,s.arg);if(y.type==="throw")return s.method="throw",s.arg=y.arg,s.delegate=null,z;var d=y.arg;if(!d)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,z;if(d.done)s[l.resultName]=d.value,s.next=l.nextLoc,s.method!=="return"&&(s.method="next",s.arg=T);else return d;return s.delegate=null,z}re(Q),k(Q,W,"Generator"),k(Q,R,function(){return this}),k(Q,"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)}b.keys=function(l){var s=[];for(var f in l)s.push(f);return s.reverse(),function y(){for(;s.length;){var d=s.pop();if(d in l)return y.value=d,y.done=!1,y}return y.done=!0,y}};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,y=function d(){for(;++f<l.length;)if(M.call(l,f))return d.value=l[f],d.done=!1,d;return d.value=T,d.done=!0,d};return y.next=y}}return{next:ye}}b.values=le;function ye(){return{value:T,done:!0}}return de.prototype={constructor:de,reset:function(l){if(this.prev=0,this.next=0,this.sent=this._sent=T,this.done=!1,this.delegate=null,this.method="next",this.arg=T,this.tryEntries.forEach(ve),!l)for(var s in this)s.charAt(0)==="t"&&M.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=T)},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(J,Y){return V.type="throw",V.arg=l,s.next=J,Y&&(s.method="next",s.arg=T),!!Y}for(var y=this.tryEntries.length-1;y>=0;--y){var d=this.tryEntries[y],V=d.completion;if(d.tryLoc==="root")return f("end");if(d.tryLoc<=this.prev){var X=M.call(d,"catchLoc"),N=M.call(d,"finallyLoc");if(X&&N){if(this.prev<d.catchLoc)return f(d.catchLoc,!0);if(this.prev<d.finallyLoc)return f(d.finallyLoc)}else if(X){if(this.prev<d.catchLoc)return f(d.catchLoc,!0)}else if(N){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 y=this.tryEntries[f];if(y.tryLoc<=this.prev&&M.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var d=y;break}}d&&(l==="break"||l==="continue")&&d.tryLoc<=s&&s<=d.finallyLoc&&(d=null);var V=d?d.completion:{};return V.type=l,V.arg=s,d?(this.method="next",this.next=d.finallyLoc,z):this.complete(V)},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),z},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),z}},catch:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.tryLoc===l){var y=f.completion;if(y.type==="throw"){var d=y.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=T),z}},b}(A.exports);try{regeneratorRuntime=C}catch(b){typeof globalThis=="object"?globalThis.regeneratorRuntime=C:Function("r","regeneratorRuntime = r")(C)}},695:function(A,C,b){"use strict";b.d(C,{Z:function(){return L}});function L(M){if(M.geometry&&M.geometry.dispose(),M.material){var T=Array.isArray(M.material)?M.material:[M.material];T.forEach(function(S){var R,Z,W,k,$,H,B,c,ie,U,z,O,D;(R=S.map)===null||R===void 0||R.dispose(),(Z=S.lightMap)===null||Z===void 0||Z.dispose(),(W=S.bumpMap)===null||W===void 0||W.dispose(),(k=S.normalMap)===null||k===void 0||k.dispose(),($=S.specularMap)===null||$===void 0||$.dispose(),(H=S.envMap)===null||H===void 0||H.dispose(),(B=S.alphaMap)===null||B===void 0||B.dispose(),(c=S.aoMap)===null||c===void 0||c.dispose(),(ie=S.displacementMap)===null||ie===void 0||ie.dispose(),(U=S.emissiveMap)===null||U===void 0||U.dispose(),(z=S.gradientMap)===null||z===void 0||z.dispose(),(O=S.metalnessMap)===null||O===void 0||O.dispose(),(D=S.roughnessMap)===null||D===void 0||D.dispose(),S.dispose()})}}},519:function(A,C,b){"use strict";b.d(C,{disposeMesh:function(){return S.Z}});var L=b(666),M=b.n(L),T=null,S=b(695),R=b(644);function Z(U){if(U.material){var z=Array.isArray(U.material)?U.material:[U.material];z.forEach(function(O){var D,G;(D=O.color)===null||D===void 0||D.convertSRGBToLinear(),(G=O.emissive)===null||G===void 0||G.convertSRGBToLinear(),O.map&&(O.map.encoding=THREE.sRGBEncoding),O.emissiveMap&&(O.emissiveMap.encoding=THREE.sRGBEncoding)})}}var W=b(568),k=b(924),$=require("idb-keyval"),H=b(484),B=null,c=null,ie=function(){var U=(0,W.Z)(M().mark(function z(O,D){var G,q,ee,te,Q,re;return M().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return G=D.version,K.next=4,(0,$.get)(O);case 4:if(ee=K.sent,!(ee&&ee[G])){K.next=9;break}q=ee[G],K.next=15;break;case 9:return K.next=11,(0,H.Z)(fetch(O).then(function(se){if(se.ok)return se.blob();throw new Error}));case 11:te=K.sent,Q=te.res,re=te.err,re||(q=Q,(0,$.set)(O,(0,k.Z)({},G,Q)));case 15:return K.abrupt("return",q?{url:URL.createObjectURL(q)}:{url:O});case 16:case"end":return K.stop()}},z)}));return function(O,D){return U.apply(this,arguments)}}()},484:function(A,C,b){"use strict";b.d(C,{Z:function(){return M}});var L=b(42);function M(T){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T.then(function(R){return(0,L.Z)({err:null,res:R},S)}).catch(function(R){return(0,L.Z)({err:R,res:void 0},S)})}},644:function(A){"use strict";A.exports=require("three")},568:function(A,C,b){"use strict";b.d(C,{Z:function(){return M}});function L(T,S,R,Z,W,k,$){try{var H=T[k]($),B=H.value}catch(c){R(c);return}H.done?S(B):Promise.resolve(B).then(Z,W)}function M(T){return function(){var S=this,R=arguments;return new Promise(function(Z,W){var k=T.apply(S,R);function $(B){L(k,Z,W,$,H,"next",B)}function H(B){L(k,Z,W,$,H,"throw",B)}$(void 0)})}}},924:function(A,C,b){"use strict";b.d(C,{Z:function(){return L}});function L(M,T,S){return T in M?Object.defineProperty(M,T,{value:S,enumerable:!0,configurable:!0,writable:!0}):M[T]=S,M}},42:function(A,C,b){"use strict";b.d(C,{Z:function(){return M}});var L=b(924);function M(T){for(var S=1;S<arguments.length;S++){var R=arguments[S]!=null?arguments[S]:{},Z=Object.keys(R);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(R).filter(function(W){return Object.getOwnPropertyDescriptor(R,W).enumerable}))),Z.forEach(function(W){(0,L.Z)(T,W,R[W])})}return T}}},Se={};function I(A){var C=Se[A];if(C!==void 0)return C.exports;var b=Se[A]={exports:{}};return Me[A](b,b.exports,I),b.exports}(function(){I.n=function(A){var C=A&&A.__esModule?function(){return A.default}:function(){return A};return I.d(C,{a:C}),C}})(),function(){I.d=function(A,C){for(var b in C)I.o(C,b)&&!I.o(A,b)&&Object.defineProperty(A,b,{enumerable:!0,get:C[b]})}}(),function(){I.o=function(A,C){return Object.prototype.hasOwnProperty.call(A,C)}}(),function(){I.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";I.r(be),I.d(be,{Image:function(){return V},Line:function(){return ke},MeshLine:function(){return ne},MeshLineMaterial:function(){return we},MeshLineRaycast:function(){return Ae},Node:function(){return ue},Text:function(){return s},Video:function(){return Y}});function A(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function C(t,a){return C=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},C(t,a)}function b(t,a){return C(t,a)}function L(t,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(a&&a.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),a&&b(t,a)}var M=I(42);function T(t,a){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);a&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function S(t,a){return a=a!=null?a:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):T(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,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 Z(t){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Z(t)}function W(t){return Z(t)}function k(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $(t){return t&&t.constructor===Symbol?"symbol":typeof t}function H(t,a){return a&&($(a)==="object"||typeof a=="function")?a:k(t)}function B(t){var a=R();return function(){var n=W(t),i;if(a){var e=W(this).constructor;i=Reflect.construct(n,arguments,e)}else i=n.apply(this,arguments);return H(this,i)}}var c=I(644);function ie(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function U(t,a,r){return ie()?U=Reflect.construct:U=function(i,e,o){var u=[null];u.push.apply(u,e);var h=Function.bind.apply(i,u),p=new h;return o&&b(p,o.prototype),p},U.apply(null,arguments)}function z(t,a,r){return U.apply(null,arguments)}function O(t,a){for(var r=0;r<a.length;r++){var n=a[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function D(t,a,r){return a&&O(t.prototype,a),r&&O(t,r),t}function G(t,a){(a==null||a>t.length)&&(a=t.length);for(var r=0,n=new Array(a);r<a;r++)n[r]=t[r];return n}function q(t){if(Array.isArray(t))return G(t)}function ee(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function te(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Q(t,a){if(!!t){if(typeof t=="string")return G(t,a);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return G(t,a)}}function re(t){return q(t)||ee(t)||Q(t)||te()}var oe=I(484);function K(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,i){r.resolve=n,r.reject=i}),t&&(r.promise=(0,oe.Z)(r.promise,a)),r}var se=require("@tweenjs/tween.js"),pe=I.n(se),ve=function(){"use strict";function t(){A(this,t),this.guiParams={}}var a=t.prototype;return a.showGuiParams=function(n){var i=this;!n||Object.keys(this.guiParams).forEach(function(e){var o=n.addFolder(e),u=i.guiParams[e];Object.keys(u).forEach(function(h){var p=u[h],_=p.min,m=p.max,g=p.step,P=p.name,w=p.to,x=p.paramMap,v=p.items,F=p.value,E=p.target,ge=h.toLowerCase().indexOf("color")>-1,j,ce=typeof F=="undefined"&&E,fe=ce?E():u[h],he=ce?h:"value";v?j=o.add(fe,he,v):ge?j=o.addColor(fe,he):j=o.add(fe,he),j=j.name(P||h),typeof _!="undefined"&&(j=j.min(_)),typeof m!="undefined"&&(j=j.max(m)),typeof g!="undefined"&&(j=j.step(g)),j=j.onChange(function(){i.setGuiTargetValue(e,h,fe[he],x)}),(w||ce)&&j.listen()})})},a.setGuiTargetValue=function(n,i,e,o){var u=this.guiParams[n][i],h=u.onChange,p=u.target,_=u.value,m=i.toLowerCase().indexOf("color")>-1,g=typeof _=="undefined"&&p;if(p&&!g){var P=p();Array.isArray(P)||(P=[P]),P.forEach(function(w){if(!!w)if(m)try{w[o||i].set(e)}catch(x){i!=="color"&&!o&&console.warn("".concat(i," is not a color,set paramMap"))}else w[o||i]=e})}h&&h(e)},a.setGuiTargetValueByParams=function(){var n=this;Object.keys(this.guiParams).forEach(function(i){Object.keys(n.guiParams[i]).forEach(function(e){var o=n.guiParams[i][e];typeof o.value!="undefined"&&n.setGuiTargetValue(i,e,o.value,o.paramMap)})})},a.guiParamTween=function(n,i,e){var o=e.duration,u=o===void 0?0:o,h=this,p=this.guiParams[n][i],_=p.to,m=p.paramMap,g=m===void 0?"":m;return new(pe()).Tween(this.guiParams[n][i]).to({value:_},u).onUpdate(function(P){h.setGuiTargetValue(n,i,P.value,g)})},t}(),de=require("three/examples/jsm/renderers/CSS2DRenderer"),le=require("three/examples/jsm/renderers/CSS3DRenderer"),ye=I(519),l=function(t){"use strict";L(r,t);var a=B(r);function r(i){A(this,r);var e;return e=a.call(this),e.objecttype__="BaseObject",e.isAdd=!1,e.userData={},e.pm=K(),e.visible=!1,e}var n=r.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(e,o){},n.resize=function(e,o){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];return this.object3d=z(c.Mesh,re(o)),this},n.createGroup=function(){return this.object3d=new c.Group,this},n.createPoints=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];return this.object3d=z(c.Points,re(o)),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.createSprite=function(e){return this.object3d=new c.Sprite(e),this},n.add=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];var h;return(h=this.object3d).add.apply(h,re(o)),this},n.remove=function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];var h;return(h=this.object3d).remove.apply(h,re(o)),this},n.getSize=function(){var e=new 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(o){o.traverse(e)})},n.dispose=function(){var e;(e=this.object3d)===null||e===void 0||e.traverse(function(o){(0,ye.disposeMesh)(o)})},D(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";L(r,t);var a=B(r);function r(i){A(this,r);var e;return e=a.call(this),e.width=0,e.options=(0,M.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},i),e}var n=r.prototype;return n.init=function(){var e=document.createElement("canvas");this.canvas=e},n.create=function(){var e=this.options,o=e.position,u=e.lookAt,h=e.sprite,p=e.text,_=e.sizeAttenuation;if(h){var m=new c.Sprite(new c.SpriteMaterial({transparent:!0,sizeAttenuation:_}));this.object3d=m}else{var g=new c.MeshBasicMaterial({side:c.DoubleSide,transparent:!0}),P=new c.PlaneGeometry(1,1,1,1);this.createMesh(P,g)}this.object3d.position.copy(o),u&&this.object3d.lookAt(u),this.setText(p)},n.setText=function(e,o){var u=(0,M.Z)(S((0,M.Z)({},this.options),{text:e}),o||{}),h=u.text,p=u.fontSize,_=u.fontFamily,m=u.fontWeight,g=u.flipX,P=u.scale,w=this.canvas;w.width=p*h.length*2,w.height=p;var x=w.getContext("2d");x.font="".concat(m," ").concat(p,"px/1 ").concat(_);var v=x.measureText(h).width;w.width=v,this.width=v,x=w.getContext("2d"),x.clearRect(0,0,w.width,w.height),g&&x.scale(-1,1),x.font="".concat(m," ").concat(p,"px/1 ").concat(_),x.textBaseline="middle",x.fillStyle="#ffffff",x.fillText(h,g?v*-1:0,w.height/2),x.restore();var F=new c.Texture(w);F.anisotropy=16,F.needsUpdate=!0;var E=this.object3d;E.material.map&&E.material.map.dispose(),E.material.map=F,E.material.needsUpdate=!0,E.scale.set(F.image.width*P,F.image.height*P,1)},r}(l),f=I(568),y=I(666),d=I.n(y),V=function(t){"use strict";L(r,t);var a=B(r);function r(i){A(this,r);var e;return e=a.call(this),e.options=i,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,f.Z)(d().mark(function o(){var u,h,p,_,m,g,P,w,x,v;return d().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return u=e.options,h=u.transparent,p=u.blending,_=u.src,m=u.depthWrite,g=u.alphaTest,P=u.sprite,w=u.sizeAttenuation,E.next=3,new c.TextureLoader().loadAsync(_);case 3:return x=E.sent,v=P?new c.SpriteMaterial({map:x,transparent:h!=null?h:!1,blending:p!=null?p:c.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0,sizeAttenuation:w!=null?w:!0}):new c.MeshBasicMaterial({map:x,transparent:h!=null?h:!1,blending:p!=null?p:c.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0}),E.abrupt("return",v);case 6:case"end":return E.stop()}},o)}))()},n.create=function(){var e=this;return(0,f.Z)(d().mark(function o(){var u,h,p,_,m,g,P,w;return d().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(u=e.options,h=u.scale,p=u.position,_=u.src,m=u.cache,g=u.sprite,!(m&&!m.get(_))){v.next=7;break}return m.init(_),v.next=5,e.getMaterial();case 5:P=v.sent,m.set(_,P);case 7:if(!m){v.next=13;break}return v.next=10,m.get(_);case 10:v.t0=v.sent,v.next=16;break;case 13:return v.next=15,e.getMaterial();case 15:v.t0=v.sent;case 16:w=v.t0,e.texture=w.map,g?e.createSprite(w):e.createMesh(new c.PlaneBufferGeometry(1,1),w),h&&e.object3d.scale.set(w.map.image.width*h,w.map.image.height*h,1),p&&e.object3d.position.copy(p);case 21:case"end":return v.stop()}},o)}))()},r}(l);function X(t,a){for(;!Object.prototype.hasOwnProperty.call(t,a)&&(t=W(t),t!==null););return t}function N(t,a,r){return typeof Reflect!="undefined"&&Reflect.get?N=Reflect.get:N=function(i,e,o){var u=X(i,e);if(!!u){var h=Object.getOwnPropertyDescriptor(u,e);return h.get?h.get.call(o||i):h.value}},N(t,a,r)}function J(t,a,r){return N(t,a,r)}var Y=function(t){"use strict";L(r,t);var a=B(r);function r(i){A(this,r);var e;return e=a.call(this),e.options=(0,M.Z)({},{autoPlay:!0,loop:!0},i),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,u=e.transparent,h=e.blending,p=e.depthWrite,_=e.format,m=e.autoPlay,g=e.loop,P=e.alphaTest,w=e.sprite,x=K(),v=document.createElement("video");return v.addEventListener("loadedmetadata",function(){var F=new c.VideoTexture(v);F.format=_!=null?_:c.RGBAFormat,F.needsUpdate=!0;var E=w?new c.SpriteMaterial({map:F,transparent:u!=null?u:!1,blending:h!=null?h:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:P!=null?P:0}):new c.MeshBasicMaterial({map:F,transparent:u!=null?u:!1,blending:h!=null?h:c.NormalBlending,depthWrite:p!=null?p:!0,alphaTest:P!=null?P:0});x.resolve(E)},!1),v.src=o,v.muted=!0,v.autoplay=m,v.loop=g,v.preload="auto",x.promise},n.create=function(){var e=this;return(0,f.Z)(d().mark(function o(){var u,h,p,_,m,g,P,w;return d().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(u=e.options,h=u.scale,p=u.position,_=u.src,m=u.cache,g=u.sprite,!(m&&!m.get(_))){v.next=7;break}return m.init(_),v.next=5,e.getMaterial();case 5:P=v.sent,m.set(_,P);case 7:if(!m){v.next=13;break}return v.next=10,m.get(_);case 10:v.t0=v.sent,v.next=16;break;case 13:return v.next=15,e.getMaterial();case 15:v.t0=v.sent;case 16:w=v.t0,e.video=w.map.image,g?e.createSprite(w):e.createMesh(new c.PlaneBufferGeometry(1,1),w),h&&e.object3d.scale.set(e.video.videoWidth*h,e.video.videoHeight*h,1),p&&e.object3d.position.copy(p);case 21:case"end":return v.stop()}},o)}))()},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),J(W(r.prototype),"dispose",this).call(this)},r}(l),me=function(t){"use strict";L(r,t);var a=B(r);function r(i){A(this,r);var e;return e=a.call(this),e.options=(0,M.Z)({},i),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,u=e.children,h=document.createElement("div");h.appendChild(u),this.createCSS2DObject(h),o&&this.object3d.position.copy(o)},n.getMaterial=function(e){return(0,f.Z)(d().mark(function o(){var u,h,p,_;return d().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return u=document.createElement("canvas"),u.width=256,u.height=256,h=u.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),p=new c.CanvasTexture(u),_=new c.SpriteMaterial({map:p,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",_);case 9:case"end":return g.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,u=o===void 0?!1:o,h=e.scale,p=h===void 0?new c.Vector3(1,1,1):h,_=e.position,m=_===void 0?new c.Vector3(0,0,0):_,g=e.cache,P=this;return(0,f.Z)(d().mark(function w(){var x,v,F,E;return d().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:if(x="node-create-pick-object",!(g&&!g.get(x))){j.next=7;break}return g.init(x),j.next=5,P.getMaterial(u);case 5:v=j.sent,g.set(x,v);case 7:if(!g){j.next=13;break}return j.next=10,g.get(x);case 10:j.t0=j.sent,j.next=16;break;case 13:return j.next=15,P.getMaterial(u);case 15:j.t0=j.sent;case 16:F=j.t0,E=new c.Sprite(F),E.scale.set(F.map.image.width*p.x,F.map.image.height*p.y,1),E.position.copy(m),P.add(E),P.pickObject=E;case 22:case"end":return j.stop()}},w)}))()},r}(l),ue=me,ae=`
|
|
2
2
|
`.concat(c.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
3
|
`).concat(c.ShaderChunk.fog_pars_vertex,`
|
|
4
4
|
attribute vec3 previous;
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
96
96
|
`).concat(c.ShaderChunk.fog_vertex,`
|
|
97
97
|
}
|
|
98
|
-
`),
|
|
98
|
+
`),xe=`
|
|
99
99
|
`.concat(c.ShaderChunk.fog_pars_fragment,`
|
|
100
100
|
`).concat(c.ShaderChunk.logdepthbuf_pars_fragment,`
|
|
101
101
|
|
|
@@ -129,4 +129,4 @@ void main() {
|
|
|
129
129
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
130
130
|
`).concat(c.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,d=this instanceof c.LineSegments?2:1,y=a.index,P=a.attributes;if(y!==null)for(var g=y.array,w=P.position.array,x=P.width.array,h=0,K=g.length-1;h<K;h+=d){var ne=g[h],xe=g[h+1];u.fromArray(w,ne*3),p.fromArray(w,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,d=e.setPointWidth,y=ke(e,["nodes","duration","delay","onComplete","setPointWidth"]),P=this.pencil.getSize(),g=P.width,w=P.height;delete y.key,this.geometry.setFromPoints(a),this.meshline.setGeometry(this.geometry,d);var x=new we(S((0,M.Z)({},y),{resolution:new c.Vector2(g,w)}));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,d=new(pe()).Tween(v.value).to({x:0},a!=null?a:1e3).delay(u!=null?u:0).repeat(1/0);p&&d.onComplete(p),d.start(),this.tween=d},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,d=new c.Sprite(new c.SpriteMaterial({map:Pe,opacity:u?1:0,transparent:!0,alphaTest:.1}));d.scale.set(Pe.image.width*v.x,Pe.image.height*v.y,1),this.add(d),this.pickObject=d},r}(l),ze={Css2dBind:Ce}})(),module.exports=be})();
|
|
132
|
+
`),ne=function(t){"use strict";L(r,t);var a=B(r);function r(){A(this,r);var n;return n=a.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new c.Matrix4,Object.defineProperties(k(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);ne.prototype.setMatrixWorld=function(t){this.matrixWorld=t},ne.prototype.setGeometry=function(t,a){this._geometry=t,this.setPoints(t.getAttribute("position").array,a)},ne.prototype.setPoints=function(t,a){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=a,this.positions=[],this.counters=[],t.length&&t[0]instanceof 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 Ae(t,a){var r=new c.Matrix4,n=new c.Ray,i=new c.Sphere,e=new c.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),i.copy(o.boundingSphere),i.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(i,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var u=new c.Vector3,h=new c.Vector3,p=new c.Vector3,_=this instanceof c.LineSegments?2:1,m=o.index,g=o.attributes;if(m!==null)for(var P=m.array,w=g.position.array,x=g.width.array,v=0,F=P.length-1;v<F;v+=_){var E=P[v],ge=P[v+1];u.fromArray(w,E*3),h.fromArray(w,ge*3);var j=x[Math.floor(v/3)]!==void 0?x[Math.floor(v/3)]:1,ce=t.params.Line.threshold+this.material.lineWidth*j/2,fe=ce*ce,he=n.distanceSqToSegment(u,h,e,p);if(!(he>fe)){e.applyMatrix4(this.matrixWorld);var Pe=t.ray.origin.distanceTo(e);Pe<t.near||Pe>t.far||(a.push({distance:Pe,point:p.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}),v=F)}}}}ne.prototype.raycast=Ae,ne.prototype.compareV3=function(t,a){var r=t*6,n=a*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},ne.prototype.copyV3=function(t){var a=t*6;return[this.positions[a],this.positions[a+1],this.positions[a+2]]},ne.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var a,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?a=this.widthCallback(n/(t-1)):a=1,this.width.push(a),this.width.push(a),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var i=n*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new 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,a,r,n,i){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=a?t.subarray?t.subarray(a,i&&a+i):t.slice(a,i&&a+i):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}ne.prototype.advance=function(t){var a=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,i=a.length;_e(a,0,r,0,i),_e(a,6,a,0,i-6),a[i-6]=t.x,a[i-5]=t.y,a[i-4]=t.z,a[i-3]=t.x,a[i-2]=t.y,a[i-1]=t.z,_e(a,6,n,0,i-6),n[i-6]=t.x,n[i-5]=t.y,n[i-4]=t.z,n[i-3]=t.x,n[i-2]=t.y,n[i-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},c.ShaderChunk.meshline_vert=ae,c.ShaderChunk.meshline_frag=xe;var we=function(t){"use strict";L(r,t);var a=B(r);function r(n){A(this,r);var i;return i=a.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(k(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}(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 Oe(t,a){if(t==null)return{};var r={},n=Object.keys(t),i,e;for(e=0;e<n.length;e++)i=n[e],!(a.indexOf(i)>=0)&&(r[i]=t[i]);return r}function Ce(t,a){if(t==null)return{};var r=Oe(t,a),n,i;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(i=0;i<e.length;i++)n=e[i],!(a.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var je={nodes:[],color:new c.Color("red"),lineWidth:3,sizeAttenuation:0},Te=function(t){"use strict";L(r,t);var a=B(r);function r(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,r);var e;return e=a.call(this),e.geometry=new c.BufferGeometry,e.meshline=new ne,e.options=(0,M.Z)({},je,i),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.nodes,u=e.duration,h=e.delay,p=e.onComplete,_=e.setPointWidth,m=Ce(e,["nodes","duration","delay","onComplete","setPointWidth"]),g=this.pencil.getSize(),P=g.width,w=g.height;delete m.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,_);var x=new we(S((0,M.Z)({},m),{resolution:new c.Vector2(P,w)}));this.material=x,this.createMesh(this.meshline,x)},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,u=e.delay,h=e.onComplete,p=this.material.uniforms.offset,_=new(pe()).Tween(p.value).to({x:0},o!=null?o:1e3).delay(u!=null?u:0).repeat(1/0);h&&_.onComplete(h),_.start(),this.tween=_},n.dispose=function(){this.tween&&pe().remove(this.tween)},r}(l),ke=Te})(),module.exports=be})();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import BaseObject from '../../core/BaseObject';
|
|
3
|
+
import Cache from '../../plugins/Cache';
|
|
4
|
+
interface Options {
|
|
5
|
+
children: HTMLElement;
|
|
6
|
+
position?: THREE.Vector3;
|
|
7
|
+
}
|
|
8
|
+
export declare class Node extends BaseObject {
|
|
9
|
+
options: Options;
|
|
10
|
+
pickObject?: THREE.Sprite;
|
|
11
|
+
constructor(options: Options);
|
|
12
|
+
create(): void;
|
|
13
|
+
getMaterial(show: boolean): Promise<THREE.SpriteMaterial>;
|
|
14
|
+
createPickObject({ show, scale, position, cache, }: {
|
|
15
|
+
show?: boolean;
|
|
16
|
+
scale?: THREE.Vector3;
|
|
17
|
+
position?: THREE.Vector3;
|
|
18
|
+
cache?: Cache;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
export default Node;
|
package/package.json
CHANGED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import BaseObject from '../../core/BaseObject';
|
|
3
|
-
interface Options {
|
|
4
|
-
position: THREE.Vector3;
|
|
5
|
-
key?: string;
|
|
6
|
-
children?: HTMLElement;
|
|
7
|
-
}
|
|
8
|
-
export declare class Css2dBind extends BaseObject {
|
|
9
|
-
options: Options;
|
|
10
|
-
pickObject?: THREE.Sprite;
|
|
11
|
-
constructor(options: Partial<Options>);
|
|
12
|
-
create(): void;
|
|
13
|
-
createPickObject({ show, scale }: {
|
|
14
|
-
show?: boolean | undefined;
|
|
15
|
-
scale?: THREE.Vector3 | undefined;
|
|
16
|
-
}): void;
|
|
17
|
-
}
|
|
18
|
-
declare const _default: {
|
|
19
|
-
Css2dBind: typeof Css2dBind;
|
|
20
|
-
};
|
|
21
|
-
export default _default;
|
|
@@ -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 {};
|