!function(e){var t=window.webpackHotUpdate;window.webpackHotUpdate=function(e,r){!function(e,t){if(!w[e]||!b[e])return;for(var r in b[e]=!1,t)Object.prototype.hasOwnProperty.call(t,r)&&(m[r]=t[r]);0==--y&&0===_&&x()}(e,r),t&&t(e,r)};var r,n=!0,i="30aee07b03ee2ec2f922",o=1e4,s={},a=[],c=[];function d(e){var t=O[e];if(!t)return D;var n=function(n){return t.hot.active?(O[n]?-1===O[n].parents.indexOf(e)&&O[n].parents.push(e):(a=[e],r=n),-1===t.children.indexOf(n)&&t.children.push(n)):(console.warn("[HMR] unexpected require("+n+") from disposed module "+e),a=[]),D(n)},i=function(e){return{configurable:!0,enumerable:!0,get:function(){return D[e]},set:function(t){D[e]=t}}};for(var o in D)Object.prototype.hasOwnProperty.call(D,o)&&"e"!==o&&"t"!==o&&Object.defineProperty(n,o,i(o));return n.e=function(e){return"ready"===p&&f("prepare"),_++,D.e(e).then(t,(function(e){throw t(),e}));function t(){_--,"prepare"===p&&(g[e]||C(e),0===_&&0===y&&x())}},n.t=function(e,t){return 1&t&&(e=n(e)),D.t(e,-2&t)},n}function u(e){var t={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_disposeHandlers:[],_main:r!==e,active:!0,accept:function(e,r){if(void 0===e)t._selfAccepted=!0;else if("function"==typeof e)t._selfAccepted=e;else if("object"==typeof e)for(var n=0;n=0&&t._disposeHandlers.splice(r,1)},check:P,apply:j,status:function(e){if(!e)return p;l.push(e)},addStatusHandler:function(e){l.push(e)},removeStatusHandler:function(e){var t=l.indexOf(e);t>=0&&l.splice(t,1)},data:s[e]};return r=void 0,t}var l=[],p="idle";function f(e){p=e;for(var t=0;t0;){var i=n.pop(),o=i.id,s=i.chain;if((c=O[o])&&!c.hot._selfAccepted){if(c.hot._selfDeclined)return{type:"self-declined",chain:s,moduleId:o};if(c.hot._main)return{type:"unaccepted",chain:s,moduleId:o};for(var a=0;a ")),P.type){case"self-declined":t.onDeclined&&t.onDeclined(P),t.ignoreDeclined||(C=new Error("Aborted because of self decline: "+P.moduleId+I));break;case"declined":t.onDeclined&&t.onDeclined(P),t.ignoreDeclined||(C=new Error("Aborted because of declined dependency: "+P.moduleId+" in "+P.parentId+I));break;case"unaccepted":t.onUnaccepted&&t.onUnaccepted(P),t.ignoreUnaccepted||(C=new Error("Aborted because "+d+" is not accepted"+I));break;case"accepted":t.onAccepted&&t.onAccepted(P),x=!0;break;case"disposed":t.onDisposed&&t.onDisposed(P),j=!0;break;default:throw new Error("Unexception type "+P.type)}if(C)return f("abort"),Promise.reject(C);if(x)for(d in _[d]=m[d],l(y,P.outdatedModules),P.outdatedDependencies)Object.prototype.hasOwnProperty.call(P.outdatedDependencies,d)&&(h[d]||(h[d]=[]),l(h[d],P.outdatedDependencies[d]));j&&(l(y,[P.moduleId]),_[d]=g)}var z,M=[];for(n=0;n0;)if(d=S.pop(),c=O[d]){var X={},k=c.hot._disposeHandlers;for(o=0;o=0&&R.parents.splice(z,1))}}for(d in h)if(Object.prototype.hasOwnProperty.call(h,d)&&(c=O[d]))for(H=h[d],o=0;o=0&&c.children.splice(z,1);for(d in f("apply"),i=v,_)Object.prototype.hasOwnProperty.call(_,d)&&(e[d]=_[d]);var T=null;for(d in h)if(Object.prototype.hasOwnProperty.call(h,d)&&(c=O[d])){H=h[d];var U=[];for(n=0;n{let e=this._getCone(),t=[this.width,this.width,this.height],r=e.positions.map((e,r)=>e*t[r%3]);this._customPrimitive.position=this.xbsjPosition,this._customPrimitive.positions=r,this._customPrimitive.normals=void 0,this._customPrimitive.indices=e.indices};r(),this.disposers.push(XE.MVVM.watch(()=>({position:[...this.xbsjPosition],rotation:[...this.xbsjRotation],width:this.width,height:this.height}),r));const n=()=>{this._customPrimitive.show=this.show};n(),this.disposers.push(XE.MVVM.watch(()=>({show:this.show}),n)),this._registerEditing(),this.disposers.push(XE.MVVM.bind(this,"enabled",this,"show")),XE.Earth.Interaction.Picking.registerPickingParent(this._customPrimitive,this)}_getCone(){var e={};if(!e.positions){let t={positions:[],normals:[],uvs:[],indices:[]},r={radius:128,dircetion:3},n=new Cesium.Cartesian3(1e-6,0,0),i=new Array(r.radius).fill(0).map((e,t)=>{let n=2*Math.PI*t/r.radius;return new Array(r.dircetion).fill(0).map((e,t)=>{let i=.5*(t+1)/r.dircetion;return new Cesium.Cartesian3(i*Math.cos(n),i*Math.sin(n),.8660254037844386*(t+1)/r.dircetion*-1)})}),o=i[r.radius-1];i.forEach((e,r)=>{e.forEach((r,i)=>{0==i?this._triangle(r,n,o[i],t):this._face(r,e[i-1],o[i-1],o[i],t)}),o=e}),e.positions=new Float64Array(t.positions),e.normals=new Float64Array(t.normals),e.indices=new Uint16Array(t.indices),e.uvs=new Float32Array(t.uvs)}return e}_face(e,t,r,n,i){let o=this._getNormal(e,t,r),s=i.positions.length/3;i.indices.push(s,s+1,s+2,s,s+2,s+3),i.positions.push(e.x,e.y,e.z,t.x,t.y,t.z,r.x,r.y,r.z,n.x,n.y,n.z),i.normals.push(o.x,o.y,o.z,o.x,o.y,o.z,o.x,o.y,o.z,o.x,o.y,o.z);let a=new Cesium.Cartesian3(0,.5,.5);this._moveAndScale([e,t,r,n],a,i)}_triangle(e,t,r,n){let i=n.positions.length/3;n.indices.push(i,i+1,i+2);let o=this._getNormal(e,t,r);n.positions.push(e.x,e.y,e.z,t.x,t.y,t.z,r.x,r.y,r.z),n.normals.push(o.x,o.y,o.z,o.x,o.y,o.z,o.x,o.y,o.z);let s=new Cesium.Cartesian3(0,.5,.5);this._moveAndScale([e,t,r],s,n)}_getNormal(e,t,r){let n=new Cesium.Cartesian3,i=new Cesium.Cartesian3;Cesium.Cartesian3.subtract(e,t,n),Cesium.Cartesian3.subtract(t,r,i),Cesium.Cartesian3.normalize(n,n),Cesium.Cartesian3.normalize(i,i);let o=Cesium.Cartesian3.cross(n,i,new Cesium.Cartesian3);return Cesium.Cartesian3.normalize(o,o),o}_moveAndScale(e,t,r){e.forEach(e=>{let n=Cesium.Cartesian3.add(e,t,new Cesium.Cartesian3);r.uvs.push(n.y,n.z)})}_createCustomPrimitive(e){const t=XE.Obj.CustomPrimitive.getRenderState(!0,!0);t.cull.enabled=!1;const r={color:[0,.5,.5,.5],renderState:t,fragmentShaderSource:"\n\n\n varying vec3 v_positionEC;\n varying vec3 v_normalEC;\n varying vec2 v_st;\n varying vec4 v_color;\n uniform sampler2D u_image;\n uniform vec4 u_color;\n void main()\n {\n vec3 positionToEyeEC = -v_positionEC;\n vec3 normalEC = normalize(v_normalEC);\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n vec4 imageColor = texture2D(u_image, fract(v_st));\n\n vec3 diffuse = imageColor.rgb;\n float alpha = imageColor.a;\n\n diffuse *= v_color.rgb;\n alpha *= v_color.a;\n\n diffuse *= u_color.rgb;\n alpha *= u_color.a;\n\n gl_FragColor = vec4(diffuse, alpha);\n }\n ",translucent:!1};this._customPrimitive=new XE.Obj.CustomPrimitive(e),this._customPrimitive.xbsjFromJSON(r),this.disposers.push(()=>{this._customPrimitive=this._customPrimitive&&this._customPrimitive.destroy()})}flyTo(){this._customPrimitive.flyTo()}_registerEditing(){this.disposers.push(XE.Earth.Interaction.InteractionProperty.registerPositionEditing(this._earth,this,{positionProperty:"xbsjPosition"})),this.disposers.push(XE.Earth.Interaction.InteractionProperty.registerPositionPicking(this._earth,this,{positionPickingProperty:"creating",positionProperty:"xbsjPosition"})),this.disposers.push(XE.Earth.Interaction.InteractionProperty.registerRotationEditing(this._earth,this,{positionProperty:"xbsjPosition",rotationProperty:"xbsjRotation"}))}}n.defaultOptions={width:1e4,height:1e4,show:!0,xbsjPosition:[0,0,0],xbsjRotation:[0,0,0],xbsjScale:[1,1,1]},XE.Core.XbsjCzmObj.registerType(n,"CustomPrimitiveExt_Cone");var i=n;XE.Obj.CustomPrimitiveExt=XE.Obj.CustomPrimitiveExt||{},XE.Obj.CustomPrimitiveExt.Cone=i}]); //# sourceMappingURL=customPrimitiveCone.js.map