31 lines
44 KiB
JavaScript
31 lines
44 KiB
JavaScript
/**
|
|
* Cesium Sensor Volumes - https://github.com/jlouns/cesium-sensor-volumes
|
|
*
|
|
* Copyright 2016 Jonathan Lounsbury
|
|
* Copyright 2011-2014 Analytical Graphics Inc. and Cesium Contributors
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*
|
|
* Portions licensed separately.
|
|
* See https://github.com/jlouns/cesium-sensor-volumes/blob/master/LICENSE.md for full licensing details.
|
|
*
|
|
* Derived from Cesium Sensors - https://github.com/AnalyticalGraphicsInc/cesium-sensors
|
|
*/
|
|
|
|
/**
|
|
* @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
|
|
* Released under MIT license, http://github.com/requirejs/almond/LICENSE
|
|
*/
|
|
|
|
!function(){var e,i,r;!function(t){function o(e,i){return y.call(e,i)}function n(e,i){var r,t,o,n,s,a,u,l,c,m,d,h,C=i&&i.split("/"),f=g.map,p=f&&f["*"]||{};if(e){for(e=e.split("/"),s=e.length-1,g.nodeIdCompat&&A.test(e[s])&&(e[s]=e[s].replace(A,"")),"."===e[0].charAt(0)&&C&&(h=C.slice(0,C.length-1),e=h.concat(e)),c=0;c<e.length;c++)if("."===(d=e[c]))e.splice(c,1),c-=1;else if(".."===d){if(0===c||1===c&&".."===e[2]||".."===e[c-1])continue;c>0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}if((C||p)&&f){for(r=e.split("/"),c=r.length;c>0;c-=1){if(t=r.slice(0,c).join("/"),C)for(m=C.length;m>0;m-=1)if((o=f[C.slice(0,m).join("/")])&&(o=o[t])){n=o,a=c;break}if(n)break;!u&&p&&p[t]&&(u=p[t],l=c)}!n&&u&&(n=u,a=l),n&&(r.splice(0,a,n),e=r.join("/"))}return e}function s(e,i){return function(){var r=w.call(arguments,0);return"string"!=typeof r[0]&&1===r.length&&r.push(null),C.apply(t,r.concat([e,i]))}}function a(e){return function(i){return n(i,e)}}function u(e){return function(i){_[e]=i}}function l(e){if(o(v,e)){var i=v[e];delete v[e],S[e]=!0,h.apply(t,i)}if(!o(_,e)&&!o(S,e))throw new Error("No "+e);return _[e]}function c(e){var i,r=e?e.indexOf("!"):-1;return r>-1&&(i=e.substring(0,r),e=e.substring(r+1,e.length)),[i,e]}function m(e){return e?c(e):[]}function d(e){return function(){return g&&g.config&&g.config[e]||{}}}var h,C,f,p,_={},v={},g={},S={},y=Object.prototype.hasOwnProperty,w=[].slice,A=/\.js$/;f=function(e,i){var r,t=c(e),o=t[0],s=i[1];return e=t[1],o&&(o=n(o,s),r=l(o)),o?e=r&&r.normalize?r.normalize(e,a(s)):n(e,s):(e=n(e,s),t=c(e),o=t[0],e=t[1],o&&(r=l(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:r}},p={require:function(e){return s(e)},exports:function(e){var i=_[e];return void 0!==i?i:_[e]={}},module:function(e){return{id:e,uri:"",exports:_[e],config:d(e)}}},h=function(e,i,r,n){var a,c,d,h,C,g,y,w=[],A=typeof r;if(n=n||e,g=m(n),"undefined"===A||"function"===A){for(i=!i.length&&r.length?["require","exports","module"]:i,C=0;C<i.length;C+=1)if(h=f(i[C],g),"require"===(c=h.f))w[C]=p.require(e);else if("exports"===c)w[C]=p.exports(e),y=!0;else if("module"===c)a=w[C]=p.module(e);else if(o(_,c)||o(v,c)||o(S,c))w[C]=l(c);else{if(!h.p)throw new Error(e+" missing "+c);h.p.load(h.n,s(n,!0),u(c),{}),w[C]=_[c]}d=r?r.apply(_[e],w):void 0,e&&(a&&a.exports!==t&&a.exports!==_[e]?_[e]=a.exports:d===t&&y||(_[e]=d))}else e&&(_[e]=r)},e=i=C=function(e,i,r,o,n){if("string"==typeof e)return p[e]?p[e](i):l(f(e,m(i)).f);if(!e.splice){if(g=e,g.deps&&C(g.deps,g.callback),!i)return;i.splice?(e=i,i=r,r=null):e=t}return i=i||function(){},"function"==typeof r&&(r=o,o=n),o?h(t,e,i,r):setTimeout(function(){h(t,e,i,r)},4),C},C.config=function(e){return C(e)},e._defined=_,r=function(e,i,r){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");i.splice||(r=i,i=[]),o(_,e)||o(v,e)||(v[e]=[e,i,r])},r.amd={jQuery:!0}}(),r("conic/conic-sensor-graphics",["require","Cesium/Core/defaultValue","Cesium/Core/defined","Cesium/Core/defineProperties","Cesium/Core/DeveloperError","Cesium/Core/Event","Cesium/DataSources/createMaterialPropertyDescriptor","Cesium/DataSources/createPropertyDescriptor"],function(e){"use strict";var i=e("Cesium/Core/defaultValue"),r=e("Cesium/Core/defined"),t=e("Cesium/Core/defineProperties"),o=e("Cesium/Core/DeveloperError"),n=e("Cesium/Core/Event"),s=e("Cesium/DataSources/createMaterialPropertyDescriptor"),a=e("Cesium/DataSources/createPropertyDescriptor"),u=function(e){this._minimumClockAngle=void 0,this._minimumClockAngleSubscription=void 0,this._maximumClockAngle=void 0,this._maximumClockAngleSubscription=void 0,this._innerHalfAngle=void 0,this._innerHalfAngleSubscription=void 0,this._outerHalfAngle=void 0,this._outerHalfAngleSubscription=void 0,this._lateralSurfaceMaterial=void 0,this._lateralSurfaceMaterialSubscription=void 0,this._intersectionColor=void 0,this._intersectionColorSubscription=void 0,this._intersectionWidth=void 0,this._intersectionWidthSubscription=void 0,this._showIntersection=void 0,this._showIntersectionSubscription=void 0,this._radius=void 0,this._radiusSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._definitionChanged=new n,this.merge(i(e,i.EMPTY_OBJECT))};return t(u.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},minimumClockAngle:a("minimumClockAngle"),maximumClockAngle:a("maximumClockAngle"),innerHalfAngle:a("innerHalfAngle"),outerHalfAngle:a("outerHalfAngle"),lateralSurfaceMaterial:s("lateralSurfaceMaterial"),intersectionColor:a("intersectionColor"),intersectionWidth:a("intersectionWidth"),showIntersection:a("showIntersection"),radius:a("radius"),show:a("show")}),u.prototype.clone=function(e){return r(e)||(e=new u),e.show=this.show,e.innerHalfAngle=this.innerHalfAngle,e.outerHalfAngle=this.outerHalfAngle,e.minimumClockAngle=this.minimumClockAngle,e.maximumClockAngle=this.maximumClockAngle,e.radius=this.radius,e.showIntersection=this.showIntersection,e.intersectionColor=this.intersectionColor,e.intersectionWidth=this.intersectionWidth,e.lateralSurfaceMaterial=this.lateralSurfaceMaterial,e},u.prototype.merge=function(e){if(!r(e))throw new o("source is required.");this.show=i(this.show,e.show),this.innerHalfAngle=i(this.innerHalfAngle,e.innerHalfAngle),this.outerHalfAngle=i(this.outerHalfAngle,e.outerHalfAngle),this.minimumClockAngle=i(this.minimumClockAngle,e.minimumClockAngle),this.maximumClockAngle=i(this.maximumClockAngle,e.maximumClockAngle),this.radius=i(this.radius,e.radius),this.showIntersection=i(this.showIntersection,e.showIntersection),this.intersectionColor=i(this.intersectionColor,e.intersectionColor),this.intersectionWidth=i(this.intersectionWidth,e.intersectionWidth),this.lateralSurfaceMaterial=i(this.lateralSurfaceMaterial,e.lateralSurfaceMaterial)},u}),r("text",{load:function(e){throw new Error("Dynamic load not allowed: "+e)}}),r("text!custom/custom-sensor-volume-fs.glsl",[],function(){return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\nuniform float u_sensorRadius;\nuniform float u_normalDirection;\nvarying vec3 v_positionWC;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvec4 getColor(float sensorRadius, vec3 pointEC)\n{\nczm_materialInput materialInput;\nvec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz;\nmaterialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);\nmaterialInput.str = pointMC / sensorRadius;\nvec3 positionToEyeEC = -v_positionEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nvec3 normalEC = normalize(v_normalEC);\nmaterialInput.normalEC = u_normalDirection * normalEC;\nczm_material material = czm_getMaterial(materialInput);\nreturn mix(czm_phong(normalize(positionToEyeEC), material), vec4(material.diffuse, material.alpha), 0.4);\n}\nbool isOnBoundary(float value, float epsilon)\n{\nfloat width = getIntersectionWidth();\nfloat tolerance = width * epsilon;\n#ifdef GL_OES_standard_derivatives\nfloat delta = max(abs(dFdx(value)), abs(dFdy(value)));\nfloat pixels = width * delta;\nfloat temp = abs(value);\nreturn temp < tolerance && temp < pixels || (delta < 10.0 * tolerance && temp - delta < tolerance && temp < pixels);\n#else\nreturn abs(value) < tolerance;\n#endif\n}\nvec4 shade(bool isOnBoundary)\n{\nif (u_showIntersection && isOnBoundary)\n{\nreturn getIntersectionColor();\n}\nreturn getColor(u_sensorRadius, v_positionEC);\n}\nfloat ellipsoidSurfaceFunction(czm_ellipsoid ellipsoid, vec3 point)\n{\nvec3 scaled = ellipsoid.inverseRadii * point;\nreturn dot(scaled, scaled) - 1.0;\n}\nvoid main()\n{\nvec3 sensorVertexWC = czm_model[3].xyz;\nvec3 sensorVertexEC = czm_modelView[3].xyz;\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nfloat ellipsoidValue = ellipsoidSurfaceFunction(ellipsoid, v_positionWC);\nif (!u_showThroughEllipsoid)\n{\nif (ellipsoidValue < 0.0)\n{\ndiscard;\n}\nif (inSensorShadow(sensorVertexWC, ellipsoid, v_positionWC))\n{\ndiscard;\n}\n}\nif (distance(v_positionEC, sensorVertexEC) > u_sensorRadius)\n{\ndiscard;\n}\nbool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3);\ngl_FragColor = shade(isOnEllipsoid);\n}"}),r("text!custom/custom-sensor-volume-vs.glsl",[],function(){return"attribute vec4 position;\nattribute vec3 normal;\nvarying vec3 v_positionWC;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\ngl_Position = czm_modelViewProjection * position;\nv_positionWC = (czm_model * position).xyz;\nv_positionEC = (czm_modelView * position).xyz;\nv_normalEC = czm_normal * normal;\n}"}),r("text!sensor-volume.glsl",[],function(){return"uniform vec4 u_intersectionColor;\nuniform float u_intersectionWidth;\nbool inSensorShadow(vec3 coneVertexWC, czm_ellipsoid ellipsoidEC, vec3 pointWC)\n{\nvec3 D = ellipsoidEC.inverseRadii;\nvec3 q = D * coneVertexWC;\nfloat qMagnitudeSquared = dot(q, q);\nfloat test = qMagnitudeSquared - 1.0;\nvec3 temp = D * pointWC - q;\nfloat d = dot(temp, q);\nreturn (d < -test) && (d / length(temp) < -sqrt(test));\n}\nvec4 getIntersectionColor()\n{\nreturn u_intersectionColor;\n}\nfloat getIntersectionWidth()\n{\nreturn u_intersectionWidth;\n}\nvec2 sensor2dTextureCoordinates(float sensorRadius, vec3 pointMC)\n{\nfloat t = pointMC.z / sensorRadius;\nfloat s = 1.0 + (atan(pointMC.y, pointMC.x) / czm_twoPi);\ns = s - floor(s);\nreturn vec2(s, t);\n}"}),r("custom/custom-sensor-volume",["require","Cesium/Core/BoundingSphere","Cesium/Core/Cartesian3","Cesium/Core/Color","Cesium/Core/combine","Cesium/Core/ComponentDatatype","Cesium/Core/defaultValue","Cesium/Core/defined","Cesium/Core/defineProperties","Cesium/Core/destroyObject","Cesium/Core/DeveloperError","Cesium/Core/Matrix4","Cesium/Core/PrimitiveType","Cesium/Renderer/Buffer","Cesium/Renderer/BufferUsage","Cesium/Renderer/DrawCommand","Cesium/Renderer/Pass","Cesium/Renderer/RenderState","Cesium/Renderer/ShaderProgram","Cesium/Renderer/ShaderSource","Cesium/Renderer/VertexArray","Cesium/Scene/BlendingState","Cesium/Scene/CullFace","Cesium/Scene/Material","Cesium/Scene/SceneMode","text!./custom-sensor-volume-fs.glsl","text!./custom-sensor-volume-vs.glsl","text!../sensor-volume.glsl"],function(e){"use strict";function i(e){for(var i=e._directions,r=i.length,n=new Float32Array(3*r),s=isFinite(e.radius)?e.radius:T,a=[o.ZERO],u=r-2,l=r-1,c=0;c<r;u=l++,l=c++){var m=o.fromSpherical(i[u],k),d=o.fromSpherical(i[l],H),h=o.fromSpherical(i[c],O),C=Math.max(o.angleBetween(m,d),o.angleBetween(d,h)),f=s/Math.cos(.5*C),p=o.multiplyByScalar(d,f,new o);n[3*l]=p.x,n[3*l+1]=p.y,n[3*l+2]=p.z,a.push(p)}return t.fromPoints(a,e._boundingSphere),n}function r(e,r){for(var t=i(e),n=e._directions.length,s=new Float32Array(18*n),u=0,l=n-1,c=0;c<n;l=c++){var m=new o(t[3*l],t[3*l+1],t[3*l+2]),d=new o(t[3*c],t[3*c+1],t[3*c+2]),h=o.normalize(o.cross(d,m,z),z);s[u++]=0,s[u++]=0,s[u++]=0,s[u++]=h.x,s[u++]=h.y,s[u++]=h.z,s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,s[u++]=h.x,s[u++]=h.y,s[u++]=h.z,s[u++]=m.x,s[u++]=m.y,s[u++]=m.z,s[u++]=h.x,s[u++]=h.y,s[u++]=h.z}var C=f.createVertexBuffer({context:r,typedArray:new Float32Array(s),usage:p.STATIC_DRAW}),_=6*Float32Array.BYTES_PER_ELEMENT,v=[{index:I.position,vertexBuffer:C,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:0,strideInBytes:_},{index:I.normal,vertexBuffer:C,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:3*Float32Array.BYTES_PER_ELEMENT,strideInBytes:_}];return new w({context:r,attributes:v})}var t=e("Cesium/Core/BoundingSphere"),o=e("Cesium/Core/Cartesian3"),n=e("Cesium/Core/Color"),s=e("Cesium/Core/combine"),a=e("Cesium/Core/ComponentDatatype"),u=e("Cesium/Core/defaultValue"),l=e("Cesium/Core/defined"),c=e("Cesium/Core/defineProperties"),m=e("Cesium/Core/destroyObject"),d=e("Cesium/Core/DeveloperError"),h=e("Cesium/Core/Matrix4"),C=e("Cesium/Core/PrimitiveType"),f=e("Cesium/Renderer/Buffer"),p=e("Cesium/Renderer/BufferUsage"),_=e("Cesium/Renderer/DrawCommand"),v=e("Cesium/Renderer/Pass"),g=e("Cesium/Renderer/RenderState"),S=e("Cesium/Renderer/ShaderProgram"),y=e("Cesium/Renderer/ShaderSource"),w=e("Cesium/Renderer/VertexArray"),A=e("Cesium/Scene/BlendingState"),M=e("Cesium/Scene/CullFace"),x=e("Cesium/Scene/Material"),E=e("Cesium/Scene/SceneMode"),D=e("text!./custom-sensor-volume-fs.glsl"),P=e("text!./custom-sensor-volume-vs.glsl"),b=e("text!../sensor-volume.glsl"),I={position:0,normal:1},T=5906376272e3,V=function(e){e=u(e,u.EMPTY_OBJECT),this._pickId=void 0,this._pickPrimitive=u(e._pickPrimitive,this),this._frontFaceColorCommand=new _,this._backFaceColorCommand=new _,this._pickCommand=new _,this._boundingSphere=new t,this._boundingSphereWC=new t,this._frontFaceColorCommand.primitiveType=C.TRIANGLES,this._frontFaceColorCommand.boundingVolume=this._boundingSphereWC,this._frontFaceColorCommand.owner=this,this._backFaceColorCommand.primitiveType=this._frontFaceColorCommand.primitiveType,this._backFaceColorCommand.boundingVolume=this._frontFaceColorCommand.boundingVolume,this._backFaceColorCommand.owner=this,this._pickCommand.primitiveType=this._frontFaceColorCommand.primitiveType,this._pickCommand.boundingVolume=this._frontFaceColorCommand.boundingVolume,this._pickCommand.owner=this,this.show=u(e.show,!0),this.showIntersection=u(e.showIntersection,!0),this.showThroughEllipsoid=u(e.showThroughEllipsoid,!1),this._showThroughEllipsoid=this.showThroughEllipsoid,this.modelMatrix=h.clone(u(e.modelMatrix,h.IDENTITY)),this._modelMatrix=new h,this.radius=u(e.radius,Number.POSITIVE_INFINITY),this._directions=void 0,this._directionsDirty=!1,this.directions=l(e.directions)?e.directions:[],this.lateralSurfaceMaterial=l(e.lateralSurfaceMaterial)?e.lateralSurfaceMaterial:x.fromType(x.ColorType),this._lateralSurfaceMaterial=void 0,this._translucent=void 0,this.intersectionColor=n.clone(u(e.intersectionColor,n.WHITE)),this.intersectionWidth=u(e.intersectionWidth,5),this.id=e.id,this._id=void 0;var i=this;this._uniforms={u_showThroughEllipsoid:function(){return i.showThroughEllipsoid},u_showIntersection:function(){return i.showIntersection},u_sensorRadius:function(){return isFinite(i.radius)?i.radius:T},u_intersectionColor:function(){return i.intersectionColor},u_intersectionWidth:function(){return i.intersectionWidth},u_normalDirection:function(){return 1}},this._mode=E.SCENE3D};c(V.prototype,{directions:{get:function(){return this._directions},set:function(e){this._directions=e,this._directionsDirty=!0}}});var k=new o,H=new o,O=new o,z=new o;return V.prototype.update=function(e){if(this._mode=e.mode,this.show&&this._mode===E.SCENE3D){var i=e.context,o=e.commandList;if(this.radius<0)throw new d("this.radius must be greater than or equal to zero.");if(!l(this.lateralSurfaceMaterial))throw new d("this.lateralSurfaceMaterial must be defined.");var n=this.lateralSurfaceMaterial.isTranslucent();if(this._showThroughEllipsoid!==this.showThroughEllipsoid||!l(this._frontFaceColorCommand.renderState)||this._translucent!==n){this._showThroughEllipsoid=this.showThroughEllipsoid,this._translucent=n;var a;n?(a=g.fromCache({depthTest:{enabled:!this.showThroughEllipsoid},depthMask:!1,blending:A.ALPHA_BLEND,cull:{enabled:!0,face:M.BACK}}),this._frontFaceColorCommand.renderState=a,this._frontFaceColorCommand.pass=v.TRANSLUCENT,a=g.fromCache({depthTest:{enabled:!this.showThroughEllipsoid},depthMask:!1,blending:A.ALPHA_BLEND,cull:{enabled:!0,face:M.FRONT}}),this._backFaceColorCommand.renderState=a,this._backFaceColorCommand.pass=v.TRANSLUCENT,a=g.fromCache({depthTest:{enabled:!this.showThroughEllipsoid},depthMask:!1,blending:A.ALPHA_BLEND}),this._pickCommand.renderState=a):(a=g.fromCache({depthTest:{enabled:!0},depthMask:!0}),this._frontFaceColorCommand.renderState=a,this._frontFaceColorCommand.pass=v.OPAQUE,a=g.fromCache({depthTest:{enabled:!0},depthMask:!0}),this._pickCommand.renderState=a)}var u=this._directionsDirty;if(u){this._directionsDirty=!1,this._va=this._va&&this._va.destroy();var c=this._directions;c&&c.length>=3&&(this._frontFaceColorCommand.vertexArray=r(this,i),this._backFaceColorCommand.vertexArray=this._frontFaceColorCommand.vertexArray,this._pickCommand.vertexArray=this._frontFaceColorCommand.vertexArray)}if(l(this._frontFaceColorCommand.vertexArray)){var m=e.passes,C=!h.equals(this.modelMatrix,this._modelMatrix);C&&h.clone(this.modelMatrix,this._modelMatrix),(u||C)&&t.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC),this._frontFaceColorCommand.modelMatrix=this.modelMatrix,this._backFaceColorCommand.modelMatrix=this._frontFaceColorCommand.modelMatrix,this._pickCommand.modelMatrix=this._frontFaceColorCommand.modelMatrix;var f=this._lateralSurfaceMaterial!==this.lateralSurfaceMaterial;if(this._lateralSurfaceMaterial=this.lateralSurfaceMaterial,this._lateralSurfaceMaterial.update(i),m.render){var p=this._frontFaceColorCommand,_=this._backFaceColorCommand;if(f||!l(p.shaderProgram)){var w=new y({sources:[b,this._lateralSurfaceMaterial.shaderSource,D]});p.shaderProgram=S.replaceCache({context:i,shaderProgram:p.shaderProgram,vertexShaderSource:P,fragmentShaderSource:w,attributeLocations:I}),p.uniformMap=s(this._uniforms,this._lateralSurfaceMaterial._uniforms),_.shaderProgram=p.shaderProgram,_.uniformMap=s(this._uniforms,this._lateralSurfaceMaterial._uniforms),_.uniformMap.u_normalDirection=function(){return-1}}n?o.push(this._backFaceColorCommand,this._frontFaceColorCommand):o.push(this._frontFaceColorCommand)}if(m.pick){var x=this._pickCommand;if(l(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=i.createPickId({primitive:this._pickPrimitive,id:this.id})),f||!l(x.shaderProgram)){var T=new y({sources:[b,this._lateralSurfaceMaterial.shaderSource,D],pickColorQualifier:"uniform"});x.shaderProgram=S.replaceCache({context:i,shaderProgram:x.shaderProgram,vertexShaderSource:P,fragmentShaderSource:T,attributeLocations:I});var V=this,k={czm_pickColor:function(){return V._pickId.color}};x.uniformMap=s(s(this._uniforms,this._lateralSurfaceMaterial._uniforms),k)}x.pass=n?v.TRANSLUCENT:v.OPAQUE,o.push(x)}}}},V.prototype.isDestroyed=function(){return!1},V.prototype.destroy=function(){return this._frontFaceColorCommand.vertexArray=this._frontFaceColorCommand.vertexArray&&this._frontFaceColorCommand.vertexArray.destroy(),this._frontFaceColorCommand.shaderProgram=this._frontFaceColorCommand.shaderProgram&&this._frontFaceColorCommand.shaderProgram.destroy(),this._pickCommand.shaderProgram=this._pickCommand.shaderProgram&&this._pickCommand.shaderProgram.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),m(this)},V}),r("util/remove-primitive",["require","Cesium/Core/defined"],function(e){"use strict";var i=e("Cesium/Core/defined");return function(e,r,t){var o=r[e.id];if(i(o)){var n=o.primitive;t.remove(n),n.isDestroyed()||n.destroy(),delete r[e.id]}}}),r("conic/conic-sensor-visualizer",["require","Cesium/Core/AssociativeArray","Cesium/Core/Cartesian3","Cesium/Core/Color","Cesium/Core/defined","Cesium/Core/destroyObject","Cesium/Core/DeveloperError","Cesium/Core/Math","Cesium/Core/Matrix3","Cesium/Core/Matrix4","Cesium/Core/Quaternion","Cesium/Core/Spherical","Cesium/DataSources/MaterialProperty","Cesium/DataSources/Property","../custom/custom-sensor-volume","../util/remove-primitive"],function(e){"use strict";function i(e,i,r,t){var o=i[e];s(o)||(o=new h,i[e]=o),o.clock=r,o.cone=t,o.magnitude=1}function r(e,r,t,o,n){var s,a=e.directions,u=0,c=l.toRadians(2);if(0===r&&t===l.TWO_PI)for(s=0;s<l.TWO_PI;s+=c)i(u++,a,s,n);else{for(s=r;s<t;s+=c)i(u++,a,s,n);if(i(u++,a,t,n),o){for(s=t;s>r;s-=c)i(u++,a,s,o);i(u++,a,r,o)}else i(u++,a,t,0)}a.length=u,e.directions=a}var t=e("Cesium/Core/AssociativeArray"),o=e("Cesium/Core/Cartesian3"),n=e("Cesium/Core/Color"),s=e("Cesium/Core/defined"),a=e("Cesium/Core/destroyObject"),u=e("Cesium/Core/DeveloperError"),l=e("Cesium/Core/Math"),c=e("Cesium/Core/Matrix3"),m=e("Cesium/Core/Matrix4"),d=e("Cesium/Core/Quaternion"),h=e("Cesium/Core/Spherical"),C=e("Cesium/DataSources/MaterialProperty"),f=e("Cesium/DataSources/Property"),p=e("../custom/custom-sensor-volume"),_=e("../util/remove-primitive"),v=n.WHITE,g=Number.POSITIVE_INFINITY,S=new c,y=new o,w=new d,A=function(e,i){if(!s(e))throw new u("scene is required.");if(!s(i))throw new u("entityCollection is required.");i.collectionChanged.addEventListener(A.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=i,this._hash={},this._entitiesToVisualize=new t,this._onCollectionChanged(i,i.values,[],[])};return A.prototype.update=function(e){if(!s(e))throw new u("time is required.");for(var i=this._entitiesToVisualize.values,t=this._hash,n=this._primitives,a=0,h=i.length;a<h;a++){var _,A,M=i[a],x=M._conicSensor,E=t[M.id],D=M.isShowing&&M.isAvailable(e)&&f.getValueOrDefault(x._show,e,!0);if(D&&(_=f.getValueOrUndefined(M._position,e,y),A=f.getValueOrUndefined(M._orientation,e,w),D=s(_)&&s(A)),D){var P=s(E)?E.primitive:void 0;s(P)||(P=new p,P.id=M,n.add(P),E={primitive:P,position:void 0,orientation:void 0,minimumClockAngle:void 0,maximumClockAngle:void 0,innerHalfAngle:void 0,outerHalfAngle:void 0},t[M.id]=E),o.equals(_,E.position)&&d.equals(A,E.orientation)||(m.fromRotationTranslation(c.fromQuaternion(A,S),_,P.modelMatrix),E.position=o.clone(_,E.position),E.orientation=d.clone(A,E.orientation)),P.show=!0;var b=f.getValueOrDefault(x._minimumClockAngle,e,0),I=f.getValueOrDefault(x._maximumClockAngle,e,l.TWO_PI),T=f.getValueOrDefault(x._innerHalfAngle,e,0),V=f.getValueOrDefault(x._outerHalfAngle,e,Math.PI);b===E.minimumClockAngle&&I===E.maximumClockAngle&&T===E.innerHalfAngle&&V===E.outerHalfAngle||(r(P,b,I,T,V),E.innerHalfAngle=T,E.maximumClockAngle=I,E.outerHalfAngle=V,E.minimumClockAngle=b),P.radius=f.getValueOrDefault(x._radius,e,g),P.lateralSurfaceMaterial=C.getValue(e,x._lateralSurfaceMaterial,P.lateralSurfaceMaterial),P.intersectionColor=f.getValueOrClonedDefault(x._intersectionColor,e,v,P.intersectionColor),P.intersectionWidth=f.getValueOrDefault(x._intersectionWidth,e,1)}else s(E)&&(E.primitive.show=!1)}return!0},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){for(var e=this._entitiesToVisualize.values,i=this._hash,r=this._primitives,t=e.length-1;t>-1;t--)_(e[t],i,r);return a(this)},A.prototype._onCollectionChanged=function(e,i,r,t){var o,n,a=this._entitiesToVisualize,u=this._hash,l=this._primitives;for(o=i.length-1;o>-1;o--)n=i[o],s(n._conicSensor)&&s(n._position)&&s(n._orientation)&&a.set(n.id,n);for(o=t.length-1;o>-1;o--)n=t[o],s(n._conicSensor)&&s(n._position)&&s(n._orientation)?a.set(n.id,n):(_(n,u,l),a.remove(n.id));for(o=r.length-1;o>-1;o--)n=r[o],_(n,u,l),a.remove(n.id)},A}),r("custom/custom-pattern-sensor-graphics",["require","Cesium/Core/defaultValue","Cesium/Core/defined","Cesium/Core/defineProperties","Cesium/Core/DeveloperError","Cesium/Core/Event","Cesium/DataSources/createMaterialPropertyDescriptor","Cesium/DataSources/createPropertyDescriptor"],function(e){"use strict";var i=e("Cesium/Core/defaultValue"),r=e("Cesium/Core/defined"),t=e("Cesium/Core/defineProperties"),o=e("Cesium/Core/DeveloperError"),n=e("Cesium/Core/Event"),s=e("Cesium/DataSources/createMaterialPropertyDescriptor"),a=e("Cesium/DataSources/createPropertyDescriptor"),u=function(e){this._directions=void 0,this._directionsSubscription=void 0,this._lateralSurfaceMaterial=void 0,this._lateralSurfaceMaterialSubscription=void 0,this._intersectionColor=void 0,this._intersectionColorSubscription=void 0,this._intersectionWidth=void 0,this._intersectionWidthSubscription=void 0,this._showIntersection=void 0,this._showIntersectionSubscription=void 0,this._radius=void 0,this._radiusSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._definitionChanged=new n,this.merge(i(e,i.EMPTY_OBJECT))};return t(u.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},directions:a("directions"),lateralSurfaceMaterial:s("lateralSurfaceMaterial"),intersectionColor:a("intersectionColor"),intersectionWidth:a("intersectionWidth"),showIntersection:a("showIntersection"),radius:a("radius"),show:a("show")}),u.prototype.clone=function(e){return r(e)||(e=new u),e.directions=this.directions,e.radius=this.radius,e.show=this.show,e.showIntersection=this.showIntersection,e.intersectionColor=this.intersectionColor,e.intersectionWidth=this.intersectionWidth,e.lateralSurfaceMaterial=this.lateralSurfaceMaterial,e},u.prototype.merge=function(e){if(!r(e))throw new o("source is required.");this.directions=i(this.directions,e.directions),this.radius=i(this.radius,e.radius),this.show=i(this.show,e.show),this.showIntersection=i(this.showIntersection,e.showIntersection),this.intersectionColor=i(this.intersectionColor,e.intersectionColor),this.intersectionWidth=i(this.intersectionWidth,e.intersectionWidth),this.lateralSurfaceMaterial=i(this.lateralSurfaceMaterial,e.lateralSurfaceMaterial)},u}),r("custom/custom-pattern-sensor-visualizer",["require","Cesium/Core/AssociativeArray","Cesium/Core/Cartesian3","Cesium/Core/Color","Cesium/Core/defined","Cesium/Core/destroyObject","Cesium/Core/DeveloperError","Cesium/Core/Matrix3","Cesium/Core/Matrix4","Cesium/Core/Quaternion","Cesium/DataSources/MaterialProperty","Cesium/DataSources/Property","../custom/custom-sensor-volume","../util/remove-primitive"],function(e){"use strict";var i=e("Cesium/Core/AssociativeArray"),r=e("Cesium/Core/Cartesian3"),t=e("Cesium/Core/Color"),o=e("Cesium/Core/defined"),n=e("Cesium/Core/destroyObject"),s=e("Cesium/Core/DeveloperError"),a=e("Cesium/Core/Matrix3"),u=e("Cesium/Core/Matrix4"),l=e("Cesium/Core/Quaternion"),c=e("Cesium/DataSources/MaterialProperty"),m=e("Cesium/DataSources/Property"),d=e("../custom/custom-sensor-volume"),h=e("../util/remove-primitive"),C=t.WHITE,f=Number.POSITIVE_INFINITY,p=new a,_=new r,v=new l,g=function(e,r){if(!o(e))throw new s("scene is required.");if(!o(r))throw new s("entityCollection is required.");r.collectionChanged.addEventListener(g.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=r,this._hash={},this._entitiesToVisualize=new i,this._onCollectionChanged(r,r.values,[],[])};return g.prototype.update=function(e){if(!o(e))throw new s("time is required.");for(var i=this._entitiesToVisualize.values,t=this._hash,n=this._primitives,h=0,g=i.length;h<g;h++){var S,y,w,A=i[h],M=A._customPatternSensor,x=t[A.id],E=A.isShowing&&A.isAvailable(e)&&m.getValueOrDefault(M._show,e,!0);if(E&&(S=m.getValueOrUndefined(A._position,e,_),y=m.getValueOrUndefined(A._orientation,e,v),w=m.getValueOrUndefined(M._directions,e),E=o(S)&&o(y)&&o(w)),E){var D=o(x)?x.primitive:void 0;o(D)||(D=new d,D.id=A,n.add(D),x={primitive:D,position:void 0,orientation:void 0},t[A.id]=x),r.equals(S,x.position)&&l.equals(y,x.orientation)||(u.fromRotationTranslation(a.fromQuaternion(y,p),S,D.modelMatrix),x.position=r.clone(S,x.position),x.orientation=l.clone(y,x.orientation)),D.show=!0,D.directions=w,D.radius=m.getValueOrDefault(M._radius,e,f),D.lateralSurfaceMaterial=c.getValue(e,M._lateralSurfaceMaterial,D.lateralSurfaceMaterial),D.intersectionColor=m.getValueOrClonedDefault(M._intersectionColor,e,C,D.intersectionColor),D.intersectionWidth=m.getValueOrDefault(M._intersectionWidth,e,1)}else o(x)&&(x.primitive.show=!1)}return!0},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){for(var e=this._entitiesToVisualize.values,i=this._hash,r=this._primitives,t=e.length-1;t>-1;t--)h(e[t],i,r);return n(this)},g.prototype._onCollectionChanged=function(e,i,r,t){var n,s,a=this._entitiesToVisualize,u=this._hash,l=this._primitives;for(n=i.length-1;n>-1;n--)s=i[n],o(s._customPatternSensor)&&o(s._position)&&o(s._orientation)&&a.set(s.id,s);for(n=t.length-1;n>-1;n--)s=t[n],o(s._customPatternSensor)&&o(s._position)&&o(s._orientation)?a.set(s.id,s):(h(s,u,l),a.remove(s.id));for(n=r.length-1;n>-1;n--)s=r[n],h(s,u,l),a.remove(s.id)},g}),r("rectangular/rectangular-sensor-graphics",["require","Cesium/Core/defaultValue","Cesium/Core/defined","Cesium/Core/defineProperties","Cesium/Core/DeveloperError","Cesium/Core/Event","Cesium/DataSources/createPropertyDescriptor"],function(e){"use strict";var i=e("Cesium/Core/defaultValue"),r=e("Cesium/Core/defined"),t=e("Cesium/Core/defineProperties"),o=e("Cesium/Core/DeveloperError"),n=e("Cesium/Core/Event"),s=e("Cesium/DataSources/createPropertyDescriptor"),a=function(){this._xHalfAngle=void 0,this._xHalfAngleSubscription=void 0,this._yHalfAngle=void 0,this._yHalfAngleSubscription=void 0,this._lateralSurfaceMaterial=void 0,this._lateralSurfaceMaterialSubscription=void 0,this._intersectionColor=void 0,this._intersectionColorSubscription=void 0,this._intersectionWidth=void 0,this._intersectionWidthSubscription=void 0,this._showIntersection=void 0,this._showIntersectionSubscription=void 0,this._radius=void 0,this._radiusSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._definitionChanged=new n};return t(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},xHalfAngle:s("xHalfAngle"),yHalfAngle:s("yHalfAngle"),lateralSurfaceMaterial:s("lateralSurfaceMaterial"),intersectionColor:s("intersectionColor"),intersectionWidth:s("intersectionWidth"),showIntersection:s("showIntersection"),radius:s("radius"),show:s("show")}),a.prototype.clone=function(e){return r(e)||(e=new a),e.xHalfAngle=this.xHalfAngle,e.yHalfAngle=this.yHalfAngle,e.radius=this.radius,e.show=this.show,e.showIntersection=this.showIntersection,e.intersectionColor=this.intersectionColor,e.intersectionWidth=this.intersectionWidth,e.lateralSurfaceMaterial=this.lateralSurfaceMaterial,e},a.prototype.merge=function(e){if(!r(e))throw new o("source is required.");this.xHalfAngle=i(this.xHalfAngle,e.xHalfAngle),this.yHalfAngle=i(this.yHalfAngle,e.yHalfAngle),this.radius=i(this.radius,e.radius),this.show=i(this.show,e.show),this.showIntersection=i(this.showIntersection,e.showIntersection),this.intersectionColor=i(this.intersectionColor,e.intersectionColor),this.intersectionWidth=i(this.intersectionWidth,e.intersectionWidth),this.lateralSurfaceMaterial=i(this.lateralSurfaceMaterial,e.lateralSurfaceMaterial)},a}),r("rectangular/rectangular-pyramid-sensor-volume",["require","Cesium/Core/clone","Cesium/Core/defaultValue","Cesium/Core/defined","Cesium/Core/defineProperties","Cesium/Core/destroyObject","Cesium/Core/DeveloperError","Cesium/Core/Math","Cesium/Core/Spherical","../custom/custom-sensor-volume"],function(e){"use strict";function i(e,i,r,t){var o=i[e];n(o)||(o=new c,i[e]=o),o.clock=r,o.cone=t,o.magnitude=1}function r(e){var r=e._customSensor.directions,t=Math.tan(Math.min(e._xHalfAngle,l.toRadians(89))),o=Math.tan(Math.min(e._yHalfAngle,l.toRadians(89))),n=Math.atan(t/o),s=Math.atan(Math.sqrt(t*t+o*o));i(0,r,n,s),i(1,r,l.toRadians(180)-n,s),i(2,r,l.toRadians(180)+n,s),i(3,r,-n,s),r.length=4,e._customSensor.directions=r}var t=e("Cesium/Core/clone"),o=e("Cesium/Core/defaultValue"),n=e("Cesium/Core/defined"),s=e("Cesium/Core/defineProperties"),a=e("Cesium/Core/destroyObject"),u=e("Cesium/Core/DeveloperError"),l=e("Cesium/Core/Math"),c=e("Cesium/Core/Spherical"),m=e("../custom/custom-sensor-volume"),d=function(e){e=o(e,o.EMPTY_OBJECT);var i=t(e);i._pickPrimitive=o(e._pickPrimitive,this),i.directions=void 0,this._customSensor=new m(i),this._xHalfAngle=o(e.xHalfAngle,l.PI_OVER_TWO),this._yHalfAngle=o(e.yHalfAngle,l.PI_OVER_TWO),r(this)};return s(d.prototype,{xHalfAngle:{get:function(){return this._xHalfAngle},set:function(e){if(e>l.PI_OVER_TWO)throw new u("xHalfAngle must be less than or equal to 90 degrees.");this._xHalfAngle!==e&&(this._xHalfAngle=e,r(this))}},yHalfAngle:{get:function(){return this._yHalfAngle},set:function(e){if(e>l.PI_OVER_TWO)throw new u("yHalfAngle must be less than or equal to 90 degrees.");this._yHalfAngle!==e&&(this._yHalfAngle=e,r(this))}},show:{get:function(){return this._customSensor.show},set:function(e){this._customSensor.show=e}},showIntersection:{get:function(){return this._customSensor.showIntersection},
|
|
set:function(e){this._customSensor.showIntersection=e}},showThroughEllipsoid:{get:function(){return this._customSensor.showThroughEllipsoid},set:function(e){this._customSensor.showThroughEllipsoid=e}},modelMatrix:{get:function(){return this._customSensor.modelMatrix},set:function(e){this._customSensor.modelMatrix=e}},radius:{get:function(){return this._customSensor.radius},set:function(e){this._customSensor.radius=e}},lateralSurfaceMaterial:{get:function(){return this._customSensor.lateralSurfaceMaterial},set:function(e){this._customSensor.lateralSurfaceMaterial=e}},intersectionColor:{get:function(){return this._customSensor.intersectionColor},set:function(e){this._customSensor.intersectionColor=e}},intersectionWidth:{get:function(){return this._customSensor.intersectionWidth},set:function(e){this._customSensor.intersectionWidth=e}},id:{get:function(){return this._customSensor.id},set:function(e){this._customSensor.id=e}}}),d.prototype.update=function(e){this._customSensor.update(e)},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return this._customSensor=this._customSensor&&this._customSensor.destroy(),a(this)},d}),r("rectangular/rectangular-sensor-visualizer",["require","Cesium/Core/AssociativeArray","Cesium/Core/Cartesian3","Cesium/Core/Color","Cesium/Core/defined","Cesium/Core/destroyObject","Cesium/Core/DeveloperError","Cesium/Core/Math","Cesium/Core/Matrix3","Cesium/Core/Matrix4","Cesium/Core/Quaternion","Cesium/DataSources/MaterialProperty","Cesium/DataSources/Property","./rectangular-pyramid-sensor-volume","../util/remove-primitive"],function(e){"use strict";var i=e("Cesium/Core/AssociativeArray"),r=e("Cesium/Core/Cartesian3"),t=e("Cesium/Core/Color"),o=e("Cesium/Core/defined"),n=e("Cesium/Core/destroyObject"),s=e("Cesium/Core/DeveloperError"),a=e("Cesium/Core/Math"),u=e("Cesium/Core/Matrix3"),l=e("Cesium/Core/Matrix4"),c=e("Cesium/Core/Quaternion"),m=e("Cesium/DataSources/MaterialProperty"),d=e("Cesium/DataSources/Property"),h=e("./rectangular-pyramid-sensor-volume"),C=e("../util/remove-primitive"),f=t.WHITE,p=Number.POSITIVE_INFINITY,_=new u,v=new r,g=new c,S=function(e,r){if(!o(e))throw new s("scene is required.");if(!o(r))throw new s("entityCollection is required.");r.collectionChanged.addEventListener(S.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=r,this._hash={},this._entitiesToVisualize=new i,this._onCollectionChanged(r,r.values,[],[])};return S.prototype.update=function(e){if(!o(e))throw new s("time is required.");for(var i=this._entitiesToVisualize.values,t=this._hash,n=this._primitives,C=0,S=i.length;C<S;C++){var y,w,A=i[C],M=A._rectangularSensor,x=t[A.id],E=A.isShowing&&A.isAvailable(e)&&d.getValueOrDefault(M._show,e,!0);if(E&&(y=d.getValueOrUndefined(A._position,e,v),w=d.getValueOrUndefined(A._orientation,e,g),E=o(y)&&o(w)),E){var D=o(x)?x.primitive:void 0;o(D)||(D=new h,D.id=A,n.add(D),x={primitive:D,position:void 0,orientation:void 0},t[A.id]=x),r.equals(y,x.position)&&c.equals(w,x.orientation)||(l.fromRotationTranslation(u.fromQuaternion(w,_),y,D.modelMatrix),x.position=r.clone(y,x.position),x.orientation=c.clone(w,x.orientation)),D.show=!0,D.xHalfAngle=d.getValueOrDefault(M._xHalfAngle,e,a.PI_OVER_TWO),D.yHalfAngle=d.getValueOrDefault(M._yHalfAngle,e,a.PI_OVER_TWO),D.radius=d.getValueOrDefault(M._radius,e,p),D.lateralSurfaceMaterial=m.getValue(e,M._lateralSurfaceMaterial,D.lateralSurfaceMaterial),D.intersectionColor=d.getValueOrClonedDefault(M._intersectionColor,e,f,D.intersectionColor),D.intersectionWidth=d.getValueOrDefault(M._intersectionWidth,e,1)}else o(x)&&(x.primitive.show=!1)}return!0},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){for(var e=this._entitiesToVisualize.values,i=this._hash,r=this._primitives,t=e.length-1;t>-1;t--)C(e[t],i,r);return n(this)},S.prototype._onCollectionChanged=function(e,i,r,t){var n,s,a=this._entitiesToVisualize,u=this._hash,l=this._primitives;for(n=i.length-1;n>-1;n--)s=i[n],o(s._rectangularSensor)&&o(s._position)&&o(s._orientation)&&a.set(s.id,s);for(n=t.length-1;n>-1;n--)s=t[n],o(s._rectangularSensor)&&o(s._position)&&o(s._orientation)?a.set(s.id,s):(C(s,u,l),a.remove(s.id));for(n=r.length-1;n>-1;n--)s=r[n],C(s,u,l),a.remove(s.id)},S}),r("initialize",["require","Cesium/Core/Cartesian3","Cesium/Core/Color","Cesium/Core/defined","Cesium/Core/Spherical","Cesium/Core/TimeInterval","Cesium/DataSources/CzmlDataSource","Cesium/DataSources/DataSourceDisplay","./conic/conic-sensor-graphics","./conic/conic-sensor-visualizer","./custom/custom-pattern-sensor-graphics","./custom/custom-pattern-sensor-visualizer","./rectangular/rectangular-sensor-graphics","./rectangular/rectangular-sensor-visualizer"],function(e){"use strict";function i(e,i,r,t,o){var n,a,c=[],m=i.unitSpherical,d=i.spherical,h=i.unitCartesian,C=i.cartesian;if(u(m)){for(n=0,a=m.length;n<a;n+=2)c.push(new l(m[n],m[n+1]));i.array=c}else if(u(d)){for(n=0,a=d.length;n<a;n+=3)c.push(new l(d[n],d[n+1],d[n+2]));i.array=c}else if(u(h)){for(n=0,a=h.length;n<a;n+=3){var f=l.fromCartesian3(new s(h[n],h[n+1],h[n+2]));l.normalize(f,f),c.push(f)}i.array=c}else if(u(C)){for(n=0,a=C.length;n<a;n+=3)c.push(l.fromCartesian3(new s(C[n],C[n+1],C[n+2])));i.array=c}g(Array,e,"directions",i,r,t,o)}function r(e,i,r,t,o){g(Boolean,e,"show",i.show,r,t,o),g(Number,e,"radius",i.radius,r,t,o),g(Boolean,e,"showIntersection",i.showIntersection,r,t,o),g(a,e,"intersectionColor",i.intersectionColor,r,t,o),g(Number,e,"intersectionWidth",i.intersectionWidth,r,t,o),S(e,"lateralSurfaceMaterial",i.lateralSurfaceMaterial,r,t,o)}function t(e,i,t,o){var n=i.agi_conicSensor;if(u(n)){var s,a=n.interval;u(a)&&(y.iso8601=a,s=c.fromIso8601(y));var l=e.conicSensor;u(l)||(e.addProperty("conicSensor"),l=new h,e.conicSensor=l),r(l,n,s,o,t),g(Number,l,"innerHalfAngle",n.innerHalfAngle,s,o,t),g(Number,l,"outerHalfAngle",n.outerHalfAngle,s,o,t),g(Number,l,"minimumClockAngle",n.minimumClockAngle,s,o,t),g(Number,l,"maximumClockAngle",n.maximumClockAngle,s,o,t)}}function o(e,t,o,n){var s=t.agi_customPatternSensor;if(u(s)){var a,l=s.interval;u(l)&&(y.iso8601=l,a=c.fromIso8601(y));var m=e.customPatternSensor;u(m)||(e.addProperty("customPatternSensor"),m=new f,e.customPatternSensor=m),r(m,s,a,n,o);var d=s.directions;if(u(d))if(Array.isArray(d))for(var h=d.length,C=0;C<h;C++)i(m,d[C],a,n,o);else i(m,d,a,n,o)}}function n(e,i,t,o){var n=i.agi_rectangularSensor;if(u(n)){var s,a=n.interval;u(a)&&(y.iso8601=a,s=c.fromIso8601(y));var l=e.rectangularSensor;u(l)||(e.addProperty("rectangularSensor"),l=new _,e.rectangularSensor=l),r(l,n,s,o,t),g(Number,l,"xHalfAngle",n.xHalfAngle,s,o,t),g(Number,l,"yHalfAngle",n.yHalfAngle,s,o,t)}}var s=e("Cesium/Core/Cartesian3"),a=e("Cesium/Core/Color"),u=e("Cesium/Core/defined"),l=e("Cesium/Core/Spherical"),c=e("Cesium/Core/TimeInterval"),m=e("Cesium/DataSources/CzmlDataSource"),d=e("Cesium/DataSources/DataSourceDisplay"),h=e("./conic/conic-sensor-graphics"),C=e("./conic/conic-sensor-visualizer"),f=e("./custom/custom-pattern-sensor-graphics"),p=e("./custom/custom-pattern-sensor-visualizer"),_=e("./rectangular/rectangular-sensor-graphics"),v=e("./rectangular/rectangular-sensor-visualizer"),g=m.processPacketData,S=m.processMaterialPacketData,y={iso8601:void 0},w=!1;return function(){if(!w){m.updaters.push(t,o,n);var e=d.defaultVisualizersCallback;d.defaultVisualizersCallback=function(i,r,t){var o=t.entities;return e(i,r,t).concat([new C(i,o),new p(i,o),new v(i,o)])},w=!0}}}),r("cesium-sensor-volumes",["require","./initialize","./conic/conic-sensor-graphics","./conic/conic-sensor-visualizer","./custom/custom-pattern-sensor-graphics","./custom/custom-pattern-sensor-visualizer","./custom/custom-sensor-volume","./rectangular/rectangular-pyramid-sensor-volume","./rectangular/rectangular-sensor-graphics","./rectangular/rectangular-sensor-visualizer"],function(e){"use strict";var i=e("./initialize"),r=e("./conic/conic-sensor-graphics"),t=e("./conic/conic-sensor-visualizer"),o=e("./custom/custom-pattern-sensor-graphics"),n=e("./custom/custom-pattern-sensor-visualizer"),s=e("./custom/custom-sensor-volume"),a=e("./rectangular/rectangular-pyramid-sensor-volume"),u=e("./rectangular/rectangular-sensor-graphics"),l=e("./rectangular/rectangular-sensor-visualizer");return i(),{ConicSensorGraphics:r,ConicSensorVisualizer:t,CustomPatternSensorGraphics:o,CustomPatternSensorVisualizer:n,CustomSensorVolume:s,RectangularPyramidSensorVolume:a,RectangularSensorGraphics:u,RectangularSensorVisualizer:l}}),r("Cesium/Core/Cartesian3",function(){return Cesium.Cartesian3}),r("Cesium/Core/Color",function(){return Cesium.Color}),r("Cesium/Core/defined",function(){return Cesium.defined}),r("Cesium/Core/Spherical",function(){return Cesium.Spherical}),r("Cesium/Core/TimeInterval",function(){return Cesium.TimeInterval}),r("Cesium/DataSources/CzmlDataSource",function(){return Cesium.CzmlDataSource}),r("Cesium/DataSources/DataSourceDisplay",function(){return Cesium.DataSourceDisplay}),r("Cesium/Core/defaultValue",function(){return Cesium.defaultValue}),r("Cesium/Core/defineProperties",function(){return Cesium.defineProperties}),r("Cesium/Core/DeveloperError",function(){return Cesium.DeveloperError}),r("Cesium/Core/Event",function(){return Cesium.Event}),r("Cesium/DataSources/createMaterialPropertyDescriptor",function(){return Cesium.createMaterialPropertyDescriptor}),r("Cesium/DataSources/createPropertyDescriptor",function(){return Cesium.createPropertyDescriptor}),r("Cesium/Core/AssociativeArray",function(){return Cesium.AssociativeArray}),r("Cesium/Core/destroyObject",function(){return Cesium.destroyObject}),r("Cesium/Core/Math",function(){return Cesium.Math}),r("Cesium/Core/Matrix3",function(){return Cesium.Matrix3}),r("Cesium/Core/Matrix4",function(){return Cesium.Matrix4}),r("Cesium/Core/Quaternion",function(){return Cesium.Quaternion}),r("Cesium/DataSources/MaterialProperty",function(){return Cesium.MaterialProperty}),r("Cesium/DataSources/Property",function(){return Cesium.Property}),r("Cesium/Core/BoundingSphere",function(){return Cesium.BoundingSphere}),r("Cesium/Core/combine",function(){return Cesium.combine}),r("Cesium/Core/ComponentDatatype",function(){return Cesium.ComponentDatatype}),r("Cesium/Core/PrimitiveType",function(){return Cesium.PrimitiveType}),r("Cesium/Renderer/Buffer",function(){return Cesium.Buffer}),r("Cesium/Renderer/BufferUsage",function(){return Cesium.BufferUsage}),r("Cesium/Renderer/DrawCommand",function(){return Cesium.DrawCommand}),r("Cesium/Renderer/Pass",function(){return Cesium.Pass}),r("Cesium/Renderer/RenderState",function(){return Cesium.RenderState}),r("Cesium/Renderer/ShaderProgram",function(){return Cesium.ShaderProgram}),r("Cesium/Renderer/ShaderSource",function(){return Cesium.ShaderSource}),r("Cesium/Renderer/VertexArray",function(){return Cesium.VertexArray}),r("Cesium/Scene/BlendingState",function(){return Cesium.BlendingState}),r("Cesium/Scene/CullFace",function(){return Cesium.CullFace}),r("Cesium/Scene/Material",function(){return Cesium.Material}),r("Cesium/Scene/SceneMode",function(){return Cesium.SceneMode}),r("Cesium/Core/clone",function(){return Cesium.clone}),i(["cesium-sensor-volumes"],function(e){"use strict";var i;i="undefined"==typeof window?"undefined"==typeof self?{}:self:window,i.CesiumSensorVolumes=e},void 0,!0)}(); |