/** * 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;c0&&(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 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=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;sr;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-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-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-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