mx3d 0.0.14 → 0.0.15

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.
@@ -1,4 +1,4 @@
1
- !function(e,i){"object"==typeof exports&&"object"==typeof module?module.exports=i(require("h337")):"function"==typeof define&&define.amd?define(["h337"],i):"object"==typeof exports?exports.Dazzle=i(require("h337")):e.Dazzle=i(e.h337)}(window,function(t){return n=[function(e,i){e.exports=t},function(e,i,t){"use strict";t.r(i);var n={};t.r(n),t.d(n,"SceneLoader",function(){return h}),t.d(n,"Global",function(){return a}),t.d(n,"Builder",function(){return o}),t.d(n,"IconFromMesh",function(){return l}),t.d(n,"Icon",function(){return c}),t.d(n,"GUID",function(){return r}),t.d(n,"HeatMap",function(){return u}),t.d(n,"Capacity",function(){return s});class r{static getGUID(e){var i,t,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),s=[],o=n.length;if(e)for(i=0;i<e;i++)s[i]=n[0|Math.random()*o];else for(s[8]=s[13]=s[18]=s[23]="-",s[14]="4",i=0;i<36;i++)s[i]||(t=0|16*Math.random(),s[i]=n[19==i?3&t|8:t]);return s.join("")}}class u{constructor(e){this.anchor=e,this.id=r.getGUID(12),this.texts=new Array}isEnabled(e){}set displayValues(i){this.texts.forEach(e=>e.isVisible=i)}dispose(){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.mesh&&this.mesh.dispose();for(let e=0;e<this.texts.length;e++)this.texts[e].linkedMesh&&this.texts[e].linkedMesh.dispose(),this.texts[e].dispose();this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}var m=t(0);class s{constructor(e,i){this.anchor=e,this.ratio=i}dispose(){this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.mesh&&this.mesh.dispose(),this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class o{static createMatrixHeatMap(s){s.displayValues=null==s.displayValues||s.displayValues,s.isAlpha=null==s.isAlpha||s.isAlpha,s.isParticle=null==s.isParticle||s.isParticle,s.height=s.height||.5,s.radius=s.radius||2.8,s.isLevelRender=null==s.isLevelRender||s.isLevelRender,s.range=s.range||{max:30,min:16};let o;if(!(s.config||s.config.maxX||s.config.maxY||s.config.data||s.anchor))return o;s.anchor._scene.blockfreeActiveMeshesAndRenderingGroups=!0,o=new u(s.anchor.id);var r=s.anchor.getBoundingInfo();o.mesh=s.anchor.clone(o.id),o.mesh.position.y+=s.height;var a=r.maximum.x-r.minimum.x,c=a/(2*s.config.maxX),l=r.maximum.z-r.minimum.z,h=l/(2*s.config.maxY);let e=new Array;for(let n=0;n<2*s.config.maxX;n++)for(let t=0;t<2*s.config.maxY;t++){let i={x:n,y:t,value:s.range.min};for(let e=0;e<s.config.data.length;e++){var d=s.config.data[e];2*d.x+1==n&&2*d.y+1==t&&(i.value=d.value,d=new BABYLON.Vector3(r.boundingSphere.center.x-(a/2-c*n),o.mesh.position.y,r.boundingSphere.center.z-(l/2-h*t)),o.texts.push(this.createTempVlaue(i.value+"℃",d,s.anchor._scene,s.container)))}e.push(i)}o.displayValues=s.displayValues;let i=m.create({width:2*s.config.maxX,height:2*s.config.maxY,radius:s.radius});i.setData({min:s.range.min,max:s.range.max,data:e});let t=new BABYLON.StandardMaterial(o.id,s.anchor._scene);return t.diffuseTexture=new BABYLON.Texture(i.getDataURL(),s.anchor._scene,!1,!1),t.specularColor=new BABYLON.Color3(0,0,0),t.alpha=.5,s.isAlpha&&(t.diffuseTexture.hasAlpha=!0),s.isParticle&&(this._getMatrixParticleTex(s.rootUrl,s.FogTex,t.diffuseTexture,o.mesh,s.anchor._scene,s.isLevelRender),o.mesh.isVisible=!1),s.isLevelRender&&(o.mesh.renderingGroupId=1),o.mesh.material=t,o.mesh.alwaysSelectAsActiveMesh=!0,o.mesh.freezeWorldMatrix(),s.anchor._scene.blockfreeActiveMeshesAndRenderingGroups=!1,o}static _getMatrixParticleTex(e,i,t,n,s,o){let r;let a=i.clone(),c=n.getBoundingInfo().boundingBox;var l=(c.extendSizeWorld.x+c.extendSizeWorld.z)/9,h=1500*l*l,d=c.minimumWorld.subtract(new BABYLON.Vector3(-0,0,-0)),i=c.maximumWorld.subtract(new BABYLON.Vector3(0,0,0));r&&r.dispose(),r=new BABYLON.ParticleSystem("particles",h,s),r.manualEmitCount=r.getCapacity(),r.minEmitBox=d,r.maxEmitBox=i,r.particleTexture=a,r.emitter=n,o&&(r.renderingGroupId=1),r.isLocal=!0;let u=new BABYLON.NodeMaterial("nm_heatmapBox_"+n.id,s);u.loadAsync(e+"resources/horizontalNodeMat.json").then(()=>{u.build(!1),u.getBlockByName("boxTex").texture=t,u.getBlockByName("emitXMin").value=r.minEmitBox.x,u.getBlockByName("emitXMax").value=r.maxEmitBox.x,u.getBlockByName("emitYMin").value=r.minEmitBox.z,u.getBlockByName("emitYMax").value=r.maxEmitBox.z,u.createEffectForParticles(r)}),n.onDispose=()=>{r&&r.dispose()},r.onDispose=()=>{u&&u.dispose(),a&&a.dispose()},r.color1=new BABYLON.Color4(.8,.8,.8,.1),r.color2=new BABYLON.Color4(.95,.95,.95,.15),r.colorDead=new BABYLON.Color4(.9,.9,.9,.1),r.minSize=1.4,r.maxSize=2,r.minLifeTime=Number.MAX_SAFE_INTEGER,r.emitRate=5e4*l,r.blendMode=BABYLON.ParticleSystem.BLENDMODE_STANDARD,r.gravity=new BABYLON.Vector3(0,0,0),r.direction1=new BABYLON.Vector3(0,0,0),r.direction2=new BABYLON.Vector3(0,0,0),r.minAngularSpeed=-2,r.maxAngularSpeed=2,r.minEmitPower=.5,r.maxEmitPower=1,r.updateSpeed=.005,r.start()}static createColumnarHeatMap(s){if(s.displayValues=null==s.displayValues||s.displayValues,s.isAlpha=null==s.isAlpha||s.isAlpha,s.isParticle=null==s.isParticle||s.isParticle,s.radius=s.radius||4,s.isLevelRender=null==s.isLevelRender||s.isLevelRender,s.range=s.range||{max:30,min:16},!s.config&&s.config.length<1&&!s.anchor)return null;let i;s.anchor._scene.blockfreeActiveMeshesAndRenderingGroups=!0,i=new u(s.anchor.id),i.scene=s.anchor._scene;var t=.98*s.anchor.scaling.y;i.mesh=BABYLON.MeshBuilder.CreatePlane(i.id,{width:.98*s.anchor.scaling.x,height:t,sideOrientation:2},s.anchor._scene),i.mesh.alwaysSelectAsActiveMesh=!0,i.mesh.enablePointerMoveEvents=!1,i.mesh.position=s.anchor.position.clone(),i.mesh.rotation.z=Math.PI,i.mesh.rotation.y=s.anchor.rotation.y,s.isLevelRender&&(i.mesh.renderingGroupId=1);let e=[];for(let n=0;n<4;n++)for(let t=0;t<3*s.config.length;t++){let i={x:n,y:t,value:s.range.min};for(let e=0;e<s.config.length;e++){var o=s.config[e];2==n&&3*e+2==t&&(i.value=o.value)}e.push(i)}var n=t/s.config.length;for(let e=0;e<s.config.length;e++){var r=new BABYLON.Vector3(i.mesh.position.x,t-n*e-n/2,i.mesh.position.z);i.texts.push(this.createTempVlaue(s.config[e].value+"℃",r,s.anchor._scene,s.container))}i.displayValues=s.displayValues;let a=m.create({width:4,height:3*s.config.length,radius:s.radius});a.setData({min:s.range.min,max:s.range.max,data:e});let c=new BABYLON.StandardMaterial(i.id,s.anchor._scene);return c.diffuseTexture=new BABYLON.Texture(a.getDataURL(),s.anchor._scene,!1,!1),c.specularColor=new BABYLON.Color3(0,0,0),c.alpha=.5,s.isAlpha&&(c.diffuseTexture.hasAlpha=!0),i.mesh.material=c,s.anchor._scene.blockfreeActiveMeshesAndRenderingGroups=!1,i}static _getColumnarParticleTex(e,i,t,n,s){let o;let r=n.clone();n=i.getBoundingInfo().boundingBox,n.extendSizeWorld.x,n.extendSizeWorld.z;BABYLON.Effect.ShadersStore.particlesVertexShader=`
1
+ !function(e,i){"object"==typeof exports&&"object"==typeof module?module.exports=i(require("h337")):"function"==typeof define&&define.amd?define(["h337"],i):"object"==typeof exports?exports.Dazzle=i(require("h337")):e.Dazzle=i(e.h337)}(window,function(t){return n=[function(e,i){e.exports=t},function(e,i,t){"use strict";t.r(i);var n={};t.r(n),t.d(n,"SceneLoader",function(){return h}),t.d(n,"Global",function(){return o}),t.d(n,"Builder",function(){return s}),t.d(n,"IconFromMesh",function(){return l}),t.d(n,"Icon",function(){return a}),t.d(n,"GUID",function(){return r}),t.d(n,"HeatMap",function(){return u}),t.d(n,"Capacity",function(){return c});class r{static getGUID(e){var i,t,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),s=[],o=n.length;if(e)for(i=0;i<e;i++)s[i]=n[0|Math.random()*o];else for(s[8]=s[13]=s[18]=s[23]="-",s[14]="4",i=0;i<36;i++)s[i]||(t=0|16*Math.random(),s[i]=n[19==i?3&t|8:t]);return s.join("")}}class u{constructor(e){this.anchor=e,this.id=r.getGUID(12),this.texts=new Array}isEnabled(e){}set displayValues(i){this.texts.forEach(e=>e.isVisible=i)}dispose(){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.mesh&&this.mesh.dispose();for(let e=0;e<this.texts.length;e++)this.texts[e].linkedMesh&&this.texts[e].linkedMesh.dispose(),this.texts[e].dispose();this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}var m=t(0);class c{constructor(e,i){this.anchor=e,this.ratio=i}dispose(){this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.mesh&&this.mesh.dispose(),this.textMesh&&this.textMesh.dispose(),this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class s{static createMatrixHeatMap(s){s.displayValues=null==s.displayValues||s.displayValues,s.isAlpha=null==s.isAlpha||s.isAlpha,s.isParticle=null==s.isParticle||s.isParticle,s.height=s.height||.5,s.radius=s.radius||2.8,s.isLevelRender=null==s.isLevelRender||s.isLevelRender,s.range=s.range||{max:30,min:16};let o;if(!(s.config||s.config.maxX||s.config.maxY||s.config.data||s.anchor))return o;s.anchor._scene.blockfreeActiveMeshesAndRenderingGroups=!0,o=new u(s.anchor.id);var r=s.anchor.getBoundingInfo();o.mesh=s.anchor.clone(o.id),o.mesh.position.y+=s.height;var a=r.maximum.x-r.minimum.x,c=a/(2*s.config.maxX),l=r.maximum.z-r.minimum.z,h=l/(2*s.config.maxY);let e=new Array;for(let n=0;n<2*s.config.maxX;n++)for(let t=0;t<2*s.config.maxY;t++){let i={x:n,y:t,value:s.range.min};for(let e=0;e<s.config.data.length;e++){var d=s.config.data[e];2*d.x+1==n&&2*d.y+1==t&&(i.value=d.value,d=new BABYLON.Vector3(r.boundingSphere.center.x-(a/2-c*n),o.mesh.position.y,r.boundingSphere.center.z-(l/2-h*t)),o.texts.push(this.createTempVlaue(i.value+"℃",d,s.anchor._scene,s.container)))}e.push(i)}o.displayValues=s.displayValues;let i=m.create({width:2*s.config.maxX,height:2*s.config.maxY,radius:s.radius});i.setData({min:s.range.min,max:s.range.max,data:e});let t=new BABYLON.StandardMaterial(o.id,s.anchor._scene);return t.diffuseTexture=new BABYLON.Texture(i.getDataURL(),s.anchor._scene,!1,!1),t.specularColor=new BABYLON.Color3(0,0,0),t.alpha=.5,s.isAlpha&&(t.diffuseTexture.hasAlpha=!0),s.isParticle&&(this._getMatrixParticleTex(s.rootUrl,s.FogTex,t.diffuseTexture,o.mesh,s.anchor._scene,s.isLevelRender),o.mesh.isVisible=!1),s.isLevelRender&&(o.mesh.renderingGroupId=1),o.mesh.material=t,o.mesh.alwaysSelectAsActiveMesh=!0,o.mesh.freezeWorldMatrix(),s.anchor._scene.blockfreeActiveMeshesAndRenderingGroups=!1,o}static _getMatrixParticleTex(e,i,t,n,s,o){let r;let a=i.clone(),c=n.getBoundingInfo().boundingBox;var l=(c.extendSizeWorld.x+c.extendSizeWorld.z)/9,h=1500*l*l,d=c.minimumWorld.subtract(new BABYLON.Vector3(-0,0,-0)),i=c.maximumWorld.subtract(new BABYLON.Vector3(0,0,0));r&&r.dispose(),r=new BABYLON.ParticleSystem("particles",h,s),r.manualEmitCount=r.getCapacity(),r.minEmitBox=d,r.maxEmitBox=i,r.particleTexture=a,r.emitter=n,o&&(r.renderingGroupId=1),r.isLocal=!0;let u=new BABYLON.NodeMaterial("nm_heatmapBox_"+n.id,s);u.loadAsync(e+"resources/horizontalNodeMat.json").then(()=>{u.build(!1),u.getBlockByName("boxTex").texture=t,u.getBlockByName("emitXMin").value=r.minEmitBox.x,u.getBlockByName("emitXMax").value=r.maxEmitBox.x,u.getBlockByName("emitYMin").value=r.minEmitBox.z,u.getBlockByName("emitYMax").value=r.maxEmitBox.z,u.createEffectForParticles(r)}),n.onDispose=()=>{r&&r.dispose()},r.onDispose=()=>{u&&u.dispose(),a&&a.dispose()},r.color1=new BABYLON.Color4(.8,.8,.8,.1),r.color2=new BABYLON.Color4(.95,.95,.95,.15),r.colorDead=new BABYLON.Color4(.9,.9,.9,.1),r.minSize=1.4,r.maxSize=2,r.minLifeTime=Number.MAX_SAFE_INTEGER,r.emitRate=5e4*l,r.blendMode=BABYLON.ParticleSystem.BLENDMODE_STANDARD,r.gravity=new BABYLON.Vector3(0,0,0),r.direction1=new BABYLON.Vector3(0,0,0),r.direction2=new BABYLON.Vector3(0,0,0),r.minAngularSpeed=-2,r.maxAngularSpeed=2,r.minEmitPower=.5,r.maxEmitPower=1,r.updateSpeed=.005,r.start()}static createColumnarHeatMap(s){if(s.displayValues=null==s.displayValues||s.displayValues,s.isAlpha=null==s.isAlpha||s.isAlpha,s.isParticle=null==s.isParticle||s.isParticle,s.radius=s.radius||4,s.isLevelRender=null==s.isLevelRender||s.isLevelRender,s.range=s.range||{max:30,min:16},!s.config&&s.config.length<1&&!s.anchor)return null;let i;s.anchor._scene.blockfreeActiveMeshesAndRenderingGroups=!0,i=new u(s.anchor.id),i.scene=s.anchor._scene;var t=.98*s.anchor.scaling.y;i.mesh=BABYLON.MeshBuilder.CreatePlane(i.id,{width:.98*s.anchor.scaling.x,height:t,sideOrientation:2},s.anchor._scene),i.mesh.alwaysSelectAsActiveMesh=!0,i.mesh.enablePointerMoveEvents=!1,i.mesh.position=s.anchor.position.clone(),i.mesh.rotation.z=Math.PI,i.mesh.rotation.y=s.anchor.rotation.y,s.isLevelRender&&(i.mesh.renderingGroupId=1);let e=[];for(let n=0;n<4;n++)for(let t=0;t<3*s.config.length;t++){let i={x:n,y:t,value:s.range.min};for(let e=0;e<s.config.length;e++){var o=s.config[e];2==n&&3*e+2==t&&(i.value=o.value)}e.push(i)}var n=t/s.config.length;for(let e=0;e<s.config.length;e++){var r=new BABYLON.Vector3(i.mesh.position.x,t-n*e-n/2,i.mesh.position.z);i.texts.push(this.createTempVlaue(s.config[e].value+"℃",r,s.anchor._scene,s.container))}i.displayValues=s.displayValues;let a=m.create({width:4,height:3*s.config.length,radius:s.radius});a.setData({min:s.range.min,max:s.range.max,data:e});let c=new BABYLON.StandardMaterial(i.id,s.anchor._scene);return c.diffuseTexture=new BABYLON.Texture(a.getDataURL(),s.anchor._scene,!1,!1),c.specularColor=new BABYLON.Color3(0,0,0),c.alpha=.5,s.isAlpha&&(c.diffuseTexture.hasAlpha=!0),s.isParticle&&(this._getColumnarParticleTex(c.diffuseTexture,i.mesh,s.anchor._scene,s.FogTex,s.isLevelRender),i.mesh.isVisible=!1),i.mesh.material=c,s.anchor._scene.blockfreeActiveMeshesAndRenderingGroups=!1,i}static _getColumnarParticleTex(e,i,t,n,s){let o;let r=n.clone();n=i.getBoundingInfo().boundingBox,n.extendSizeWorld.x,n.extendSizeWorld.z;BABYLON.Effect.ShadersStore.particlesVertexShader=`
2
2
  precision highp float;
3
3
  in vec3 position;
4
4
  in vec4 color;
@@ -82,4 +82,4 @@
82
82
 
83
83
  gl_FragColor = vec4(baseTex.xyz, resAlpha.a);
84
84
  }
85
- `;var a=t.getEngine().createEffectForParticles(i.id+"myParticle",["time","u_emitXMin","u_emitYMin","u_emitXMax","u_emitYMax","emitBox_WorldM"],["boxTexSampler"],"");return i.onAfterWorldMatrixUpdateObservable.add(()=>{a.setMatrix("emitBox_WorldM",i.getWorldMatrix())}),a.onCompileObservable.add(()=>{a.setMatrix("emitBox_WorldM",i.getWorldMatrix()),a.setFloat("u_emitXMin",o.minEmitBox.x),a.setFloat("u_emitYMin",o.minEmitBox.y),a.setFloat("u_emitXMax",o.maxEmitBox.x),a.setFloat("u_emitYMax",o.maxEmitBox.y)}),a.onBind=function(){a.setTexture("boxTexSampler",e)},o&&o.dispose(),o=new BABYLON.ParticleSystem("particles",200,t,a),o.manualEmitCount=o.getCapacity(),o.minEmitBox=n.minimum,o.maxEmitBox=n.maximum,i.onDispose=()=>{o&&o.dispose()},o.onDispose=()=>{r&&r.dispose()},o.particleTexture=r.clone(),o.emitter=i,s&&(o.renderingGroupId=1),o.isLocal=!0,o.color1=new BABYLON.Color4(.8,.8,.8,.1),o.color2=new BABYLON.Color4(.95,.95,.95,.15),o.colorDead=new BABYLON.Color4(.9,.9,.9,.1),o.minSize=.7,o.maxSize=1,o.minLifeTime=Number.MAX_SAFE_INTEGER,o.emitRate=50,o.blendMode=BABYLON.ParticleSystem.BLENDMODE_STANDARD,o.gravity=new BABYLON.Vector3(0,0,0),o.direction1=new BABYLON.Vector3(0,0,0),o.direction2=new BABYLON.Vector3(0,0,0),o.minAngularSpeed=-2,o.maxAngularSpeed=2,o.minEmitPower=.5,o.maxEmitPower=1,o.updateSpeed=.005,o.start(),o}static createTempVlaue(e,i,t,n){let s=new BABYLON.Mesh("temp_"+r.getGUID(12),t);s.position=i;let o=new BABYLON.GUI.TextBlock;return o.isPointerBlocker=!1,o.text="默认提示",o.color="white",o.resizeToFit=!0,o.fontSize=9,o.text=e,n.addControl(o),o.linkWithMesh(s),o}static createCapacity(e,i){let t=new s(e,i);t.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,t.mesh=BABYLON.MeshBuilder.CreateBox("RATIO_"+t.anchor.id,{size:1}),t.mesh.position=t.anchor.instance.position.clone(),console.log(t.mesh.position.y),t.mesh.position.y-=t.mesh.scaling.y/2,t.mesh.scaling=t.anchor.instance.scaling.clone(),t.mesh.scaling.x=.98*t.mesh.scaling.x,t.mesh.scaling.z=.98*t.mesh.scaling.z,t.mesh.rotation=t.anchor.instance.rotation.clone(),t.mesh.alwaysSelectAsActiveMesh=!0,t.mesh.visibility=1,i*=t.mesh.scaling.y;e=new BABYLON.Vector3(0,-.5,0);t.mesh.setPivotPoint(e);let n=new BABYLON.StandardMaterial(t.mesh.id,t.anchor.instance._scene);return n.diffuseColor=BABYLON.Color3.Green(),t.mesh.material=n,BABYLON.Animation.CreateAndStartAnimation(t.mesh.id,t.mesh,"scaling.y",15,30,.02,i,0,null),t.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,t}}class a{}class c{constructor(e){this.textDics=new Array,this.id=e}set background(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this._background&&this._background.dispose(),this._background=new BABYLON.GUI.Image(r.getGUID(12)+"_Image",e),this._background.width=this.size.width+"px",this._background.height=this.size.height+"px",this.rect.addControl(this._background),this.onPointerClick&&(this._background.isPointerBlocker=!1,this._background.onPointerClickObservable.add(()=>{this.onPointerClick()})),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setTexts(t){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.textDics.forEach(e=>e.dispose());for(let i=this.textDics.length=0;i<t.length;i++){let e=new BABYLON.GUI.TextBlock;e.text=t[i].text,e.fontSize=t[i].fontSize||"20px",e.color=t[i].color||"white",e.top=t[i].top||0,e.left=t[i].left||0,this.rect.addControl(e),this.textDics.push(e)}this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}line(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this._line&&this._line.dispose(),this._line=new BABYLON.GUI.Line,this._line.lineWidth=e.width||1.5,this._line.color=e.color||"green",this._line.y2=this.size.height/2,this.container.addControl(this._line),this._line.linkWithMesh(this.pint),this._line.connectedControl=this.rect,this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}dispose(){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.rect&&this.rect.dispose(),this._line&&this._line.dispose(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.rect&&(this.rect.isVisible=e),this._line&&(this._line.isVisible=e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class l{constructor(e,i,t,n,s,o){this.id=e,this.scene=o,this.anchor=i,this.url=t,this.scaling=n,this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance=BABYLON.Mesh.CreatePlane(this.id,n,this.scene,!0,BABYLON.Mesh.DOUBLESIDE),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.position=this.anchor.position.clone();n=this.anchor.getBoundingInfo();this.instance.position.y+=(n.maximum.y-n.minimum.y)/2+s,this.instance.billboardMode=BABYLON.Mesh.BILLBOARDMODE_Y;let r=new BABYLON.StandardMaterial("Mat_"+this.id,this.scene);r.diffuseColor=BABYLON.Color3.White(),r.emissiveColor=BABYLON.Color3.White(),this.instance.material=r,this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setBackground(){let t=new Image;t.src=this.url,t.onload=()=>{this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.scaling.y=this.scaling/(t.width/t.height)/this.scaling;let e=new BABYLON.DynamicTexture(this.id,{width:t.width,height:t.height},this.scene,!1);e.hasAlpha=!0,this.instance.material.diffuseTexture=e;let i=e.getContext();i.drawImage(t,0,0),e.update(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}setColor(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.material.diffuseColor=BABYLON.Color3.FromHexString(e),this.instance.material.emissiveColor=BABYLON.Color3.FromHexString(e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setContents(t){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let n=new Image;n.src=this.url,n.onload=()=>{this.instance.scaling.y=this.scaling/(n.width/n.height)/this.scaling;let i=new BABYLON.DynamicTexture(this.id,{width:n.width,height:n.height},this.scene,!1);i.hasAlpha=!0,this.instance.material.diffuseTexture=i;let e=i.getContext();e.drawImage(n,0,0),t.forEach(e=>i.drawText(e.text,e.left,e.top,"bold "+e.fontSize+" monospace",e.color||"#fffffb","",!0,!0)),i.update(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}dispose(){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.dispose(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class h{static create(e){let i=new a;return i.canvas=document.createElement("canvas"),i.canvas.style.cssText="width: 100%;height: 100%;background-color: transparent;outline-width: 0;",e.appendChild(i.canvas),i.engine=new BABYLON.Engine(i.canvas,!0,{premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0}),i.engine.setHardwareScalingLevel(.5),i.engine.enableOfflineSupport=!1,i.scene=new BABYLON.Scene(i.engine,{useGeometryUniqueIdsMap:!0,useClonedMeshMap:!0,useMaterialMeshMap:!0}),i.scene.useRightHandedSystem=!0,i.scene.getBoundingBoxRenderer().frontColor=BABYLON.Color3.Green(),i.scene.getBoundingBoxRenderer().showBackLines=!1,i}static load(){}}i.default=n}],o={},s.m=n,s.c=o,s.d=function(e,i,t){s.o(e,i)||Object.defineProperty(e,i,{enumerable:!0,get:t})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(i,e){if(1&e&&(i=s(i)),8&e)return i;if(4&e&&"object"==typeof i&&i&&i.__esModule)return i;var t=Object.create(null);if(s.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:i}),2&e&&"string"!=typeof i)for(var n in i)s.d(t,n,function(e){return i[e]}.bind(null,n));return t},s.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(i,"a",i),i},s.o=function(e,i){return Object.prototype.hasOwnProperty.call(e,i)},s.p="",s(s.s=1).default;function s(e){if(o[e])return o[e].exports;var i=o[e]={i:e,l:!1,exports:{}};return n[e].call(i.exports,i,i.exports,s),i.l=!0,i.exports}var n,o});
85
+ `;var a=t.getEngine().createEffectForParticles(i.id+"myParticle",["time","u_emitXMin","u_emitYMin","u_emitXMax","u_emitYMax","emitBox_WorldM"],["boxTexSampler"],"");return i.onAfterWorldMatrixUpdateObservable.add(()=>{a.setMatrix("emitBox_WorldM",i.getWorldMatrix())}),a.onCompileObservable.add(()=>{a.setMatrix("emitBox_WorldM",i.getWorldMatrix()),a.setFloat("u_emitXMin",o.minEmitBox.x),a.setFloat("u_emitYMin",o.minEmitBox.y),a.setFloat("u_emitXMax",o.maxEmitBox.x),a.setFloat("u_emitYMax",o.maxEmitBox.y)}),a.onBind=function(){a.setTexture("boxTexSampler",e)},o&&o.dispose(),o=new BABYLON.ParticleSystem("particles",200,t,a),o.manualEmitCount=o.getCapacity(),o.minEmitBox=n.minimum,o.maxEmitBox=n.maximum,i.onDispose=()=>{o&&o.dispose()},o.onDispose=()=>{r&&r.dispose()},o.particleTexture=r.clone(),o.emitter=i,s&&(o.renderingGroupId=1),o.isLocal=!0,o.color1=new BABYLON.Color4(.8,.8,.8,.1),o.color2=new BABYLON.Color4(.95,.95,.95,.15),o.colorDead=new BABYLON.Color4(.9,.9,.9,.1),o.minSize=.7,o.maxSize=1,o.minLifeTime=Number.MAX_SAFE_INTEGER,o.emitRate=50,o.blendMode=BABYLON.ParticleSystem.BLENDMODE_STANDARD,o.gravity=new BABYLON.Vector3(0,0,0),o.direction1=new BABYLON.Vector3(0,0,0),o.direction2=new BABYLON.Vector3(0,0,0),o.minAngularSpeed=-2,o.maxAngularSpeed=2,o.minEmitPower=.5,o.maxEmitPower=1,o.updateSpeed=.005,o.start(),o}static createTempVlaue(e,i,t,n){let s=new BABYLON.Mesh("temp_"+r.getGUID(12),t);s.position=i;let o=new BABYLON.GUI.TextBlock;return o.isPointerBlocker=!1,o.text="默认提示",o.color="white",o.resizeToFit=!0,o.fontSize="20px",o.text=e,n.addControl(o),o.linkWithMesh(s),o}static createCapacity(e,i,t,n="200px"){let s=new c(e,i);s.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,s.mesh=BABYLON.MeshBuilder.CreateBox("RATIO_"+s.anchor.id,{size:1}),s.mesh.position=s.anchor.instance.position.clone(),s.mesh.position.y-=s.mesh.scaling.y/2,s.mesh.scaling=s.anchor.instance.scaling.clone(),s.mesh.scaling.x=.98*s.mesh.scaling.x,s.mesh.scaling.z=.98*s.mesh.scaling.z,s.mesh.rotation=s.anchor.instance.rotation.clone(),s.mesh.alwaysSelectAsActiveMesh=!0,s.mesh.visibility=1;var o=i<.25?BABYLON.Color3.Blue():.25<=i&&i<.5?BABYLON.Color3.Green():.5<=i&&i<.75?BABYLON.Color3.Yellow():BABYLON.Color3.Red();i*=s.mesh.scaling.y;var r=new BABYLON.Vector3(0,-.5,0);s.mesh.setPivotPoint(r);let a=new BABYLON.StandardMaterial(s.mesh.id,s.anchor.instance._scene);return a.diffuseColor=o,s.mesh.material=a,BABYLON.Animation.CreateAndStartAnimation(s.mesh.id,s.mesh,"scaling.y",15,30,.02,i,0,null),s.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,t&&this.createTextMesh(e,t,n,"#02c3fd"),s}static createTextMesh(e,i,t="200px",n="white"){e.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let s=BABYLON.Mesh.CreatePlane("text_"+e.id,e.instance.scaling.x,e.app.scene,!0,BABYLON.Mesh.DOUBLESIDE);s.alwaysSelectAsActiveMesh=!0,s.position=e.instance.position.clone(),s.position.addInPlace(e.instance.forward.scale(e.instance.scaling.z/2+.01)),s.rotation.y=Math.PI-e.instance.rotation.y;let o=new BABYLON.StandardMaterial("text_mat_"+e.id,e.app.scene);o.diffuseColor=BABYLON.Color3.White(),o.emissiveColor=BABYLON.Color3.White();let r=new BABYLON.DynamicTexture("text_tex_"+e.id,{width:1e3*e.instance.scaling.x,height:500*e.instance.scaling.x},e.app.scene,!1);return r.hasAlpha=!0,o.diffuseTexture=r,o.opacityTexture=r,r.drawText(i,1e3*e.instance.scaling.x/4,500*e.instance.scaling.x/2,"bold "+t+" monospace",n,"",!0,!0),r.update(),s.material=o,e.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,s}}class o{}class a{constructor(e){this.textDics=new Array,this.id=e}set background(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this._background&&this._background.dispose(),this._background=new BABYLON.GUI.Image(r.getGUID(12)+"_Image",e),this._background.width=this.size.width+"px",this._background.height=this.size.height+"px",this.rect.addControl(this._background),this.onPointerClick&&(this._background.isPointerBlocker=!1,this._background.onPointerClickObservable.add(()=>{this.onPointerClick()})),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setTexts(t){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.textDics.forEach(e=>e.dispose());for(let i=this.textDics.length=0;i<t.length;i++){let e=new BABYLON.GUI.TextBlock;e.text=t[i].text,e.fontSize=t[i].fontSize||"20px",e.color=t[i].color||"white",e.top=t[i].top||0,e.left=t[i].left||0,this.rect.addControl(e),this.textDics.push(e)}this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}line(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this._line&&this._line.dispose(),this._line=new BABYLON.GUI.Line,this._line.lineWidth=e.width||1.5,this._line.color=e.color||"green",this._line.y2=this.size.height/2,this.container.addControl(this._line),this._line.linkWithMesh(this.pint),this._line.connectedControl=this.rect,this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}dispose(){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.rect&&this.rect.dispose(),this._line&&this._line.dispose(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.rect&&(this.rect.isVisible=e),this._line&&(this._line.isVisible=e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class l{constructor(e,i,t,n,s,o){this.id=e,this.scene=o,this.anchor=i,this.url=t,this.scaling=n,this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance=BABYLON.Mesh.CreatePlane(this.id,n,this.scene,!0,BABYLON.Mesh.DOUBLESIDE),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.position=this.anchor.position.clone();n=this.anchor.getBoundingInfo();this.instance.position.y+=(n.maximum.y-n.minimum.y)/2+s,this.instance.billboardMode=BABYLON.Mesh.BILLBOARDMODE_Y;let r=new BABYLON.StandardMaterial("Mat_"+this.id,this.scene);r.diffuseColor=BABYLON.Color3.White(),r.emissiveColor=BABYLON.Color3.White(),this.instance.material=r,this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setBackground(){let t=new Image;t.src=this.url,t.onload=()=>{this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.scaling.y=this.scaling/(t.width/t.height)/this.scaling;let e=new BABYLON.DynamicTexture(this.id,{width:t.width,height:t.height},this.scene,!1);e.hasAlpha=!0,this.instance.material.diffuseTexture=e;let i=e.getContext();i.drawImage(t,0,0),e.update(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}setColor(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.material.diffuseColor=BABYLON.Color3.FromHexString(e),this.instance.material.emissiveColor=BABYLON.Color3.FromHexString(e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setContents(t){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let n=new Image;n.src=this.url,n.onload=()=>{this.instance.scaling.y=this.scaling/(n.width/n.height)/this.scaling;let i=new BABYLON.DynamicTexture(this.id,{width:n.width,height:n.height},this.scene,!1);i.hasAlpha=!0,this.instance.material.diffuseTexture=i;let e=i.getContext();e.drawImage(n,0,0),t.forEach(e=>i.drawText(e.text,e.left,e.top,"bold "+e.fontSize+" monospace",e.color||"#fffffb","",!0,!0)),i.update(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}dispose(){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.dispose(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class h{static create(e){let i=new o;return i.canvas=document.createElement("canvas"),i.canvas.style.cssText="width: 100%;height: 100%;background-color: transparent;outline-width: 0;",e.appendChild(i.canvas),i.engine=new BABYLON.Engine(i.canvas,!0,{premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0}),i.engine.setHardwareScalingLevel(.5),i.engine.enableOfflineSupport=!1,i.scene=new BABYLON.Scene(i.engine,{useGeometryUniqueIdsMap:!0,useClonedMeshMap:!0,useMaterialMeshMap:!0}),i.scene.useRightHandedSystem=!0,i.scene.getBoundingBoxRenderer().frontColor=BABYLON.Color3.Green(),i.scene.getBoundingBoxRenderer().showBackLines=!1,i}static load(){}}i.default=n}],o={},s.m=n,s.c=o,s.d=function(e,i,t){s.o(e,i)||Object.defineProperty(e,i,{enumerable:!0,get:t})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(i,e){if(1&e&&(i=s(i)),8&e)return i;if(4&e&&"object"==typeof i&&i&&i.__esModule)return i;var t=Object.create(null);if(s.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:i}),2&e&&"string"!=typeof i)for(var n in i)s.d(t,n,function(e){return i[e]}.bind(null,n));return t},s.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(i,"a",i),i},s.o=function(e,i){return Object.prototype.hasOwnProperty.call(e,i)},s.p="",s(s.s=1).default;function s(e){if(o[e])return o[e].exports;var i=o[e]={i:e,l:!1,exports:{}};return n[e].call(i.exports,i,i.exports,s),i.l=!0,i.exports}var n,o});
@@ -1,7 +1,7 @@
1
1
  import IObject from "./components/IObject";
2
2
  import * as Dazzle from '../dazzle/Module';
3
3
  export default class EffectControls {
4
- static createCapacity(_object: IObject, RATIO: number): Dazzle.Capacity;
4
+ static createCapacity(_object: IObject, RATIO: number, _text?: string, _fontSize?: string): Dazzle.Capacity;
5
5
  static createMatrixHeatMap(_anchor: IObject, //地板对象
6
6
  _data: {
7
7
  config: {
package/mx3d.js CHANGED
@@ -1,12 +1,12 @@
1
1
  (function webpackUniversalModuleDefinition(root, factory) {
2
2
  if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(root["TWEEN"];
3
+ module.exports = factory(root["TWEEN"]);
4
4
  else if(typeof define === 'function' && define.amd)
5
5
  define(["TWEEN", "Dazzle", "BABYLON", "babylonjs-materials", "BABYLON.GUI", "BABYLON.SceneLoader", "babylonjs-serializers"], factory);
6
6
  else if(typeof exports === 'object')
7
- exports["MX3D"] = factory(root["TWEEN"];
7
+ exports["MX3D"] = factory(root["TWEEN"]);
8
8
  else
9
- root["MX3D"] = factory(root["TWEEN"];
9
+ root["MX3D"] = factory(root["TWEEN"]);
10
10
  })(window, function(__WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__3__, __WEBPACK_EXTERNAL_MODULE__13__, __WEBPACK_EXTERNAL_MODULE__14__, __WEBPACK_EXTERNAL_MODULE__15__, __WEBPACK_EXTERNAL_MODULE__16__, __WEBPACK_EXTERNAL_MODULE__17__) {
11
11
  return /******/ (function(modules) { // webpackBootstrap
12
12
  /******/ // The module cache
@@ -9946,8 +9946,8 @@ class App_App {
9946
9946
 
9947
9947
  class EffectControls_EffectControls {
9948
9948
  //创建容量
9949
- static createCapacity(_object, RATIO) {
9950
- return external_Dazzle_["Builder"].createCapacity(_object, RATIO);
9949
+ static createCapacity(_object, RATIO, _text, _fontSize = "200px") {
9950
+ return external_Dazzle_["Builder"].createCapacity(_object, RATIO, _text, _fontSize);
9951
9951
  }
9952
9952
  ///创建矩阵云图
9953
9953
  static createMatrixHeatMap(_anchor, //地板对象
package/mx3d.min.js CHANGED
@@ -22,4 +22,4 @@
22
22
  diffuseColor = res.rgb;
23
23
  alpha = res.a;
24
24
  }
25
- `),s.freeze()}return s}delete(e=!1){if(this.BOX&&this.BOX.dispose(),this.transparentBox&&this.transparentBox.dispose(!0,!0),this.BOX=null,this.transparentBox=null,e){for(const t in this.resources.map)this.resources.find(t).removeAllFromScene(),this.resources.remove(t);this.resources.clear()}}async GetWalls(e,t){let i=await BABYLON.SceneLoader.LoadAssetContainerAsync(e,t+".gltf",this.app.scene);if(i.meshes){var s=i.meshes[0].getChildMeshes();for(let e=0;e<s.length;e++)this.walls.add(s[e].id,s[e])}}}(s=g=g||{}).leftClick="leftClick",s.rightClick="rightClick",s.doubleClick="doubleClick",s.eover="eover",s.longPress="longPress",s.out="out";class M{constructor(e){var t,i;this.object=e,this.object instanceof Y?(i=this.object.getBounding(),t=H.Tools.getVisualAngle(i,this.object.app),this.alpha=t.alpha,this.beta=t.beta,this.focus=t.focus,this.radius=i.boundingSphere.radiusWorld+3,this.focus.y=this.object.height):(t=this.object.instance.getBoundingInfo(),i=H.Tools.getVisualAngle(t,this.object.app),this.alpha=i.alpha,this.beta=i.beta,this.focus=this.object.instance.getAbsolutePosition(),this.radius=t.boundingSphere.radiusWorld+3),this.minimumLimit=.3,this.maximumLimit=2*this.radius,this.minBeta=.01,this.maxBeta=Math.PI/2*.98}setVisual(e){e=JSON.parse(e);this.alpha=e.alpha,this.beta=e.beta,this.radius=e.radius,this.focus=H.Tools.ToVector3(e.focus)}setLimit(e,t){this.minimumLimit=e+.3,this.maximumLimit=t}setBeta(e,t){this.minBeta=e,this.maxBeta=t}}(s=v=v||{})[s.Opaque=0]="Opaque",s[s.Flash=1]="Flash",s[s.Transparent=2]="Transparent";class T{constructor(e){this.isVisible=!0,this.executes=new m,this.clickEvents=new m,this.touchtime=(new Date).getTime(),this.effectType=v.Opaque,this._isMonitor=!0,this.app=e}set isMonitor(e){this._isMonitor=e}get isMonitor(){return this._isMonitor}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.isEnabled=e,this.isEnabled?(this.instance.isPickable=this.isMonitor,this.instance.enablePointerMoveEvents=this.isMonitor):(this.instance.isPickable=this.isEnabled,this.instance.enablePointerMoveEvents=this.isEnabled),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}set showBoundingBox(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.showBoundingBox=e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}get showBoundingBox(){return this.instance.showBoundingBox}bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.animation=e.animation,this.isAutoPlay=e.isAutoPlay,this.isloop=e.isloop,this.isMonitor=e.isMonitor,null!=e.isVisible&&(this.isVisible=e.isVisible),this.objectType=e.objectType;let t=new BABYLON.Mesh(this.id,this.app.scene),i=this.app.Resources.resources.find(this.modelId);i.meshes[0].getChildMeshes().forEach(e=>{e=e.createInstance(this.id);e.isPickable=!1,e.enablePointerMoveEvents=!1,e.parent=t}),t.rotation=H.Tools.ToVector3(e.rotation),t.position=H.Tools.ToVector3(e.position),t.scaling=H.Tools.ToVector3(e.scaling);e=H.Tools.computeBounds(t);t.setBoundingInfo(e),this.instance=this.app.Resources.BOX.clone(this.id),this.instance.id=this.id,this.instance.enablePointerMoveEvents=!0,this.instance.isPickable=!0,this.instance.scaling=new BABYLON.Vector3((e.maximum.x-e.minimum.x)*t.scaling.x,(e.maximum.y-e.minimum.y)*t.scaling.y,(e.maximum.z-e.minimum.z)*t.scaling.z),0==this.instance.scaling.y&&(this.instance.scaling.y=.01),this.instance.position=t.position.clone(),this.instance.position.y=(e.maximum.y-e.minimum.y)/2+t.position.y,this.instance.rotation=t.rotation.clone(),t.setParent(this.instance),this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.visualAngle=new M(this),this.isAutoPlay&&this.play()}optimization(t){this.instance.getChildMeshes().forEach(e=>{t?e.freezeWorldMatrix():e.unfreezeWorldMatrix()}),t?this.instance.freezeWorldMatrix():this.instance.unfreezeWorldMatrix(),this.instance.material&&(t?this.instance.material.freeze():this.instance.material.unfreeze())}alwaysActive(){this.instance.getChildMeshes().forEach(e=>{e.alwaysSelectAsActiveMesh=!0,e.doNotSyncBoundingInfo=!1,e.ignoreNonUniformScaling=!0}),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.doNotSyncBoundingInfo=!1}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;var s;e==g.leftClick||e==g.rightClick||e==g.doubleClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,e=>{let t=this.clickEvents.find(g.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(g.rightClick);i&&2==e.sourceEvent.button&&i(this,e);let s=this.clickEvents.find(g.doubleClick);s&&0==e.sourceEvent.button&&(new Date).getTime()-this.touchtime<500&&s(this,e),this.touchtime=(new Date).getTime()}),e="click"):e==g.eover?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger,e=>t(this,e)):e==g.longPress?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnLongPressTrigger,e=>t(this,e)):e==g.out&&(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOutTrigger,e=>t(this,e))),i&&(this.action||(this.action=new BABYLON.ActionManager(this.app.scene),this.instance.actionManager=this.action),(s=this.executes.find(e))&&this.action.unregisterAction(s),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==g.leftClick||e==g.rightClick||e==g.doubleClick){if(this.clickEvents.remove(e),0<this.clickEvents.count())return;e="click"}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;var t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setFlash(t){this.effectType==v.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>{e.instancedBuffers&&(e.instancedBuffers.color=H.EffectMgr.colors[t])}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=v.Flash)}setOpaque(){this.effectType!=v.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>{e.setEnabled(!0),e.instancedBuffers&&(e.instancedBuffers.color=new BABYLON.Color4(1,1,1,1))}),this.instance.disableEdgesRendering(),this.instance.visibility=0,this.setEnabled(this.isEnabled),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=v.Opaque)}setTransparent(e=.3){this.effectType==v.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>e.setEnabled(!1)),this.instance.visibility=e,this.instance.enableEdgesRendering(),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=v.Transparent)}play(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(t=>{let i;t.animations.forEach(e=>{-1!=e.name.indexOf("open")&&(i=e)}),i?this.app.scene.beginDirectAnimation(t,[i],0,10*i.getKeys().length,this.isloop):t.animations.forEach(e=>this.app.scene.beginDirectAnimation(t,[e],0,10*e.getKeys().length,this.isloop))}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}stop(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(t=>{let i;t.animations.forEach(e=>{-1!=e.name.indexOf("close")&&(i=e)}),i?this.app.scene.beginDirectAnimation(t,[i],0,10*i.getKeys().length,!1):t.animations.forEach(e=>this.app.scene.beginDirectAnimation(t,[e],10*e.getKeys().length,0,!1))}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}flyTo(){this.app.camera.flyTo(this.visualAngle,500)}focus(){}}class _ extends T{constructor(){super(...arguments),this.baseModel=null}bind(e){this.id=r.getGUID(12),this.objectType="Wall",this.name="墙体",this.isMonitor=!1,this.instance=H.Tools.MergeMeshes(e.walls,this.app),this.instance.receiveShadows=!0,e.t&&""!=e.t?(this.modelId=e.t.modelId,this.baseModel=e.t,this.baseModel.length||(this.baseModel.length=3.1),this.nativeMaterial=this.app.Resources.GetMergeMaterial(e.t,this.app.scene)):this.nativeMaterial=null,this.instance.material=this.nativeMaterial,this.instance.id=this.id,this.instance.name=this.id,this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.instance.position.y=this.height,this.alwaysActive(),this.optimization(!0)}}class k extends T{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.height=e.baseModel.height,this.isMonitor=e.isMonitor,this.objectType=e.objectType,this.instance=new BABYLON.Mesh(this.id,this.app.scene);let t=this.app.Resources.resources.find(this.modelId);t.meshes[0].getChildMeshes().forEach(e=>{(this.app.highQualityMode?e.clone(this.id):e.createInstance(this.id)).parent=this.instance});var i=H.Tools.computeBounds(this.instance);this.instance.rotation=H.Tools.ToVector3(e.rotation),this.instance.position=H.Tools.ToVector3(e.position),this.visualAngle=H.Tools.getVisualAngle(i,this.app);let s=this.app.Resources.BOX.createInstance(this.id);s.setBoundingInfo(i),s.enablePointerMoveEvents=!1,s.isPickable=!1,s.scaling=new BABYLON.Vector3((i.maximum.x-i.minimum.x)*this.instance.scaling.x,(i.maximum.y-i.minimum.y)*this.instance.scaling.y,(i.maximum.z-i.minimum.z)*this.instance.scaling.z),s.position=this.instance.position.clone(),s.position.y=(i.maximum.y-i.minimum.y)/2+this.instance.position.y,s.rotation=this.instance.rotation.clone(),this.instance.getChildMeshes().forEach(e=>e.setParent(s)),this.instance.dispose(),this.instance=s,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.visualAngle=new M(this)}}class O extends T{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.height=e.baseModel.height,this.isMonitor=e.isMonitor,this.objectType=e.objectType,this.instance=new BABYLON.Mesh(this.id,this.app.scene);let t=this.app.Resources.resources.find(this.modelId);t.meshes[0].getChildMeshes().forEach(e=>{(this.app.highQualityMode?e.clone(this.id):e.createInstance(this.id)).parent=this.instance});var i=H.Tools.computeBounds(this.instance);this.instance.rotation=H.Tools.ToVector3(e.rotation),this.instance.position=H.Tools.ToVector3(e.position);let s=this.app.Resources.BOX.createInstance(this.id);s.setBoundingInfo(i),s.enablePointerMoveEvents=!1,s.isPickable=!1,s.scaling=new BABYLON.Vector3((i.maximum.x-i.minimum.x)*this.instance.scaling.x,(i.maximum.y-i.minimum.y)*this.instance.scaling.y,(i.maximum.z-i.minimum.z)*this.instance.scaling.z),s.position=this.instance.position.clone(),s.position.y=(i.maximum.y-i.minimum.y)/2+this.instance.position.y,s.rotation=this.instance.rotation.clone(),this.instance.getChildMeshes().forEach(e=>e.setParent(s)),this.instance.dispose(),this.instance=s,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.visualAngle=new M(this)}}class L extends T{}class C extends T{bind(e){var t=H.Tools.ToARRVector3(e.lines);this.instance=H.Tools.createTube(e.id,t,.02,this.app),this.instance.setEnabled(!1),this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.objectType=e.objectType,this.isMonitor=e.isMonitor;e=this.app.Resources.GetMaterial(e.baseModel,this.app.scene).clone(this.id);BABYLON.Animation.CreateAndStartAnimation("u",e.diffuseTexture,"vOffset",15,30,0,1,1),e.diffuseTexture.vScale=this.instance.getTotalVertices()/50,this.instance.material=e,this.alwaysActive(),this.optimization(!0),this.visualAngle=new M(this)}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;var s;e==g.leftClick||e==g.rightClick||e==g.doubleClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,e=>{let t=this.clickEvents.find(g.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(g.rightClick);i&&2==e.sourceEvent.button&&i(this,e);let s=this.clickEvents.find(g.doubleClick);s&&0==e.sourceEvent.button&&(new Date).getTime()-this.touchtime<500&&s(this,e),this.touchtime=(new Date).getTime()}),e="click"):e==g.eover?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger,e=>t(this,e)):e==g.longPress?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnLongPressTrigger,e=>t(this,e)):e==g.out&&(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOutTrigger,e=>t(this,e))),i&&(this.action||(this.action=new BABYLON.ActionManager(this.app.scene),this.instance.getChildMeshes().forEach(e=>e.actionManager=this.action)),(s=this.executes.find(e))&&this.action.unregisterAction(s),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==g.leftClick||e==g.rightClick||e==g.doubleClick){if(this.clickEvents.remove(e),0<this.clickEvents.count())return;e="click"}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;var t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action,this.instance.getChildMeshes().forEach(e=>e.actionManager=this.action)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class E extends T{async bind(t){if(this.id=t.id,this.name=t.name,this.parentId=t.parentId,this.isMonitor=t.isMonitor,this.objectType=t.objectType,this.isVisible=t.isVisible,t.virtualType&&t.isVisible){"Cylinder"==t.virtualType?this.instance=BABYLON.MeshBuilder.CreateCylinder(this.id,{height:1,diameterTop:1,diameterBottom:1},this.app.scene):this.instance=BABYLON.MeshBuilder.CreateBox(this.id,{size:1},this.app.scene),this.instance.setEnabled(!1),this.instance.id=this.id;let e=new BABYLON.StandardMaterial(this.id,this.app.scene);e.diffuseColor=BABYLON.Color3.FromHexString(t.color),t.alpha<.98&&(e.alpha=t.alpha,e.alphaMode=2,e.useAlphaFromDiffuseTexture=!0),this.instance.material=e,t.isEdges&&(this.instance.enableEdgesRendering(),this.instance.edgesWidth=1,this.instance.edgesColor=new BABYLON.Color4(0,1,1,1)),t.edgesWidth&&0<t.edgesWidth&&(this.instance.enableEdgesRendering(),this.instance.edgesWidth=t.edgesWidth,this.instance.edgesColor=BABYLON.Color3.FromHexString(t.edgesColor).toColor4(1))}else this.instance=BABYLON.Mesh.CreateBox(this.id,1,this.app.scene),this.instance.setEnabled(!1),this.instance.id=this.id;this.instance.enablePointerMoveEvents=this.isMonitor,this.instance.isPickable=this.isMonitor,this.instance.rotation=H.Tools.ToVector3(t.rotation),this.instance.position=H.Tools.ToVector3(t.position),this.instance.scaling=H.Tools.ToVector3(t.scaling),this.alwaysActive(),this.optimization(!0),this.visualAngle=new M(this)}}class j extends T{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.objectType=e.objectType,this.isMonitor=e.isMonitor;let t={};t.color=e.color,e.size?(t.clearColor=null,t.position=H.Tools.ToVector3(e.position),n=H.Tools.ToVector3(e.rotation),t.rotation=new BABYLON.Vector3(n.x+Math.PI,n.y,n.z),i=Number.parseInt(e.size.replace("px",""))/40,n=e.scaling?H.Tools.ToVector3(e.scaling):BABYLON.Vector3.One(),t.scaling=new BABYLON.Vector3(14*i/50*n.x,1,14*i/50*n.z)):(t.clearColor=e.clearColor,t.position=H.Tools.ToVector3(e.position),t.rotation=H.Tools.ToVector3(e.rotation),t.scaling=H.Tools.ToVector3(e.scaling));var i="bold 100px Arial";let s=new BABYLON.DynamicTexture(this.id,64,this.app.scene,!1);var n=s.getContext();n.font=i;e=n.measureText(this.name).width+8,n=.02*e;s=new BABYLON.DynamicTexture(this.id,{width:e,height:150},this.app.scene,!1);e=new BABYLON.StandardMaterial(this.id,this.app.scene);e.backFaceCulling=!1,e.diffuseTexture=s,t.clearColor||(s.hasAlpha=!0),s.drawText(this.name,null,null,i,t.color,t.clearColor,!1),this.instance=BABYLON.Mesh.CreateGround(this.id,n,3,1,this.app.scene),this.instance.setEnabled(!1),this.instance.scaling=t.scaling,this.instance.position=t.position,this.instance.rotation=t.rotation,this.instance.material=e,this.alwaysActive(),this.optimization(!0),this.visualAngle=new M(this)}}class S extends T{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.isMonitor=e.isMonitor,this.objectType=e.objectType,this.isVisible=!0;var t=u.ToARRVector3(e.pints);this.instance=u.createTube(e.id,t,e.radius,this.app);let i=new BABYLON.StandardMaterial(e.id,this.app.scene);i.diffuseColor=BABYLON.Color3.FromHexString(e.color),i.alpha=e.alpha,this.instance.material=i,this.instance.enablePointerMoveEvents=this.isMonitor,this.instance.isPickable=this.isMonitor,this.instance.setEnabled(!1),this.alwaysActive(),this.optimization(!0),this.visualAngle=new M(this)}}class I extends T{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.objectType=e.objectType,this.isMonitor=!0,this.instance=BABYLON.MeshBuilder.CreatePolygon("地板",{shape:u.Expand(e.vectors,-.01),holes:e.buckles,sideOrientation:BABYLON.Mesh.DOUBLESIDE},this.app.scene),this.alwaysActive(),this.instance.setEnabled(!1),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.instance.position.y=this.height,this.instance.id=e.id,this.instance.name="地板";var t=this.app.Resources.GetMaterial(e.baseModel,this.app.scene).clone(e.id),i=this.instance.getBoundingInfo();this.visualAngle=u.getVisualAngle(i,this.app),e.baseModel.isTiling&&(t.diffuseTexture.uScale=(i.maximum.x-i.minimum.x)/e.baseModel.width,t.diffuseTexture.vScale=(i.maximum.z-i.minimum.z)/e.baseModel.length),this.instance.material=t,this.optimization(!0),this.visualAngle=new M(this)}}class N extends T{bind(e){this.id=e.id,this.parentId=e.parentId,this.objectType="Wall",this.isMonitor=!1,this.instance=this.app.Resources.walls.find(e.id),this.instance&&(this.app.scene.addMesh(this.instance),this.app.Resources.walls.remove(e.id),e.baseModel?(this.modelId=e.baseModel.modelId,this.nativeMaterial=this.app.Resources.GetMergeMaterial(e.baseModel,this.app.scene)):this.nativeMaterial=null,this.instance.material=this.nativeMaterial,this.instance.id=this.id,this.instance.name=this.id,this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.visualAngle=new M(this))}}class D extends T{bind(i){let e=!1;this.id=r.getGUID(12),this.name="墙角",this.isMonitor=!1,this.objectType="Corner";let s=new Array;for(let t=0;t<i.length;t++)if(2<i[t].pints.length){let e=BABYLON.MeshBuilder.CreatePolygon(this.id,{shape:i[t].pints,sideOrientation:BABYLON.Mesh.FRONTSIDE},this.app.scene);e.setEnabled(!1),e.position.y=i[t].height,e.isPickable=!0,e.enablePointerMoveEvents=!1,s.push(e)}return s.length<1||(1<s.length?this.instance=u.MergeMeshes(s,this.app):this.instance=s[0],this.instance.id=this.id,this.instance.name=this.id,this.instance.position.y=this.height,this.instance.setEnabled(!1),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.alwaysActive(),this.optimization(!0),e=!0),e}}class z extends T{focus(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=new Array;for(const t in this.app.project.objectDatas.map){let e=this.app.project.objectDatas.find(t);e.parentId==this.id&&i.push(e),e.setEnabled(!1)}for(const e in this.app.project.objectDatas.map){let t=this.app.project.objectDatas.find(e);t.objectType!=y.Wall&&t.objectType!=y.Corner&&t.objectType!=y.Floor&&t.objectType!=y.Window&&t.objectType!=y.Door||i.forEach(e=>{t.parentId==e.id&&t.setEnabled(!0)})}this.isEnabled=!0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}restVisualAngle(){this.visualAngle=u.getVisualAngle(this.instance.getBoundingInfo(),this.app)}}class P extends T{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.animation=!0,this.isAutoPlay=!0,this.isloop=!0,this.isVisible=!1,this.isMonitor=e.isMonitor,null!=e.isVisible&&(this.isVisible=e.isVisible),this.objectType=e.objectType;let t=new BABYLON.Mesh(this.id,this.app.scene),i=this.app.Resources.resources.find(this.modelId);i.meshes[0].getChildMeshes().forEach(e=>{e=e.createInstance(this.id);e.isPickable=!1,e.enablePointerMoveEvents=!1,e.parent=t}),t.rotation=H.Tools.ToVector3(e.rotation),t.position=H.Tools.ToVector3(e.position),t.scaling=H.Tools.ToVector3(e.scaling);e=H.Tools.computeBounds(t);t.setBoundingInfo(e),this.instance=t,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.visualAngle=new M(this),this.isAutoPlay&&this.play()}setFlash(e){}setTransparent(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.setEnabled(!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setOpaque(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.setEnabled(!0),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}play(){}stop(){}}class Y extends T{constructor(e,t){super(e),this.height=0,this.id=t.id,this.objectType=t.objectType,this.name=t.name,this.parentId=t.parentId,this.height=t.height,this.objectType==y.ParkModel&&(this.height=0),this.index=t.index}bind(n,e=0){let t=!1;for(let e=0;e<n.length;e++){var i=n[e];if(i.objectType==y.optimizedWall){t=!0;let e=new N(this.app);e.bind(i),e.instance&&this.app.project.objectDatas.add(e.id,e)}}let r=new Array;for(let t=0;t<n.length;t++){let e=n[t];e.objectType==y.Wall&&(e.height||(e.height=3.1),e.ply||(e.ply=.09),r.push(e))}let o=new m;for(let e=0;e<n.length;e++){let i=n[e];i.objectType==y.Corner&&(o.add(i.id,i.corner),2<i.pints.length&&(i.height=3.1,i.walls.forEach(t=>{r.forEach(e=>{t==e.id&&parseFloat(e.height)<i.height&&(i.height=parseFloat(e.height))})})))}if(!t){let t=new Array;for(let e=0;e<n.length;e++){var s=n[e];s.objectType==y.Corner&&t.push(s)}let e=new D(this.app);e.height=this.height,e.bind(t)?(e.parentId=this.id,this.app.project.objectDatas.add(e.id,e)):e=null}for(let i=0;i<n.length;i++){let s=n[i];if(s.objectType==y.Floor){s.vectors=new Array;let e=n[i];e.pints.forEach(e=>{o.find(e)||console.log(e),s.vectors.push(o.find(e))}),s.buckles=new Array,e.holes&&e.holes.forEach(e=>{let t=new Array;e.forEach(e=>t.push(o.find(e))),s.buckles.push(t)}),e.middles&&e.middles.forEach(t=>{let i=Array();for(let e=0;e<n.length;e++)n[e].id==t&&n[e].pints.forEach(e=>{e=o.find(e);i.push(new BABYLON.Vector3(e.x,0,e.z))});s.buckles.push(i)});let t=new I(this.app);t.height=this.height,t.bind(s),this.app.project.objectDatas.add(t.id,t)}}o=null;for(let t=0;t<n.length;t++){var a=n[t];let e;if(a.objectType==y.Window)e=new k(this.app);else if(a.objectType==y.Door)e=new O(this.app);else if(a.objectType==y.Cabinet)e=new L(this.app);else if(a.objectType==y.LeakWater)e=new C(this.app);else if(a.objectType==y.VirtualBox)e=new E(this.app);else if(a.objectType==y.UI3D)e=new j(this.app);else if(a.objectType==y.Conduit)e=new S(this.app);else if(a.objectType==y.Building)e=new z(this.app);else{if(a.objectType==y.Wall||a.objectType==y.optimizedWall)continue;if(a.objectType==y.Corner)continue;if(a.objectType==y.Floor)continue;e=new(a.objectType==y.AirFlow?P:T)(this.app)}e.bind(a),this.app.project.objectDatas.add(e.id,e)}if(!t){let o=new m;o.add("body",{t:"",walls:new Array});for(let n=0;n<r.length;n++){let s=BABYLON.MeshBuilder.ExtrudePolygon(r[n].id,{shape:[H.Tools.ToVector3(r[n].wtop),H.Tools.ToVector3(r[n].wleft),H.Tools.ToVector3(r[n].wbottom),H.Tools.ToVector3(r[n].wright)],depth:parseFloat(r[n].height),sideOrientation:BABYLON.Mesh.FRONTSIDE},this.app.scene);s.setEnabled(!1),s.position.y=parseFloat(r[n].height),s.subMeshes=[];var c=s.getTotalVertices();s.subMeshes.push(new BABYLON.SubMesh(0,0,c,0,6,s)),s.subMeshes.push(new BABYLON.SubMesh(0,1,c,18,6,s)),s.subMeshes.push(new BABYLON.SubMesh(0,2,c,30,6,s));for(let i=0;i<r[n].wallwindows.length;i++){const p=BABYLON.CSG.FromMesh(s);let e=this.app.project.objectDatas.find(r[n].wallwindows[i]);var h=e.instance.getBoundingInfo(),l=BABYLON.MeshBuilder.CreateBox((new Date).getTime().toString(),{height:h.maximum.y-h.minimum.y,width:h.maximum.x-h.minimum.x,depth:2*parseFloat(r[n].ply)+.1},this.app.scene);l.position=e.instance.position.clone(),l.position.y=(h.maximum.y-h.minimum.y)/2+e.height,l.rotation=e.instance.rotation.clone();h=BABYLON.CSG.FromMesh(l);let t=p.subtract(h);l.dispose(),s.dispose(),s=t.toMesh(r[n].id,null,this.app.scene,!0),s.setEnabled(!1)}let t=o.find(r[n].leftMap.modelId);t||(t={t:r[n].leftMap,walls:new Array},o.add(r[n].leftMap.modelId,t));let i=o.find(r[n].rightMap.modelId);i||(i={t:r[n].rightMap,walls:new Array},o.add(r[n].rightMap.modelId,i));var d=H.Tools.DeconsTructMesh(s,parseFloat(r[n].height),this.app);for(let e=0;e<d.length;e++)(2==e||3==e?t:4==e||5==e?i:o.find("body")).walls.push(d[e])}for(const u in o.map)if(0<o.find(u).walls.length){let e=new _(this.app);e.parentId=this.id,e.height=this.height,e.bind(o.find(u)),this.app.project.objectDatas.add(e.id,e)}}r=null,this.visualAngle=new M(this)}focus(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(const t in this.app.project.objectDatas.map){let e=this.app.project.objectDatas.find(t);e.parentId==this.id?e.setEnabled(e.isVisible):e.setEnabled(!1)}this.isEnabled=!0,(this.app.project.current=this).app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setEnabled(e){}getBounding(){var i,s;for(const e in this.app.project.objectDatas.map){let t=this.app.project.objectDatas.find(e);if(t.objectType!=y.ParkModel&&t.objectType!=y.Storey&&t.parentId==this.id){let e=t.instance.getBoundingInfo();i&&s||(i=s=e.boundingBox.center.clone()),i=BABYLON.Vector3.Minimize(i,e.minimum.add(t.instance.position)),s=BABYLON.Vector3.Maximize(s,e.maximum.add(t.instance.position))}}return i&&s||(i=BABYLON.Vector3.Zero(),s=new BABYLON.Vector3(12,this.height,8)),new BABYLON.BoundingInfo(i,s)}dispose(){}}class R extends T{constructor(e,t){super(e),this.height=0,this.id=t.id,this.objectType=t.objectType,this.name=t.name,this.parentId=t.parentId,this.height=t.height,this.objectType==y.ParkModel&&(this.height=0),this.index=t.index}bind(n,i=!1){let o=new Array;for(let t=0;t<n.length;t++){let e=n[t];e.objectType==y.Wall&&(e.height||(e.height=3.1),e.ply||(e.ply=.09),o.push(e))}let r=new m;for(let e=0;e<n.length;e++){let i=n[e];i.objectType==y.Corner&&(r.add(i.id,i.corner),2<i.pints.length&&(i.height=3.1,i.walls.forEach(t=>{o.forEach(e=>{t==e.id&&parseFloat(e.height)<i.height&&(i.height=parseFloat(e.height))})})))}let t=new Array;for(let e=0;e<n.length;e++){var s=n[e];s.objectType==y.Corner&&t.push(s)}let e=new D(this.app);if(e.height=this.height,e.bind(t)?(e.parentId=this.id,this.app.project.objectDatas.add(e.id,e)):e=null,!i)for(let i=0;i<n.length;i++){let s=n[i];if(s.objectType==y.Floor){s.vectors=new Array;let e=n[i];e.pints.forEach(e=>{r.find(e)||console.log(e),s.vectors.push(r.find(e))}),s.buckles=new Array,e.holes&&e.holes.forEach(e=>{let t=new Array;e.forEach(e=>t.push(r.find(e))),s.buckles.push(t)}),e.middles&&e.middles.forEach(t=>{let i=Array();for(let e=0;e<n.length;e++)n[e].id==t&&n[e].pints.forEach(e=>{e=r.find(e);i.push(new BABYLON.Vector3(e.x,0,e.z))});s.buckles.push(i)});let t=new I(this.app);t.height=this.height,t.bind(s),this.app.project.objectDatas.add(t.id,t)}}r=null;for(let t=0;t<n.length;t++){var a=n[t];let e;if(a.objectType==y.Window)e=new k(this.app);else if(a.objectType==y.Door)e=new O(this.app);else if(a.objectType!=y.Cabinet||i)if(a.objectType!=y.LeakWater||i)if(a.objectType!=y.VirtualBox||i)if(a.objectType!=y.UI3D||i)if(a.objectType!=y.Conduit||i)if(a.objectType!=y.Building||i){if(a.objectType==y.Wall)continue;if(a.objectType==y.Corner)continue;if(a.objectType==y.Floor)continue;if(i)continue;e=new T(this.app)}else e=new z(this.app);else e=new S(this.app);else e=new j(this.app);else e=new E(this.app);else e=new C(this.app);else e=new L(this.app);e.bind(a),this.app.project.objectDatas.add(e.id,e)}let c=new m;c.add("body",{t:"",walls:new Array});for(let n=0;n<o.length;n++){let s=BABYLON.MeshBuilder.ExtrudePolygon(o[n].id,{shape:[H.Tools.ToVector3(o[n].wtop),H.Tools.ToVector3(o[n].wleft),H.Tools.ToVector3(o[n].wbottom),H.Tools.ToVector3(o[n].wright)],depth:parseFloat(o[n].height),sideOrientation:BABYLON.Mesh.FRONTSIDE},this.app.scene);s.setEnabled(!1),s.position.y=parseFloat(o[n].height),s.subMeshes=[];var h=s.getTotalVertices();s.subMeshes.push(new BABYLON.SubMesh(0,0,h,0,6,s)),s.subMeshes.push(new BABYLON.SubMesh(0,1,h,18,6,s)),s.subMeshes.push(new BABYLON.SubMesh(0,2,h,30,6,s));for(let i=0;i<o[n].wallwindows.length;i++){const u=BABYLON.CSG.FromMesh(s);let e=this.app.project.objectDatas.find(o[n].wallwindows[i]);var l=e.instance.getBoundingInfo(),d=BABYLON.MeshBuilder.CreateBox((new Date).getTime().toString(),{height:l.maximum.y-l.minimum.y,width:l.maximum.x-l.minimum.x,depth:2*parseFloat(o[n].ply)+.1},this.app.scene);d.position=e.instance.position.clone(),d.position.y=(l.maximum.y-l.minimum.y)/2+e.height,d.rotation=e.instance.rotation.clone();l=BABYLON.CSG.FromMesh(d);let t=u.subtract(l);d.dispose(),s.dispose(),s=t.toMesh(o[n].id,null,this.app.scene,!0),s.setEnabled(!1)}let t=c.find(o[n].leftMap.modelId);t||(t={t:o[n].leftMap,walls:new Array},c.add(o[n].leftMap.modelId,t));let i=c.find(o[n].rightMap.modelId);i||(i={t:o[n].rightMap,walls:new Array},c.add(o[n].rightMap.modelId,i));var p=H.Tools.DeconsTructMesh(s,parseFloat(o[n].height),this.app);for(let e=0;e<p.length;e++)(2==e||3==e?t:4==e||5==e?i:c.find("body")).walls.push(p[e])}for(const f in c.map)if(0<c.find(f).walls.length){let e=new _(this.app);e.parentId=this.id,e.height=this.height,e.bind(c.find(f)),this.app.project.objectDatas.add(e.id,e)}o=null,this.restVisualAngle()}focus(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(const t in this.app.project.objectDatas.map){let e=this.app.project.objectDatas.find(t);e.parentId==this.id?e.setEnabled(!0):e.setEnabled(!1)}this.isEnabled=!0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setEnabled(e){}restVisualAngle(){var i,s;for(const e in this.app.project.objectDatas.map){let t=this.app.project.objectDatas.find(e);if(t.objectType!=y.ParkModel&&t.objectType!=y.Storey&&t.parentId==this.id){let e=t.instance.getBoundingInfo();i&&s||(i=s=e.boundingBox.center.clone()),i=BABYLON.Vector3.Minimize(i,e.minimum.add(t.instance.position)),s=BABYLON.Vector3.Maximize(s,e.maximum.add(t.instance.position))}}i&&s||(i=BABYLON.Vector3.Zero(),s=new BABYLON.Vector3(12,this.height,8)),this.visualAngle=u.getVisualAngle(new BABYLON.BoundingInfo(i,s),this.app),this.visualAngle.focus.y=this.height}}var F=i(3);class V{constructor(e,t){this.isOK=!1,this.app=t,this.ele=document.createElement("div"),this.ele.style.cssText="position: absolute;z-index:999999999; font-size: 10px;color: rgb(211, 211, 211);text-shadow:rgba(0, 0, 0, 0.2) 1px 1px 0; padding: 5px 8px;",e.appendChild(this.ele),this.close(),setInterval(()=>{var e;1e3<(new Date).getTime()-this.time&&this.isOK&&!this.text&&((e=this.app.project.objectDatas.find(this.id))&&(this.text=e.name))},100)}set text(e){this._text=e,(this.ele.innerText=e)&&(this.ele.style.display=null)}update(e){e.pickInfo.pickedMesh?e.pickInfo.pickedMesh.id!=this.id?(this.close(),this.id=e.pickInfo.pickedMesh.id,this.time=(new Date).getTime()):this.isOK=!0:this.close(),this.ele.style.top=e.event.offsetY+"px",this.ele.style.left=e.event.offsetX+20+"px"}close(){this.isOK=!1,this.time=(new Date).getTime(),this.ele.style.display="none",this.text=""}setBackground(e){this.url=e,this.ele.style.background="url("+this.url+") no-repeat",this.ele.style.backgroundSize="cover"}}var i={App:class{constructor(e,t){this.index=0,this.highQualityMode=!1;e=F.SceneLoader.create(e);this.canvas=e.canvas,this.engine=e.engine,this.scene=e.scene,this.rootUrl=t||"http://models.wodashijie.com/",this.Resources=new x(this),this.camera=new o(this),this.highlightLayer=new BABYLON.HighlightLayer("highlightLayer",this.scene),this.container=BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("screenUI"),this.Environment=new f(this),this.project=new w(this),H.EffectMgr=new A,this.engine.runRenderLoop(()=>{this.fps&&(this.fps.innerText=this.engine.getFps().toFixed()+" fps"),this.scene.render(),l.a.update()}),window.addEventListener("resize",()=>{this.engine.resize()}),this.scene.onPointerObservable.add(e=>{switch(e.type){case BABYLON.PointerEventTypes.POINTERMOVE:if(!this.tipsTool)return;e.pickInfo&&e.pickInfo.pickedPoint?this.tipsTool.update(e):this.tipsTool.close();break;case BABYLON.PointerEventTypes.POINTERWHEEL:var t;this.camera.isOverLook?this.camera._wheel(e.event):(t=1e3/(this.camera.camera.radius/20),this.camera.camera.panningSensibility=2e3<t?2e3:t<10?10:t)}}),this.scene.onKeyboardObservable.add(e=>{e.type===BABYLON.KeyboardEventTypes.KEYDOWN&&70===e.event.keyCode&&prompt("请复制输入框内的视角参数",JSON.stringify({alpha:this.camera.camera.alpha,focus:u.vector3ToJson(this.camera.camera.target),radius:this.camera.camera.radius,beta:this.camera.camera.beta}))})}create(f){return this.highQualityMode=f.highQualityMode,this.highQualityMode&&(this.Glow=new BABYLON.GlowLayer("glow",this.scene)),f.libraryUrl&&(this.Resources.resourcePath=f.libraryUrl),new Promise(async(n,t)=>{try{var o=await class{static read(s,n){return new Promise(function(e,t){let i=new XMLHttpRequest;i.open(s,n),i.onload=function(){200<=this.status&&this.status<300?e(i.response):t({status:this.status,statusText:i.statusText})},i.onerror=function(){t({status:this.status,statusText:i.statusText})},i.send()})}}.read("GET",f.fileUrl),r=JSON.parse(B.de(o));this.project.id=r.id,this.Environment.color="#7A7A7A"==r.environmentSettings.backColor?new BABYLON.Color4(0,.0588,.1176,1):new BABYLON.Color4(...BABYLON.Color3.FromHexString(r.environmentSettings.backColor).asArray(),1),this.Environment.fogDistance=r.environmentSettings.fogDensity,this.Environment.setFlexIntensity(r.environmentSettings.reflexIntensity),this.Environment.setReflexEnabled(r.environmentSettings.reflexEnabled),this.Environment.loadLight(r.environmentSettings.lights),this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,r.isOptimized&&await this.Resources.GetWalls(f.fileUrl.replace(r.id+".json",""),r.id);let t=new m;for(let e=0;e<r.scenes.length;e++){const d=r.scenes[e];!d.baseModel||".gltf"!=d.baseModel.extension||t.find(d.baseModel.modelId)||this.Resources.resources.find(d.baseModel.modelId)||(d.baseModel.objectType=d.objectType,t.add(d.baseModel.modelId,d.baseModel))}let e=0;for(const p in t.map)await this.Resources.loadModelMesh(t.find(p)),e++,f.progress&&f.progress(e/t.count()*.8);e=0,t=null;let i=new m,s=new m;for(let e=0;e<r.scenes.length;e++){var a,c=r.scenes[e];c.objectType==y.Storey||c.objectType==y.ParkModel?(a=new Y(this,c),this.project.objectDatas.add(a.id,a),i.add(a.id,a),s.add(a.id,new Array),c.objectType==y.ParkModel&&(this.project.root=a)):c.objectType==y.Floor&&i.add(c.id,c)}for(let e=0;e<r.scenes.length;e++){var h,l=r.scenes[e];l.objectType!=y.Storey&&l.objectType!=y.ParkModel&&((h=i.find(l.parentId)).objectType==y.Floor?s.find(h.parentId):s.find(l.parentId)).push(l)}for(const u in s.map)await this.project.objectDatas.find(u).bind(s.find(u)),e++,f.progress&&f.progress(.8+e/r.scenes.length*.2);i=null,s=null,this.project.optimization(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1,n(null),f.complete&&f.complete()}catch(e){t(e)}})}optimized(g){return g.libraryUrl&&(this.Resources.resourcePath=g.libraryUrl),new Promise(async(o,t)=>{try{let i=JSON.parse(B.de(g.file));this.project.id=i.id,this.Environment.color="#7A7A7A"==i.environmentSettings.backColor?new BABYLON.Color4(0,.0588,.1176,1):new BABYLON.Color4(...BABYLON.Color3.FromHexString(i.environmentSettings.backColor).asArray(),1),this.Environment.fogDistance=i.environmentSettings.fogDensity,this.Environment.setFlexIntensity(i.environmentSettings.reflexIntensity),this.Environment.setReflexEnabled(i.environmentSettings.reflexEnabled),this.Environment.loadLight(i.environmentSettings.lights),this.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let t=new m;for(let e=0;e<i.scenes.length;e++){const d=i.scenes[e];g._isOptimized&&"Window"!=d.objectType&&"Door"!=d.objectType||!d.baseModel||".gltf"!=d.baseModel.extension||t.find(d.baseModel.modelId)||this.Resources.resources.find(d.baseModel.modelId)||(d.baseModel.objectType=d.objectType,t.add(d.baseModel.modelId,d.baseModel))}let e=0;for(const p in t.map)await this.Resources.loadModelMesh(t.find(p)),e++,g.progress&&g.progress(e/t.count()*.8);e=0,t=null;let s=new m,n=new m;for(let e=0;e<i.scenes.length;e++){var r,a=i.scenes[e];a.objectType==y.Storey||a.objectType==y.ParkModel?(r=new R(this,a),this.project.objectDatas.add(r.id,r),s.add(r.id,r),n.add(r.id,new Array),a.objectType==y.ParkModel&&(this.project.root=r)):a.objectType==y.Floor&&s.add(a.id,a)}for(let e=0;e<i.scenes.length;e++){var c,h=i.scenes[e];h.objectType!=y.Storey&&h.objectType!=y.ParkModel&&((c=s.find(h.parentId)).objectType==y.Floor?n.find(c.parentId):n.find(h.parentId)).push(h)}for(const u in n.map)await this.project.objectDatas.find(u).bind(n.find(u),g._isOptimized),e++,g.progress&&g.progress(.8+e/i.scenes.length*.2);if(s=null,n=null,this.project.optimization(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1,g._isOptimized){let t=[];for(const f in this.project.objectDatas.map){var l=this.project.objectDatas.find(f);l.objectType!=y.Wall&&l.objectType!=y.Corner||t.push({id:l.id,parentId:l.parentId,objectType:"optimizedWall",baseModel:l.baseModel})}for(let e=0;e<i.scenes.length;e++)i.scenes[e].objectType!=y.Wall&&t.push(i.scenes[e]);i.isOptimized=!0,i.scenes=t}o(JSON.stringify(i)),g.complete&&g.complete()}catch(e){t(e)}})}outGltf(t){this.Resources.delete(!0);for(const i in this.project.objectDatas.map){let e=this.project.objectDatas.find(i);e.objectType!=y.Wall&&e.objectType!=y.Corner?(e.instance&&e.instance.dispose(),this.project.objectDatas.remove(i)):e.instance.material=null}return BABYLON.GLTF2Export.GLTFAsync(this.scene,this.project.id,{shouldExportNode:e=>{e=this.project.objectDatas.find(e.id);return e&&(e.objectType==y.Wall||e.objectType==y.Corner)}}).then(e=>{e.downloadFiles(),t&&t()})}showTips(){this.tipsTool=new V(this.canvas.parentElement,this)}showFps(e="position: absolute;left: 5px;bottom: 5px;z-index:999999999; font-size: 10px;color: rgb(0, 255, 0);text-shadow:rgba(0, 0, 0, 0.2) 1px 1px 0;"){this.fps||(this.fps=document.createElement("div"),this.canvas.parentElement.appendChild(this.fps)),this.fps.style.cssText=e}hideFps(){this.fps&&this.canvas.parentElement.removeChild(this.fps),this.fps=null}dispose(){this.fps&&this.canvas.parentElement.removeChild(this.fps),this.fps=null,this.project.delete(),this.Resources.delete(),this.engine.dispose()}showDebug(){this.scene.debugLayer.show()}},Tools:u,UI:class{static createIconFromMesh(e,t,i,s,n){return new F.IconFromMesh(e,t.instance,i,s,n,t.app.scene)}static createIcon(e,t,i,s){let n;t.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,n=new F.Icon(e),n.size=i,n.height=s,n.pint=new BABYLON.Mesh(t[0].id+"_pint");e=t[0].instance.getAbsolutePosition();return n.pint.position=e,n.pint.position.y+=s,n.rect=new BABYLON.GUI.Rectangle,n.rect.isPointerBlocker=!1,n.rect.width=i.width+"px",n.rect.height=i.height+"px",n.rect.thickness=0,t.app.container.addControl(n.rect),n.rect.linkWithMesh(n.pint),t.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,n}},ObjectType:y,EffectMgr:void 0,EffectType:v,EventType:g,EffectControls:class{static createCapacity(e,t){return F.Builder.createCapacity(e,t)}static createMatrixHeatMap(e,t){if(e.objectType==y.Floor)return F.Builder.createMatrixHeatMap({anchor:e.instance,rootUrl:e.app.rootUrl,FogTex:e.app.Resources.FogTex,container:e.app.container,config:t.config,displayValues:t.displayValues,height:t.height,isAlpha:t.isAlpha,isLevelRender:t.isLevelRender,isParticle:t.isParticle,radius:t.radius,range:t.range});console.error("矩阵云图对象必须为房间!")}static createColumnarHeatMap(e,t){return F.Builder.createColumnarHeatMap({anchor:e.instance,FogTex:e.app.Resources.FogTex,container:e.app.container,config:t.config,displayValues:t.displayValues,isAlpha:t.isAlpha,isLevelRender:t.isLevelRender,isParticle:t.isParticle,radius:t.radius,range:t.range})}},Dictionary:m},H=t.default=i}],d={},h.m=l,h.c=d,h.d=function(e,t,i){h.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},h.t=function(t,e){if(1&e&&(t=h(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(h.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)h.d(i,s,function(e){return t[e]}.bind(null,s));return i},h.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(t,"a",t),t},h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},h.p="",h(h.s=44).default;function h(e){if(d[e])return d[e].exports;var t=d[e]={i:e,l:!1,exports:{}};return l[e].call(t.exports,t,t.exports,h),t.l=!0,t.exports}var l,d});
25
+ `),s.freeze()}return s}delete(e=!1){if(this.BOX&&this.BOX.dispose(),this.transparentBox&&this.transparentBox.dispose(!0,!0),this.BOX=null,this.transparentBox=null,e){for(const t in this.resources.map)this.resources.find(t).removeAllFromScene(),this.resources.remove(t);this.resources.clear()}}async GetWalls(e,t){let i=await BABYLON.SceneLoader.LoadAssetContainerAsync(e,t+".gltf",this.app.scene);if(i.meshes){var s=i.meshes[0].getChildMeshes();for(let e=0;e<s.length;e++)this.walls.add(s[e].id,s[e])}}}(s=g=g||{}).leftClick="leftClick",s.rightClick="rightClick",s.doubleClick="doubleClick",s.eover="eover",s.longPress="longPress",s.out="out";class M{constructor(e){var t,i;this.object=e,this.object instanceof Y?(i=this.object.getBounding(),t=H.Tools.getVisualAngle(i,this.object.app),this.alpha=t.alpha,this.beta=t.beta,this.focus=t.focus,this.radius=i.boundingSphere.radiusWorld+3,this.focus.y=this.object.height):(t=this.object.instance.getBoundingInfo(),i=H.Tools.getVisualAngle(t,this.object.app),this.alpha=i.alpha,this.beta=i.beta,this.focus=this.object.instance.getAbsolutePosition(),this.radius=t.boundingSphere.radiusWorld+3),this.minimumLimit=.3,this.maximumLimit=2*this.radius,this.minBeta=.01,this.maxBeta=Math.PI/2*.98}setVisual(e){e=JSON.parse(e);this.alpha=e.alpha,this.beta=e.beta,this.radius=e.radius,this.focus=H.Tools.ToVector3(e.focus)}setLimit(e,t){this.minimumLimit=e+.3,this.maximumLimit=t}setBeta(e,t){this.minBeta=e,this.maxBeta=t}}(s=v=v||{})[s.Opaque=0]="Opaque",s[s.Flash=1]="Flash",s[s.Transparent=2]="Transparent";class T{constructor(e){this.isVisible=!0,this.executes=new m,this.clickEvents=new m,this.touchtime=(new Date).getTime(),this.effectType=v.Opaque,this._isMonitor=!0,this.app=e}set isMonitor(e){this._isMonitor=e}get isMonitor(){return this._isMonitor}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.isEnabled=e,this.isEnabled?(this.instance.isPickable=this.isMonitor,this.instance.enablePointerMoveEvents=this.isMonitor):(this.instance.isPickable=this.isEnabled,this.instance.enablePointerMoveEvents=this.isEnabled),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}set showBoundingBox(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.showBoundingBox=e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}get showBoundingBox(){return this.instance.showBoundingBox}bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.animation=e.animation,this.isAutoPlay=e.isAutoPlay,this.isloop=e.isloop,this.isMonitor=e.isMonitor,null!=e.isVisible&&(this.isVisible=e.isVisible),this.objectType=e.objectType;let t=new BABYLON.Mesh(this.id,this.app.scene),i=this.app.Resources.resources.find(this.modelId);i.meshes[0].getChildMeshes().forEach(e=>{e=e.createInstance(this.id);e.isPickable=!1,e.enablePointerMoveEvents=!1,e.parent=t}),t.rotation=H.Tools.ToVector3(e.rotation),t.position=H.Tools.ToVector3(e.position),t.scaling=H.Tools.ToVector3(e.scaling);e=H.Tools.computeBounds(t);t.setBoundingInfo(e),this.instance=this.app.Resources.BOX.clone(this.id),this.instance.id=this.id,this.instance.enablePointerMoveEvents=!0,this.instance.isPickable=!0,this.instance.scaling=new BABYLON.Vector3((e.maximum.x-e.minimum.x)*t.scaling.x,(e.maximum.y-e.minimum.y)*t.scaling.y,(e.maximum.z-e.minimum.z)*t.scaling.z),0==this.instance.scaling.y&&(this.instance.scaling.y=.01),this.instance.position=t.position.clone(),this.instance.position.y=(e.maximum.y-e.minimum.y)/2+t.position.y,this.instance.rotation=t.rotation.clone(),t.setParent(this.instance),this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.visualAngle=new M(this),this.isAutoPlay&&this.play()}optimization(t){this.instance.getChildMeshes().forEach(e=>{t?e.freezeWorldMatrix():e.unfreezeWorldMatrix()}),t?this.instance.freezeWorldMatrix():this.instance.unfreezeWorldMatrix(),this.instance.material&&(t?this.instance.material.freeze():this.instance.material.unfreeze())}alwaysActive(){this.instance.getChildMeshes().forEach(e=>{e.alwaysSelectAsActiveMesh=!0,e.doNotSyncBoundingInfo=!1,e.ignoreNonUniformScaling=!0}),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.doNotSyncBoundingInfo=!1}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;var s;e==g.leftClick||e==g.rightClick||e==g.doubleClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,e=>{let t=this.clickEvents.find(g.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(g.rightClick);i&&2==e.sourceEvent.button&&i(this,e);let s=this.clickEvents.find(g.doubleClick);s&&0==e.sourceEvent.button&&(new Date).getTime()-this.touchtime<500&&s(this,e),this.touchtime=(new Date).getTime()}),e="click"):e==g.eover?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger,e=>t(this,e)):e==g.longPress?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnLongPressTrigger,e=>t(this,e)):e==g.out&&(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOutTrigger,e=>t(this,e))),i&&(this.action||(this.action=new BABYLON.ActionManager(this.app.scene),this.instance.actionManager=this.action),(s=this.executes.find(e))&&this.action.unregisterAction(s),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==g.leftClick||e==g.rightClick||e==g.doubleClick){if(this.clickEvents.remove(e),0<this.clickEvents.count())return;e="click"}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;var t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setFlash(t){this.effectType==v.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>{e.instancedBuffers&&(e.instancedBuffers.color=H.EffectMgr.colors[t])}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=v.Flash)}setOpaque(){this.effectType!=v.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>{e.setEnabled(!0),e.instancedBuffers&&(e.instancedBuffers.color=new BABYLON.Color4(1,1,1,1))}),this.instance.disableEdgesRendering(),this.instance.visibility=0,this.setEnabled(this.isEnabled),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=v.Opaque)}setTransparent(e=.3){this.effectType==v.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>e.setEnabled(!1)),this.instance.visibility=e,this.instance.enableEdgesRendering(),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=v.Transparent)}play(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(t=>{let i;t.animations.forEach(e=>{-1!=e.name.indexOf("open")&&(i=e)}),i?this.app.scene.beginDirectAnimation(t,[i],0,10*i.getKeys().length,this.isloop):t.animations.forEach(e=>this.app.scene.beginDirectAnimation(t,[e],0,10*e.getKeys().length,this.isloop))}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}stop(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(t=>{let i;t.animations.forEach(e=>{-1!=e.name.indexOf("close")&&(i=e)}),i?this.app.scene.beginDirectAnimation(t,[i],0,10*i.getKeys().length,!1):t.animations.forEach(e=>this.app.scene.beginDirectAnimation(t,[e],10*e.getKeys().length,0,!1))}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}flyTo(){this.app.camera.flyTo(this.visualAngle,500)}focus(){}}class _ extends T{constructor(){super(...arguments),this.baseModel=null}bind(e){this.id=r.getGUID(12),this.objectType="Wall",this.name="墙体",this.isMonitor=!1,this.instance=H.Tools.MergeMeshes(e.walls,this.app),this.instance.receiveShadows=!0,e.t&&""!=e.t?(this.modelId=e.t.modelId,this.baseModel=e.t,this.baseModel.length||(this.baseModel.length=3.1),this.nativeMaterial=this.app.Resources.GetMergeMaterial(e.t,this.app.scene)):this.nativeMaterial=null,this.instance.material=this.nativeMaterial,this.instance.id=this.id,this.instance.name=this.id,this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.instance.position.y=this.height,this.alwaysActive(),this.optimization(!0)}}class k extends T{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.height=e.baseModel.height,this.isMonitor=e.isMonitor,this.objectType=e.objectType,this.instance=new BABYLON.Mesh(this.id,this.app.scene);let t=this.app.Resources.resources.find(this.modelId);t.meshes[0].getChildMeshes().forEach(e=>{(this.app.highQualityMode?e.clone(this.id):e.createInstance(this.id)).parent=this.instance});var i=H.Tools.computeBounds(this.instance);this.instance.rotation=H.Tools.ToVector3(e.rotation),this.instance.position=H.Tools.ToVector3(e.position),this.visualAngle=H.Tools.getVisualAngle(i,this.app);let s=this.app.Resources.BOX.createInstance(this.id);s.setBoundingInfo(i),s.enablePointerMoveEvents=!1,s.isPickable=!1,s.scaling=new BABYLON.Vector3((i.maximum.x-i.minimum.x)*this.instance.scaling.x,(i.maximum.y-i.minimum.y)*this.instance.scaling.y,(i.maximum.z-i.minimum.z)*this.instance.scaling.z),s.position=this.instance.position.clone(),s.position.y=(i.maximum.y-i.minimum.y)/2+this.instance.position.y,s.rotation=this.instance.rotation.clone(),this.instance.getChildMeshes().forEach(e=>e.setParent(s)),this.instance.dispose(),this.instance=s,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.visualAngle=new M(this)}}class O extends T{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.height=e.baseModel.height,this.isMonitor=e.isMonitor,this.objectType=e.objectType,this.instance=new BABYLON.Mesh(this.id,this.app.scene);let t=this.app.Resources.resources.find(this.modelId);t.meshes[0].getChildMeshes().forEach(e=>{(this.app.highQualityMode?e.clone(this.id):e.createInstance(this.id)).parent=this.instance});var i=H.Tools.computeBounds(this.instance);this.instance.rotation=H.Tools.ToVector3(e.rotation),this.instance.position=H.Tools.ToVector3(e.position);let s=this.app.Resources.BOX.createInstance(this.id);s.setBoundingInfo(i),s.enablePointerMoveEvents=!1,s.isPickable=!1,s.scaling=new BABYLON.Vector3((i.maximum.x-i.minimum.x)*this.instance.scaling.x,(i.maximum.y-i.minimum.y)*this.instance.scaling.y,(i.maximum.z-i.minimum.z)*this.instance.scaling.z),s.position=this.instance.position.clone(),s.position.y=(i.maximum.y-i.minimum.y)/2+this.instance.position.y,s.rotation=this.instance.rotation.clone(),this.instance.getChildMeshes().forEach(e=>e.setParent(s)),this.instance.dispose(),this.instance=s,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.visualAngle=new M(this)}}class L extends T{}class C extends T{bind(e){var t=H.Tools.ToARRVector3(e.lines);this.instance=H.Tools.createTube(e.id,t,.02,this.app),this.instance.setEnabled(!1),this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.objectType=e.objectType,this.isMonitor=e.isMonitor;e=this.app.Resources.GetMaterial(e.baseModel,this.app.scene).clone(this.id);BABYLON.Animation.CreateAndStartAnimation("u",e.diffuseTexture,"vOffset",15,30,0,1,1),e.diffuseTexture.vScale=this.instance.getTotalVertices()/50,this.instance.material=e,this.alwaysActive(),this.optimization(!0),this.visualAngle=new M(this)}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;var s;e==g.leftClick||e==g.rightClick||e==g.doubleClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,e=>{let t=this.clickEvents.find(g.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(g.rightClick);i&&2==e.sourceEvent.button&&i(this,e);let s=this.clickEvents.find(g.doubleClick);s&&0==e.sourceEvent.button&&(new Date).getTime()-this.touchtime<500&&s(this,e),this.touchtime=(new Date).getTime()}),e="click"):e==g.eover?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger,e=>t(this,e)):e==g.longPress?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnLongPressTrigger,e=>t(this,e)):e==g.out&&(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOutTrigger,e=>t(this,e))),i&&(this.action||(this.action=new BABYLON.ActionManager(this.app.scene),this.instance.getChildMeshes().forEach(e=>e.actionManager=this.action)),(s=this.executes.find(e))&&this.action.unregisterAction(s),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==g.leftClick||e==g.rightClick||e==g.doubleClick){if(this.clickEvents.remove(e),0<this.clickEvents.count())return;e="click"}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;var t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action,this.instance.getChildMeshes().forEach(e=>e.actionManager=this.action)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class E extends T{async bind(t){if(this.id=t.id,this.name=t.name,this.parentId=t.parentId,this.isMonitor=t.isMonitor,this.objectType=t.objectType,this.isVisible=t.isVisible,t.virtualType&&t.isVisible){"Cylinder"==t.virtualType?this.instance=BABYLON.MeshBuilder.CreateCylinder(this.id,{height:1,diameterTop:1,diameterBottom:1},this.app.scene):this.instance=BABYLON.MeshBuilder.CreateBox(this.id,{size:1},this.app.scene),this.instance.setEnabled(!1),this.instance.id=this.id;let e=new BABYLON.StandardMaterial(this.id,this.app.scene);e.diffuseColor=BABYLON.Color3.FromHexString(t.color),t.alpha<.98&&(e.alpha=t.alpha,e.alphaMode=2,e.useAlphaFromDiffuseTexture=!0),this.instance.material=e,t.isEdges&&(this.instance.enableEdgesRendering(),this.instance.edgesWidth=1,this.instance.edgesColor=new BABYLON.Color4(0,1,1,1)),t.edgesWidth&&0<t.edgesWidth&&(this.instance.enableEdgesRendering(),this.instance.edgesWidth=t.edgesWidth,this.instance.edgesColor=BABYLON.Color3.FromHexString(t.edgesColor).toColor4(1))}else this.instance=BABYLON.Mesh.CreateBox(this.id,1,this.app.scene),this.instance.setEnabled(!1),this.instance.id=this.id;this.instance.enablePointerMoveEvents=this.isMonitor,this.instance.isPickable=this.isMonitor,this.instance.rotation=H.Tools.ToVector3(t.rotation),this.instance.position=H.Tools.ToVector3(t.position),this.instance.scaling=H.Tools.ToVector3(t.scaling),this.alwaysActive(),this.optimization(!0),this.visualAngle=new M(this)}}class j extends T{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.objectType=e.objectType,this.isMonitor=e.isMonitor;let t={};t.color=e.color,e.size?(t.clearColor=null,t.position=H.Tools.ToVector3(e.position),n=H.Tools.ToVector3(e.rotation),t.rotation=new BABYLON.Vector3(n.x+Math.PI,n.y,n.z),i=Number.parseInt(e.size.replace("px",""))/40,n=e.scaling?H.Tools.ToVector3(e.scaling):BABYLON.Vector3.One(),t.scaling=new BABYLON.Vector3(14*i/50*n.x,1,14*i/50*n.z)):(t.clearColor=e.clearColor,t.position=H.Tools.ToVector3(e.position),t.rotation=H.Tools.ToVector3(e.rotation),t.scaling=H.Tools.ToVector3(e.scaling));var i="bold 100px Arial";let s=new BABYLON.DynamicTexture(this.id,64,this.app.scene,!1);var n=s.getContext();n.font=i;e=n.measureText(this.name).width+8,n=.02*e;s=new BABYLON.DynamicTexture(this.id,{width:e,height:150},this.app.scene,!1);e=new BABYLON.StandardMaterial(this.id,this.app.scene);e.backFaceCulling=!1,e.diffuseTexture=s,t.clearColor||(s.hasAlpha=!0),s.drawText(this.name,null,null,i,t.color,t.clearColor,!1),this.instance=BABYLON.Mesh.CreateGround(this.id,n,3,1,this.app.scene),this.instance.setEnabled(!1),this.instance.scaling=t.scaling,this.instance.position=t.position,this.instance.rotation=t.rotation,this.instance.material=e,this.alwaysActive(),this.optimization(!0),this.visualAngle=new M(this)}}class S extends T{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.isMonitor=e.isMonitor,this.objectType=e.objectType,this.isVisible=!0;var t=u.ToARRVector3(e.pints);this.instance=u.createTube(e.id,t,e.radius,this.app);let i=new BABYLON.StandardMaterial(e.id,this.app.scene);i.diffuseColor=BABYLON.Color3.FromHexString(e.color),i.alpha=e.alpha,this.instance.material=i,this.instance.enablePointerMoveEvents=this.isMonitor,this.instance.isPickable=this.isMonitor,this.instance.setEnabled(!1),this.alwaysActive(),this.optimization(!0),this.visualAngle=new M(this)}}class I extends T{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.objectType=e.objectType,this.isMonitor=!0,this.instance=BABYLON.MeshBuilder.CreatePolygon("地板",{shape:u.Expand(e.vectors,-.01),holes:e.buckles,sideOrientation:BABYLON.Mesh.DOUBLESIDE},this.app.scene),this.alwaysActive(),this.instance.setEnabled(!1),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.instance.position.y=this.height,this.instance.id=e.id,this.instance.name="地板";var t=this.app.Resources.GetMaterial(e.baseModel,this.app.scene).clone(e.id),i=this.instance.getBoundingInfo();this.visualAngle=u.getVisualAngle(i,this.app),e.baseModel.isTiling&&(t.diffuseTexture.uScale=(i.maximum.x-i.minimum.x)/e.baseModel.width,t.diffuseTexture.vScale=(i.maximum.z-i.minimum.z)/e.baseModel.length),this.instance.material=t,this.optimization(!0),this.visualAngle=new M(this)}}class N extends T{bind(e){this.id=e.id,this.parentId=e.parentId,this.objectType="Wall",this.isMonitor=!1,this.instance=this.app.Resources.walls.find(e.id),this.instance&&(this.app.scene.addMesh(this.instance),this.app.Resources.walls.remove(e.id),e.baseModel?(this.modelId=e.baseModel.modelId,this.nativeMaterial=this.app.Resources.GetMergeMaterial(e.baseModel,this.app.scene)):this.nativeMaterial=null,this.instance.material=this.nativeMaterial,this.instance.id=this.id,this.instance.name=this.id,this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.visualAngle=new M(this))}}class D extends T{bind(i){let e=!1;this.id=r.getGUID(12),this.name="墙角",this.isMonitor=!1,this.objectType="Corner";let s=new Array;for(let t=0;t<i.length;t++)if(2<i[t].pints.length){let e=BABYLON.MeshBuilder.CreatePolygon(this.id,{shape:i[t].pints,sideOrientation:BABYLON.Mesh.FRONTSIDE},this.app.scene);e.setEnabled(!1),e.position.y=i[t].height,e.isPickable=!0,e.enablePointerMoveEvents=!1,s.push(e)}return s.length<1||(1<s.length?this.instance=u.MergeMeshes(s,this.app):this.instance=s[0],this.instance.id=this.id,this.instance.name=this.id,this.instance.position.y=this.height,this.instance.setEnabled(!1),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.alwaysActive(),this.optimization(!0),e=!0),e}}class z extends T{focus(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=new Array;for(const t in this.app.project.objectDatas.map){let e=this.app.project.objectDatas.find(t);e.parentId==this.id&&i.push(e),e.setEnabled(!1)}for(const e in this.app.project.objectDatas.map){let t=this.app.project.objectDatas.find(e);t.objectType!=y.Wall&&t.objectType!=y.Corner&&t.objectType!=y.Floor&&t.objectType!=y.Window&&t.objectType!=y.Door||i.forEach(e=>{t.parentId==e.id&&t.setEnabled(!0)})}this.isEnabled=!0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}restVisualAngle(){this.visualAngle=u.getVisualAngle(this.instance.getBoundingInfo(),this.app)}}class P extends T{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.animation=!0,this.isAutoPlay=!0,this.isloop=!0,this.isVisible=!1,this.isMonitor=e.isMonitor,null!=e.isVisible&&(this.isVisible=e.isVisible),this.objectType=e.objectType;let t=new BABYLON.Mesh(this.id,this.app.scene),i=this.app.Resources.resources.find(this.modelId);i.meshes[0].getChildMeshes().forEach(e=>{e=e.createInstance(this.id);e.isPickable=!1,e.enablePointerMoveEvents=!1,e.parent=t}),t.rotation=H.Tools.ToVector3(e.rotation),t.position=H.Tools.ToVector3(e.position),t.scaling=H.Tools.ToVector3(e.scaling);e=H.Tools.computeBounds(t);t.setBoundingInfo(e),this.instance=t,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.visualAngle=new M(this),this.isAutoPlay&&this.play()}setFlash(e){}setTransparent(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.setEnabled(!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setOpaque(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.setEnabled(!0),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}play(){}stop(){}}class Y extends T{constructor(e,t){super(e),this.height=0,this.id=t.id,this.objectType=t.objectType,this.name=t.name,this.parentId=t.parentId,this.height=t.height,this.objectType==y.ParkModel&&(this.height=0),this.index=t.index}bind(n,e=0){let t=!1;for(let e=0;e<n.length;e++){var i=n[e];if(i.objectType==y.optimizedWall){t=!0;let e=new N(this.app);e.bind(i),e.instance&&this.app.project.objectDatas.add(e.id,e)}}let r=new Array;for(let t=0;t<n.length;t++){let e=n[t];e.objectType==y.Wall&&(e.height||(e.height=3.1),e.ply||(e.ply=.09),r.push(e))}let o=new m;for(let e=0;e<n.length;e++){let i=n[e];i.objectType==y.Corner&&(o.add(i.id,i.corner),2<i.pints.length&&(i.height=3.1,i.walls.forEach(t=>{r.forEach(e=>{t==e.id&&parseFloat(e.height)<i.height&&(i.height=parseFloat(e.height))})})))}if(!t){let t=new Array;for(let e=0;e<n.length;e++){var s=n[e];s.objectType==y.Corner&&t.push(s)}let e=new D(this.app);e.height=this.height,e.bind(t)?(e.parentId=this.id,this.app.project.objectDatas.add(e.id,e)):e=null}for(let i=0;i<n.length;i++){let s=n[i];if(s.objectType==y.Floor){s.vectors=new Array;let e=n[i];e.pints.forEach(e=>{o.find(e)||console.log(e),s.vectors.push(o.find(e))}),s.buckles=new Array,e.holes&&e.holes.forEach(e=>{let t=new Array;e.forEach(e=>t.push(o.find(e))),s.buckles.push(t)}),e.middles&&e.middles.forEach(t=>{let i=Array();for(let e=0;e<n.length;e++)n[e].id==t&&n[e].pints.forEach(e=>{e=o.find(e);i.push(new BABYLON.Vector3(e.x,0,e.z))});s.buckles.push(i)});let t=new I(this.app);t.height=this.height,t.bind(s),this.app.project.objectDatas.add(t.id,t)}}o=null;for(let t=0;t<n.length;t++){var a=n[t];let e;if(a.objectType==y.Window)e=new k(this.app);else if(a.objectType==y.Door)e=new O(this.app);else if(a.objectType==y.Cabinet)e=new L(this.app);else if(a.objectType==y.LeakWater)e=new C(this.app);else if(a.objectType==y.VirtualBox)e=new E(this.app);else if(a.objectType==y.UI3D)e=new j(this.app);else if(a.objectType==y.Conduit)e=new S(this.app);else if(a.objectType==y.Building)e=new z(this.app);else{if(a.objectType==y.Wall||a.objectType==y.optimizedWall)continue;if(a.objectType==y.Corner)continue;if(a.objectType==y.Floor)continue;e=new(a.objectType==y.AirFlow?P:T)(this.app)}e.bind(a),this.app.project.objectDatas.add(e.id,e)}if(!t){let o=new m;o.add("body",{t:"",walls:new Array});for(let n=0;n<r.length;n++){let s=BABYLON.MeshBuilder.ExtrudePolygon(r[n].id,{shape:[H.Tools.ToVector3(r[n].wtop),H.Tools.ToVector3(r[n].wleft),H.Tools.ToVector3(r[n].wbottom),H.Tools.ToVector3(r[n].wright)],depth:parseFloat(r[n].height),sideOrientation:BABYLON.Mesh.FRONTSIDE},this.app.scene);s.setEnabled(!1),s.position.y=parseFloat(r[n].height),s.subMeshes=[];var c=s.getTotalVertices();s.subMeshes.push(new BABYLON.SubMesh(0,0,c,0,6,s)),s.subMeshes.push(new BABYLON.SubMesh(0,1,c,18,6,s)),s.subMeshes.push(new BABYLON.SubMesh(0,2,c,30,6,s));for(let i=0;i<r[n].wallwindows.length;i++){const p=BABYLON.CSG.FromMesh(s);let e=this.app.project.objectDatas.find(r[n].wallwindows[i]);var h=e.instance.getBoundingInfo(),l=BABYLON.MeshBuilder.CreateBox((new Date).getTime().toString(),{height:h.maximum.y-h.minimum.y,width:h.maximum.x-h.minimum.x,depth:2*parseFloat(r[n].ply)+.1},this.app.scene);l.position=e.instance.position.clone(),l.position.y=(h.maximum.y-h.minimum.y)/2+e.height,l.rotation=e.instance.rotation.clone();h=BABYLON.CSG.FromMesh(l);let t=p.subtract(h);l.dispose(),s.dispose(),s=t.toMesh(r[n].id,null,this.app.scene,!0),s.setEnabled(!1)}let t=o.find(r[n].leftMap.modelId);t||(t={t:r[n].leftMap,walls:new Array},o.add(r[n].leftMap.modelId,t));let i=o.find(r[n].rightMap.modelId);i||(i={t:r[n].rightMap,walls:new Array},o.add(r[n].rightMap.modelId,i));var d=H.Tools.DeconsTructMesh(s,parseFloat(r[n].height),this.app);for(let e=0;e<d.length;e++)(2==e||3==e?t:4==e||5==e?i:o.find("body")).walls.push(d[e])}for(const u in o.map)if(0<o.find(u).walls.length){let e=new _(this.app);e.parentId=this.id,e.height=this.height,e.bind(o.find(u)),this.app.project.objectDatas.add(e.id,e)}}r=null,this.visualAngle=new M(this)}focus(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(const t in this.app.project.objectDatas.map){let e=this.app.project.objectDatas.find(t);e.parentId==this.id?e.setEnabled(e.isVisible):e.setEnabled(!1)}this.isEnabled=!0,(this.app.project.current=this).app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setEnabled(e){}getBounding(){var i,s;for(const e in this.app.project.objectDatas.map){let t=this.app.project.objectDatas.find(e);if(t.objectType!=y.ParkModel&&t.objectType!=y.Storey&&t.parentId==this.id){let e=t.instance.getBoundingInfo();i&&s||(i=s=e.boundingBox.center.clone()),i=BABYLON.Vector3.Minimize(i,e.minimum.add(t.instance.position)),s=BABYLON.Vector3.Maximize(s,e.maximum.add(t.instance.position))}}return i&&s||(i=BABYLON.Vector3.Zero(),s=new BABYLON.Vector3(12,this.height,8)),new BABYLON.BoundingInfo(i,s)}dispose(){}}class R extends T{constructor(e,t){super(e),this.height=0,this.id=t.id,this.objectType=t.objectType,this.name=t.name,this.parentId=t.parentId,this.height=t.height,this.objectType==y.ParkModel&&(this.height=0),this.index=t.index}bind(n,i=!1){let o=new Array;for(let t=0;t<n.length;t++){let e=n[t];e.objectType==y.Wall&&(e.height||(e.height=3.1),e.ply||(e.ply=.09),o.push(e))}let r=new m;for(let e=0;e<n.length;e++){let i=n[e];i.objectType==y.Corner&&(r.add(i.id,i.corner),2<i.pints.length&&(i.height=3.1,i.walls.forEach(t=>{o.forEach(e=>{t==e.id&&parseFloat(e.height)<i.height&&(i.height=parseFloat(e.height))})})))}let t=new Array;for(let e=0;e<n.length;e++){var s=n[e];s.objectType==y.Corner&&t.push(s)}let e=new D(this.app);if(e.height=this.height,e.bind(t)?(e.parentId=this.id,this.app.project.objectDatas.add(e.id,e)):e=null,!i)for(let i=0;i<n.length;i++){let s=n[i];if(s.objectType==y.Floor){s.vectors=new Array;let e=n[i];e.pints.forEach(e=>{r.find(e)||console.log(e),s.vectors.push(r.find(e))}),s.buckles=new Array,e.holes&&e.holes.forEach(e=>{let t=new Array;e.forEach(e=>t.push(r.find(e))),s.buckles.push(t)}),e.middles&&e.middles.forEach(t=>{let i=Array();for(let e=0;e<n.length;e++)n[e].id==t&&n[e].pints.forEach(e=>{e=r.find(e);i.push(new BABYLON.Vector3(e.x,0,e.z))});s.buckles.push(i)});let t=new I(this.app);t.height=this.height,t.bind(s),this.app.project.objectDatas.add(t.id,t)}}r=null;for(let t=0;t<n.length;t++){var a=n[t];let e;if(a.objectType==y.Window)e=new k(this.app);else if(a.objectType==y.Door)e=new O(this.app);else if(a.objectType!=y.Cabinet||i)if(a.objectType!=y.LeakWater||i)if(a.objectType!=y.VirtualBox||i)if(a.objectType!=y.UI3D||i)if(a.objectType!=y.Conduit||i)if(a.objectType!=y.Building||i){if(a.objectType==y.Wall)continue;if(a.objectType==y.Corner)continue;if(a.objectType==y.Floor)continue;if(i)continue;e=new T(this.app)}else e=new z(this.app);else e=new S(this.app);else e=new j(this.app);else e=new E(this.app);else e=new C(this.app);else e=new L(this.app);e.bind(a),this.app.project.objectDatas.add(e.id,e)}let c=new m;c.add("body",{t:"",walls:new Array});for(let n=0;n<o.length;n++){let s=BABYLON.MeshBuilder.ExtrudePolygon(o[n].id,{shape:[H.Tools.ToVector3(o[n].wtop),H.Tools.ToVector3(o[n].wleft),H.Tools.ToVector3(o[n].wbottom),H.Tools.ToVector3(o[n].wright)],depth:parseFloat(o[n].height),sideOrientation:BABYLON.Mesh.FRONTSIDE},this.app.scene);s.setEnabled(!1),s.position.y=parseFloat(o[n].height),s.subMeshes=[];var h=s.getTotalVertices();s.subMeshes.push(new BABYLON.SubMesh(0,0,h,0,6,s)),s.subMeshes.push(new BABYLON.SubMesh(0,1,h,18,6,s)),s.subMeshes.push(new BABYLON.SubMesh(0,2,h,30,6,s));for(let i=0;i<o[n].wallwindows.length;i++){const u=BABYLON.CSG.FromMesh(s);let e=this.app.project.objectDatas.find(o[n].wallwindows[i]);var l=e.instance.getBoundingInfo(),d=BABYLON.MeshBuilder.CreateBox((new Date).getTime().toString(),{height:l.maximum.y-l.minimum.y,width:l.maximum.x-l.minimum.x,depth:2*parseFloat(o[n].ply)+.1},this.app.scene);d.position=e.instance.position.clone(),d.position.y=(l.maximum.y-l.minimum.y)/2+e.height,d.rotation=e.instance.rotation.clone();l=BABYLON.CSG.FromMesh(d);let t=u.subtract(l);d.dispose(),s.dispose(),s=t.toMesh(o[n].id,null,this.app.scene,!0),s.setEnabled(!1)}let t=c.find(o[n].leftMap.modelId);t||(t={t:o[n].leftMap,walls:new Array},c.add(o[n].leftMap.modelId,t));let i=c.find(o[n].rightMap.modelId);i||(i={t:o[n].rightMap,walls:new Array},c.add(o[n].rightMap.modelId,i));var p=H.Tools.DeconsTructMesh(s,parseFloat(o[n].height),this.app);for(let e=0;e<p.length;e++)(2==e||3==e?t:4==e||5==e?i:c.find("body")).walls.push(p[e])}for(const f in c.map)if(0<c.find(f).walls.length){let e=new _(this.app);e.parentId=this.id,e.height=this.height,e.bind(c.find(f)),this.app.project.objectDatas.add(e.id,e)}o=null,this.restVisualAngle()}focus(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(const t in this.app.project.objectDatas.map){let e=this.app.project.objectDatas.find(t);e.parentId==this.id?e.setEnabled(!0):e.setEnabled(!1)}this.isEnabled=!0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setEnabled(e){}restVisualAngle(){var i,s;for(const e in this.app.project.objectDatas.map){let t=this.app.project.objectDatas.find(e);if(t.objectType!=y.ParkModel&&t.objectType!=y.Storey&&t.parentId==this.id){let e=t.instance.getBoundingInfo();i&&s||(i=s=e.boundingBox.center.clone()),i=BABYLON.Vector3.Minimize(i,e.minimum.add(t.instance.position)),s=BABYLON.Vector3.Maximize(s,e.maximum.add(t.instance.position))}}i&&s||(i=BABYLON.Vector3.Zero(),s=new BABYLON.Vector3(12,this.height,8)),this.visualAngle=u.getVisualAngle(new BABYLON.BoundingInfo(i,s),this.app),this.visualAngle.focus.y=this.height}}var F=i(3);class V{constructor(e,t){this.isOK=!1,this.app=t,this.ele=document.createElement("div"),this.ele.style.cssText="position: absolute;z-index:999999999; font-size: 10px;color: rgb(211, 211, 211);text-shadow:rgba(0, 0, 0, 0.2) 1px 1px 0; padding: 5px 8px;",e.appendChild(this.ele),this.close(),setInterval(()=>{var e;1e3<(new Date).getTime()-this.time&&this.isOK&&!this.text&&((e=this.app.project.objectDatas.find(this.id))&&(this.text=e.name))},100)}set text(e){this._text=e,(this.ele.innerText=e)&&(this.ele.style.display=null)}update(e){e.pickInfo.pickedMesh?e.pickInfo.pickedMesh.id!=this.id?(this.close(),this.id=e.pickInfo.pickedMesh.id,this.time=(new Date).getTime()):this.isOK=!0:this.close(),this.ele.style.top=e.event.offsetY+"px",this.ele.style.left=e.event.offsetX+20+"px"}close(){this.isOK=!1,this.time=(new Date).getTime(),this.ele.style.display="none",this.text=""}setBackground(e){this.url=e,this.ele.style.background="url("+this.url+") no-repeat",this.ele.style.backgroundSize="cover"}}var i={App:class{constructor(e,t){this.index=0,this.highQualityMode=!1;e=F.SceneLoader.create(e);this.canvas=e.canvas,this.engine=e.engine,this.scene=e.scene,this.rootUrl=t||"http://models.wodashijie.com/",this.Resources=new x(this),this.camera=new o(this),this.highlightLayer=new BABYLON.HighlightLayer("highlightLayer",this.scene),this.container=BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("screenUI"),this.Environment=new f(this),this.project=new w(this),H.EffectMgr=new A,this.engine.runRenderLoop(()=>{this.fps&&(this.fps.innerText=this.engine.getFps().toFixed()+" fps"),this.scene.render(),l.a.update()}),window.addEventListener("resize",()=>{this.engine.resize()}),this.scene.onPointerObservable.add(e=>{switch(e.type){case BABYLON.PointerEventTypes.POINTERMOVE:if(!this.tipsTool)return;e.pickInfo&&e.pickInfo.pickedPoint?this.tipsTool.update(e):this.tipsTool.close();break;case BABYLON.PointerEventTypes.POINTERWHEEL:var t;this.camera.isOverLook?this.camera._wheel(e.event):(t=1e3/(this.camera.camera.radius/20),this.camera.camera.panningSensibility=2e3<t?2e3:t<10?10:t)}}),this.scene.onKeyboardObservable.add(e=>{e.type===BABYLON.KeyboardEventTypes.KEYDOWN&&70===e.event.keyCode&&prompt("请复制输入框内的视角参数",JSON.stringify({alpha:this.camera.camera.alpha,focus:u.vector3ToJson(this.camera.camera.target),radius:this.camera.camera.radius,beta:this.camera.camera.beta}))})}create(f){return this.highQualityMode=f.highQualityMode,this.highQualityMode&&(this.Glow=new BABYLON.GlowLayer("glow",this.scene)),f.libraryUrl&&(this.Resources.resourcePath=f.libraryUrl),new Promise(async(n,t)=>{try{var o=await class{static read(s,n){return new Promise(function(e,t){let i=new XMLHttpRequest;i.open(s,n),i.onload=function(){200<=this.status&&this.status<300?e(i.response):t({status:this.status,statusText:i.statusText})},i.onerror=function(){t({status:this.status,statusText:i.statusText})},i.send()})}}.read("GET",f.fileUrl),r=JSON.parse(B.de(o));this.project.id=r.id,this.Environment.color="#7A7A7A"==r.environmentSettings.backColor?new BABYLON.Color4(0,.0588,.1176,1):new BABYLON.Color4(...BABYLON.Color3.FromHexString(r.environmentSettings.backColor).asArray(),1),this.Environment.fogDistance=r.environmentSettings.fogDensity,this.Environment.setFlexIntensity(r.environmentSettings.reflexIntensity),this.Environment.setReflexEnabled(r.environmentSettings.reflexEnabled),this.Environment.loadLight(r.environmentSettings.lights),this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,r.isOptimized&&await this.Resources.GetWalls(f.fileUrl.replace(r.id+".json",""),r.id);let t=new m;for(let e=0;e<r.scenes.length;e++){const d=r.scenes[e];!d.baseModel||".gltf"!=d.baseModel.extension||t.find(d.baseModel.modelId)||this.Resources.resources.find(d.baseModel.modelId)||(d.baseModel.objectType=d.objectType,t.add(d.baseModel.modelId,d.baseModel))}let e=0;for(const p in t.map)await this.Resources.loadModelMesh(t.find(p)),e++,f.progress&&f.progress(e/t.count()*.8);e=0,t=null;let i=new m,s=new m;for(let e=0;e<r.scenes.length;e++){var a,c=r.scenes[e];c.objectType==y.Storey||c.objectType==y.ParkModel?(a=new Y(this,c),this.project.objectDatas.add(a.id,a),i.add(a.id,a),s.add(a.id,new Array),c.objectType==y.ParkModel&&(this.project.root=a)):c.objectType==y.Floor&&i.add(c.id,c)}for(let e=0;e<r.scenes.length;e++){var h,l=r.scenes[e];l.objectType!=y.Storey&&l.objectType!=y.ParkModel&&((h=i.find(l.parentId)).objectType==y.Floor?s.find(h.parentId):s.find(l.parentId)).push(l)}for(const u in s.map)await this.project.objectDatas.find(u).bind(s.find(u)),e++,f.progress&&f.progress(.8+e/r.scenes.length*.2);i=null,s=null,this.project.optimization(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1,n(null),f.complete&&f.complete()}catch(e){t(e)}})}optimized(g){return g.libraryUrl&&(this.Resources.resourcePath=g.libraryUrl),new Promise(async(o,t)=>{try{let i=JSON.parse(B.de(g.file));this.project.id=i.id,this.Environment.color="#7A7A7A"==i.environmentSettings.backColor?new BABYLON.Color4(0,.0588,.1176,1):new BABYLON.Color4(...BABYLON.Color3.FromHexString(i.environmentSettings.backColor).asArray(),1),this.Environment.fogDistance=i.environmentSettings.fogDensity,this.Environment.setFlexIntensity(i.environmentSettings.reflexIntensity),this.Environment.setReflexEnabled(i.environmentSettings.reflexEnabled),this.Environment.loadLight(i.environmentSettings.lights),this.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let t=new m;for(let e=0;e<i.scenes.length;e++){const d=i.scenes[e];g._isOptimized&&"Window"!=d.objectType&&"Door"!=d.objectType||!d.baseModel||".gltf"!=d.baseModel.extension||t.find(d.baseModel.modelId)||this.Resources.resources.find(d.baseModel.modelId)||(d.baseModel.objectType=d.objectType,t.add(d.baseModel.modelId,d.baseModel))}let e=0;for(const p in t.map)await this.Resources.loadModelMesh(t.find(p)),e++,g.progress&&g.progress(e/t.count()*.8);e=0,t=null;let s=new m,n=new m;for(let e=0;e<i.scenes.length;e++){var r,a=i.scenes[e];a.objectType==y.Storey||a.objectType==y.ParkModel?(r=new R(this,a),this.project.objectDatas.add(r.id,r),s.add(r.id,r),n.add(r.id,new Array),a.objectType==y.ParkModel&&(this.project.root=r)):a.objectType==y.Floor&&s.add(a.id,a)}for(let e=0;e<i.scenes.length;e++){var c,h=i.scenes[e];h.objectType!=y.Storey&&h.objectType!=y.ParkModel&&((c=s.find(h.parentId)).objectType==y.Floor?n.find(c.parentId):n.find(h.parentId)).push(h)}for(const u in n.map)await this.project.objectDatas.find(u).bind(n.find(u),g._isOptimized),e++,g.progress&&g.progress(.8+e/i.scenes.length*.2);if(s=null,n=null,this.project.optimization(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1,g._isOptimized){let t=[];for(const f in this.project.objectDatas.map){var l=this.project.objectDatas.find(f);l.objectType!=y.Wall&&l.objectType!=y.Corner||t.push({id:l.id,parentId:l.parentId,objectType:"optimizedWall",baseModel:l.baseModel})}for(let e=0;e<i.scenes.length;e++)i.scenes[e].objectType!=y.Wall&&t.push(i.scenes[e]);i.isOptimized=!0,i.scenes=t}o(JSON.stringify(i)),g.complete&&g.complete()}catch(e){t(e)}})}outGltf(t){this.Resources.delete(!0);for(const i in this.project.objectDatas.map){let e=this.project.objectDatas.find(i);e.objectType!=y.Wall&&e.objectType!=y.Corner?(e.instance&&e.instance.dispose(),this.project.objectDatas.remove(i)):e.instance.material=null}return BABYLON.GLTF2Export.GLTFAsync(this.scene,this.project.id,{shouldExportNode:e=>{e=this.project.objectDatas.find(e.id);return e&&(e.objectType==y.Wall||e.objectType==y.Corner)}}).then(e=>{e.downloadFiles(),t&&t()})}showTips(){this.tipsTool=new V(this.canvas.parentElement,this)}showFps(e="position: absolute;left: 5px;bottom: 5px;z-index:999999999; font-size: 10px;color: rgb(0, 255, 0);text-shadow:rgba(0, 0, 0, 0.2) 1px 1px 0;"){this.fps||(this.fps=document.createElement("div"),this.canvas.parentElement.appendChild(this.fps)),this.fps.style.cssText=e}hideFps(){this.fps&&this.canvas.parentElement.removeChild(this.fps),this.fps=null}dispose(){this.fps&&this.canvas.parentElement.removeChild(this.fps),this.fps=null,this.project.delete(),this.Resources.delete(),this.engine.dispose()}showDebug(){this.scene.debugLayer.show()}},Tools:u,UI:class{static createIconFromMesh(e,t,i,s,n){return new F.IconFromMesh(e,t.instance,i,s,n,t.app.scene)}static createIcon(e,t,i,s){let n;t.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,n=new F.Icon(e),n.size=i,n.height=s,n.pint=new BABYLON.Mesh(t[0].id+"_pint");e=t[0].instance.getAbsolutePosition();return n.pint.position=e,n.pint.position.y+=s,n.rect=new BABYLON.GUI.Rectangle,n.rect.isPointerBlocker=!1,n.rect.width=i.width+"px",n.rect.height=i.height+"px",n.rect.thickness=0,t.app.container.addControl(n.rect),n.rect.linkWithMesh(n.pint),t.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,n}},ObjectType:y,EffectMgr:void 0,EffectType:v,EventType:g,EffectControls:class{static createCapacity(e,t,i,s="200px"){return F.Builder.createCapacity(e,t,i,s)}static createMatrixHeatMap(e,t){if(e.objectType==y.Floor)return F.Builder.createMatrixHeatMap({anchor:e.instance,rootUrl:e.app.rootUrl,FogTex:e.app.Resources.FogTex,container:e.app.container,config:t.config,displayValues:t.displayValues,height:t.height,isAlpha:t.isAlpha,isLevelRender:t.isLevelRender,isParticle:t.isParticle,radius:t.radius,range:t.range});console.error("矩阵云图对象必须为房间!")}static createColumnarHeatMap(e,t){return F.Builder.createColumnarHeatMap({anchor:e.instance,FogTex:e.app.Resources.FogTex,container:e.app.container,config:t.config,displayValues:t.displayValues,isAlpha:t.isAlpha,isLevelRender:t.isLevelRender,isParticle:t.isParticle,radius:t.radius,range:t.range})}},Dictionary:m},H=t.default=i}],d={},h.m=l,h.c=d,h.d=function(e,t,i){h.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},h.t=function(t,e){if(1&e&&(t=h(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(h.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)h.d(i,s,function(e){return t[e]}.bind(null,s));return i},h.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(t,"a",t),t},h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},h.p="",h(h.s=44).default;function h(e){if(d[e])return d[e].exports;var t=d[e]={i:e,l:!1,exports:{}};return l[e].call(t.exports,t,t.exports,h),t.l=!0,t.exports}var l,d});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mx3d",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "",
5
5
  "main": "mx3d.js",
6
6
  "typings": "./dist/index.d.ts",