Commit c53f4211 authored by Patrick's avatar Patrick
Browse files

update vcs version

parent a7c8b61b
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./when-60b00257","./Check-4274a1fd","./WebGLConstants-779bf0bc"],function(r,a,e,n){"use strict";var E={BYTE:n.WebGLConstants.BYTE,UNSIGNED_BYTE:n.WebGLConstants.UNSIGNED_BYTE,SHORT:n.WebGLConstants.SHORT,UNSIGNED_SHORT:n.WebGLConstants.UNSIGNED_SHORT,INT:n.WebGLConstants.INT,UNSIGNED_INT:n.WebGLConstants.UNSIGNED_INT,FLOAT:n.WebGLConstants.FLOAT,DOUBLE:n.WebGLConstants.DOUBLE,getSizeInBytes:function(r){switch(r){case E.BYTE:return Int8Array.BYTES_PER_ELEMENT;case E.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case E.SHORT:return Int16Array.BYTES_PER_ELEMENT;case E.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case E.INT:return Int32Array.BYTES_PER_ELEMENT;case E.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case E.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case E.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},fromTypedArray:function(r){return r instanceof Int8Array?E.BYTE:r instanceof Uint8Array?E.UNSIGNED_BYTE:r instanceof Int16Array?E.SHORT:r instanceof Uint16Array?E.UNSIGNED_SHORT:r instanceof Int32Array?E.INT:r instanceof Uint32Array?E.UNSIGNED_INT:r instanceof Float32Array?E.FLOAT:r instanceof Float64Array?E.DOUBLE:void 0},validate:function(r){return a.defined(r)&&(r===E.BYTE||r===E.UNSIGNED_BYTE||r===E.SHORT||r===E.UNSIGNED_SHORT||r===E.INT||r===E.UNSIGNED_INT||r===E.FLOAT||r===E.DOUBLE)},createTypedArray:function(r,e){switch(r){case E.BYTE:return new Int8Array(e);case E.UNSIGNED_BYTE:return new Uint8Array(e);case E.SHORT:return new Int16Array(e);case E.UNSIGNED_SHORT:return new Uint16Array(e);case E.INT:return new Int32Array(e);case E.UNSIGNED_INT:return new Uint32Array(e);case E.FLOAT:return new Float32Array(e);case E.DOUBLE:return new Float64Array(e)}},createArrayBufferView:function(r,e,n,t){switch(n=a.defaultValue(n,0),t=a.defaultValue(t,(e.byteLength-n)/E.getSizeInBytes(r)),r){case E.BYTE:return new Int8Array(e,n,t);case E.UNSIGNED_BYTE:return new Uint8Array(e,n,t);case E.SHORT:return new Int16Array(e,n,t);case E.UNSIGNED_SHORT:return new Uint16Array(e,n,t);case E.INT:return new Int32Array(e,n,t);case E.UNSIGNED_INT:return new Uint32Array(e,n,t);case E.FLOAT:return new Float32Array(e,n,t);case E.DOUBLE:return new Float64Array(e,n,t)}},fromName:function(r){switch(r){case"BYTE":return E.BYTE;case"UNSIGNED_BYTE":return E.UNSIGNED_BYTE;case"SHORT":return E.SHORT;case"UNSIGNED_SHORT":return E.UNSIGNED_SHORT;case"INT":return E.INT;case"UNSIGNED_INT":return E.UNSIGNED_INT;case"FLOAT":return E.FLOAT;case"DOUBLE":return E.DOUBLE}}},t=Object.freeze(E);r.ComponentDatatype=t});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./Check-4274a1fd","./Cartesian2-2951f601","./Transforms-53ff6d12","./OrientedBoundingBox-23288f54"],function(n,t,l,x,B){"use strict";var e={},s=new l.Cartesian3,P=new l.Cartesian3,M=new l.Cartesian3,h=new l.Cartesian3,v=new B.OrientedBoundingBox;function o(n,t,e,r,a){var i=l.Cartesian3.subtract(n,t,s),o=l.Cartesian3.dot(e,i),u=l.Cartesian3.dot(r,i);return l.Cartesian2.fromElements(o,u,a)}e.validOutline=function(n){var t=B.OrientedBoundingBox.fromPoints(n,v).halfAxes,e=x.Matrix3.getColumn(t,0,P),r=x.Matrix3.getColumn(t,1,M),a=x.Matrix3.getColumn(t,2,h),i=l.Cartesian3.magnitude(e),o=l.Cartesian3.magnitude(r),u=l.Cartesian3.magnitude(a);return!(0===i&&(0===o||0===u)||0===o&&0===u)},e.computeProjectTo2DArguments=function(n,t,e,r){var a,i,o=B.OrientedBoundingBox.fromPoints(n,v),u=o.halfAxes,s=x.Matrix3.getColumn(u,0,P),C=x.Matrix3.getColumn(u,1,M),m=x.Matrix3.getColumn(u,2,h),c=l.Cartesian3.magnitude(s),f=l.Cartesian3.magnitude(C),d=l.Cartesian3.magnitude(m),g=Math.min(c,f,d);return(0!==c||0!==f&&0!==d)&&(0!==f||0!==d)&&(g!==f&&g!==d||(a=s),g===c?a=C:g===d&&(i=C),g!==c&&g!==f||(i=m),l.Cartesian3.normalize(a,e),l.Cartesian3.normalize(i,r),l.Cartesian3.clone(o.center,t),!0)},e.createProjectPointsTo2DFunction=function(r,a,i){return function(n){for(var t=new Array(n.length),e=0;e<n.length;e++)t[e]=o(n[e],r,a,i);return t}},e.createProjectPointTo2DFunction=function(e,r,a){return function(n,t){return o(n,e,r,a,t)}},n.CoplanarPolygonGeometryLibrary=e});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./when-60b00257","./Math-9d37f659","./Cartesian2-2951f601","./Transforms-53ff6d12","./PolylineVolumeGeometryLibrary-a55f99d5","./PolylinePipeline-30fab084"],function(a,o,M,T,d,N,L){"use strict";var e={},O=new T.Cartesian3,p=new T.Cartesian3,m=new T.Cartesian3,f=new T.Cartesian3,R=[new T.Cartesian3,new T.Cartesian3],V=new T.Cartesian3,Q=new T.Cartesian3,U=new T.Cartesian3,G=new T.Cartesian3,I=new T.Cartesian3,q=new T.Cartesian3,j=new T.Cartesian3,k=new T.Cartesian3,F=new T.Cartesian3,H=new T.Cartesian3,c=new d.Quaternion,g=new d.Matrix3;function J(a,e,r,n,t){var i,s=T.Cartesian3.angleBetween(T.Cartesian3.subtract(e,a,O),T.Cartesian3.subtract(r,a,p)),o=n===N.CornerType.BEVELED?1:Math.ceil(s/M.CesiumMath.toRadians(5))+1,C=3*o,l=new Array(C);l[C-3]=r.x,l[C-2]=r.y,l[C-1]=r.z,i=t?d.Matrix3.fromQuaternion(d.Quaternion.fromAxisAngle(T.Cartesian3.negate(a,O),s/o,c),g):d.Matrix3.fromQuaternion(d.Quaternion.fromAxisAngle(a,s/o,c),g);var y=0;e=T.Cartesian3.clone(e,O);for(var u=0;u<o;u++)e=d.Matrix3.multiplyByVector(i,e,e),l[y++]=e.x,l[y++]=e.y,l[y++]=e.z;return l}function K(a,e,r,n){var t=O;return[(t=(n||(e=T.Cartesian3.negate(e,e)),T.Cartesian3.add(a,e,t))).x,t.y,t.z,r.x,r.y,r.z]}function W(a,e,r,n){for(var t=new Array(a.length),i=new Array(a.length),s=T.Cartesian3.multiplyByScalar(e,r,O),o=T.Cartesian3.negate(s,p),C=0,l=a.length-1,y=0;y<a.length;y+=3){var u=T.Cartesian3.fromArray(a,y,m),d=T.Cartesian3.add(u,o,f);t[C++]=d.x,t[C++]=d.y,t[C++]=d.z;var c=T.Cartesian3.add(u,s,f);i[l--]=c.z,i[l--]=c.y,i[l--]=c.x}return n.push(t,i),n}e.addAttribute=function(a,e,r,n){var t=e.x,i=e.y,s=e.z;o.defined(r)&&(a[r]=t,a[r+1]=i,a[r+2]=s),o.defined(n)&&(a[n]=s,a[n-1]=i,a[n-2]=t)};var X=new T.Cartesian3,Y=new T.Cartesian3;e.computePositions=function(a){var e=a.granularity,r=a.positions,n=a.ellipsoid,t=a.width/2,i=a.cornerType,s=a.saveAttributes,o=V,C=Q,l=U,y=G,u=I,d=q,c=j,p=k,m=F,f=H,g=[],h=s?[]:void 0,w=s?[]:void 0,z=r[0],x=r[1];C=T.Cartesian3.normalize(T.Cartesian3.subtract(x,z,C),C),o=n.geodeticSurfaceNormal(z,o),y=T.Cartesian3.normalize(T.Cartesian3.cross(o,C,y),y),s&&(h.push(y.x,y.y,y.z),w.push(o.x,o.y,o.z)),c=T.Cartesian3.clone(z,c),z=x,l=T.Cartesian3.negate(C,l);var v,P,A=[],B=r.length;for(v=1;v<B-1;v++){o=n.geodeticSurfaceNormal(z,o),x=r[v+1],C=T.Cartesian3.normalize(T.Cartesian3.subtract(x,z,C),C),u=T.Cartesian3.normalize(T.Cartesian3.add(C,l,u),u);var E=T.Cartesian3.multiplyByScalar(o,T.Cartesian3.dot(C,o),X);T.Cartesian3.subtract(C,E,E),T.Cartesian3.normalize(E,E);var S=T.Cartesian3.multiplyByScalar(o,T.Cartesian3.dot(l,o),Y);if(T.Cartesian3.subtract(l,S,S),T.Cartesian3.normalize(S,S),!M.CesiumMath.equalsEpsilon(Math.abs(T.Cartesian3.dot(E,S)),1,M.CesiumMath.EPSILON7)){u=T.Cartesian3.cross(u,o,u),u=T.Cartesian3.cross(o,u,u),u=T.Cartesian3.normalize(u,u);var b=t/Math.max(.25,T.Cartesian3.magnitude(T.Cartesian3.cross(u,l,O))),D=N.PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(C,l,z,n);u=T.Cartesian3.multiplyByScalar(u,b,u),D?(p=T.Cartesian3.add(z,u,p),f=T.Cartesian3.add(p,T.Cartesian3.multiplyByScalar(y,t,f),f),m=T.Cartesian3.add(p,T.Cartesian3.multiplyByScalar(y,2*t,m),m),R[0]=T.Cartesian3.clone(c,R[0]),R[1]=T.Cartesian3.clone(f,R[1]),g=W(L.PolylinePipeline.generateArc({positions:R,granularity:e,ellipsoid:n}),y,t,g),s&&(h.push(y.x,y.y,y.z),w.push(o.x,o.y,o.z)),d=T.Cartesian3.clone(m,d),y=T.Cartesian3.normalize(T.Cartesian3.cross(o,C,y),y),m=T.Cartesian3.add(p,T.Cartesian3.multiplyByScalar(y,2*t,m),m),c=T.Cartesian3.add(p,T.Cartesian3.multiplyByScalar(y,t,c),c),i===N.CornerType.ROUNDED||i===N.CornerType.BEVELED?A.push({leftPositions:J(p,d,m,i,D)}):A.push({leftPositions:K(z,T.Cartesian3.negate(u,u),m,D)})):(m=T.Cartesian3.add(z,u,m),f=T.Cartesian3.add(m,T.Cartesian3.negate(T.Cartesian3.multiplyByScalar(y,t,f),f),f),p=T.Cartesian3.add(m,T.Cartesian3.negate(T.Cartesian3.multiplyByScalar(y,2*t,p),p),p),R[0]=T.Cartesian3.clone(c,R[0]),R[1]=T.Cartesian3.clone(f,R[1]),g=W(L.PolylinePipeline.generateArc({positions:R,granularity:e,ellipsoid:n}),y,t,g),s&&(h.push(y.x,y.y,y.z),w.push(o.x,o.y,o.z)),d=T.Cartesian3.clone(p,d),y=T.Cartesian3.normalize(T.Cartesian3.cross(o,C,y),y),p=T.Cartesian3.add(m,T.Cartesian3.negate(T.Cartesian3.multiplyByScalar(y,2*t,p),p),p),c=T.Cartesian3.add(m,T.Cartesian3.negate(T.Cartesian3.multiplyByScalar(y,t,c),c),c),i===N.CornerType.ROUNDED||i===N.CornerType.BEVELED?A.push({rightPositions:J(m,d,p,i,D)}):A.push({rightPositions:K(z,u,p,D)})),l=T.Cartesian3.negate(C,l)}z=x}return o=n.geodeticSurfaceNormal(z,o),R[0]=T.Cartesian3.clone(c,R[0]),R[1]=T.Cartesian3.clone(z,R[1]),g=W(L.PolylinePipeline.generateArc({positions:R,granularity:e,ellipsoid:n}),y,t,g),s&&(h.push(y.x,y.y,y.z),w.push(o.x,o.y,o.z)),i===N.CornerType.ROUNDED&&(P=function(a){var e=V,r=Q,n=U,t=a[1];r=T.Cartesian3.fromArray(a[1],t.length-3,r),n=T.Cartesian3.fromArray(a[0],0,n);var i=J(e=T.Cartesian3.midpoint(r,n,e),r,n,N.CornerType.ROUNDED,!1),s=a.length-1,o=a[s-1];return t=a[s],r=T.Cartesian3.fromArray(o,o.length-3,r),n=T.Cartesian3.fromArray(t,0,n),[i,J(e=T.Cartesian3.midpoint(r,n,e),r,n,N.CornerType.ROUNDED,!1)]}(g)),{positions:g,corners:A,lefts:h,normals:w,endPositions:P}},a.CorridorGeometryLibrary=e});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./when-60b00257","./Check-4274a1fd","./Math-9d37f659","./Cartesian2-2951f601","./Transforms-53ff6d12","./ComponentDatatype-a29c6075","./GeometryAttribute-2f728681","./GeometryAttributes-130e4d69","./IndexDatatype-527cbd94","./GeometryOffsetAttribute-8756c94a","./VertexFormat-6af5bab1","./CylinderGeometryLibrary-4f028ebf"],function(t,I,e,U,S,B,Y,Z,J,W,j,u,q){"use strict";var H=new S.Cartesian2,K=new S.Cartesian3,Q=new S.Cartesian3,X=new S.Cartesian3,$=new S.Cartesian3;function f(t){var e=(t=I.defaultValue(t,I.defaultValue.EMPTY_OBJECT)).length,a=t.topRadius,r=t.bottomRadius,n=I.defaultValue(t.vertexFormat,u.VertexFormat.DEFAULT),o=I.defaultValue(t.slices,128);this._length=e,this._topRadius=a,this._bottomRadius=r,this._vertexFormat=u.VertexFormat.clone(n),this._slices=o,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}f.packedLength=u.VertexFormat.packedLength+5,f.pack=function(t,e,a){return a=I.defaultValue(a,0),u.VertexFormat.pack(t._vertexFormat,e,a),a+=u.VertexFormat.packedLength,e[a++]=t._length,e[a++]=t._topRadius,e[a++]=t._bottomRadius,e[a++]=t._slices,e[a]=I.defaultValue(t._offsetAttribute,-1),e};var a,d=new u.VertexFormat,p={vertexFormat:d,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};f.unpack=function(t,e,a){e=I.defaultValue(e,0);var r=u.VertexFormat.unpack(t,e,d);e+=u.VertexFormat.packedLength;var n=t[e++],o=t[e++],i=t[e++],s=t[e++],m=t[e];return I.defined(a)?(a._vertexFormat=u.VertexFormat.clone(r,a._vertexFormat),a._length=n,a._topRadius=o,a._bottomRadius=i,a._slices=s,a._offsetAttribute=-1===m?void 0:m,a):(p.length=n,p.topRadius=o,p.bottomRadius=i,p.slices=s,p.offsetAttribute=-1===m?void 0:m,new f(p))},f.createGeometry=function(t){var e=t._length,a=t._topRadius,r=t._bottomRadius,n=t._vertexFormat,o=t._slices;if(!(e<=0||a<0||r<0||0===a&&0===r)){var i,s=o+o,m=o+s,u=s+s,f=q.CylinderGeometryLibrary.computePositions(e,a,r,o,!0),d=n.st?new Float32Array(2*u):void 0,p=n.normal?new Float32Array(3*u):void 0,y=n.tangent?new Float32Array(3*u):void 0,l=n.bitangent?new Float32Array(3*u):void 0,b=n.normal||n.tangent||n.bitangent;if(b){var c=n.tangent||n.bitangent,v=0,A=0,g=0,h=Math.atan2(r-a,e),x=K;x.z=Math.sin(h);var _=Math.cos(h),C=X,F=Q;for(i=0;i<o;i++){var w=i/o*U.CesiumMath.TWO_PI,G=_*Math.cos(w),D=_*Math.sin(w);b&&(x.x=G,x.y=D,c&&(C=S.Cartesian3.normalize(S.Cartesian3.cross(S.Cartesian3.UNIT_Z,x,C),C)),n.normal&&(p[v++]=x.x,p[v++]=x.y,p[v++]=x.z,p[v++]=x.x,p[v++]=x.y,p[v++]=x.z),n.tangent&&(y[A++]=C.x,y[A++]=C.y,y[A++]=C.z,y[A++]=C.x,y[A++]=C.y,y[A++]=C.z),n.bitangent&&(F=S.Cartesian3.normalize(S.Cartesian3.cross(x,C,F),F),l[g++]=F.x,l[g++]=F.y,l[g++]=F.z,l[g++]=F.x,l[g++]=F.y,l[g++]=F.z))}for(i=0;i<o;i++)n.normal&&(p[v++]=0,p[v++]=0,p[v++]=-1),n.tangent&&(y[A++]=1,y[A++]=0,y[A++]=0),n.bitangent&&(l[g++]=0,l[g++]=-1,l[g++]=0);for(i=0;i<o;i++)n.normal&&(p[v++]=0,p[v++]=0,p[v++]=1),n.tangent&&(y[A++]=1,y[A++]=0,y[A++]=0),n.bitangent&&(l[g++]=0,l[g++]=1,l[g++]=0)}var R=12*o-12,V=W.IndexDatatype.createTypedArray(u,R),T=0,O=0;for(i=0;i<o-1;i++)V[T++]=O,V[T++]=O+2,V[T++]=O+3,V[T++]=O,V[T++]=O+3,V[T++]=O+1,O+=2;for(V[T++]=s-2,V[T++]=0,V[T++]=1,V[T++]=s-2,V[T++]=1,V[T++]=s-1,i=1;i<o-1;i++)V[T++]=s+i+1,V[T++]=s+i,V[T++]=s;for(i=1;i<o-1;i++)V[T++]=m,V[T++]=m+i,V[T++]=m+i+1;var L=0;if(n.st){var P=Math.max(a,r);for(i=0;i<u;i++){var k=S.Cartesian3.fromArray(f,3*i,$);d[L++]=(k.x+P)/(2*P),d[L++]=(k.y+P)/(2*P)}}var M=new J.GeometryAttributes;n.position&&(M.position=new Z.GeometryAttribute({componentDatatype:Y.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})),n.normal&&(M.normal=new Z.GeometryAttribute({componentDatatype:Y.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:p})),n.tangent&&(M.tangent=new Z.GeometryAttribute({componentDatatype:Y.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:y})),n.bitangent&&(M.bitangent=new Z.GeometryAttribute({componentDatatype:Y.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:l})),n.st&&(M.st=new Z.GeometryAttribute({componentDatatype:Y.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:d})),H.x=.5*e,H.y=Math.max(r,a);var z=new B.BoundingSphere(S.Cartesian3.ZERO,S.Cartesian2.magnitude(H));if(I.defined(t._offsetAttribute)){e=f.length;var E=new Uint8Array(e/3),N=t._offsetAttribute===j.GeometryOffsetAttribute.NONE?0:1;j.arrayFill(E,N),M.applyOffset=new Z.GeometryAttribute({componentDatatype:Y.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new Z.Geometry({attributes:M,indices:V,primitiveType:Z.PrimitiveType.TRIANGLES,boundingSphere:z,offsetAttribute:t._offsetAttribute})}},f.getUnitCylinder=function(){return I.defined(a)||(a=f.createGeometry(new f({topRadius:1,bottomRadius:1,length:1,vertexFormat:u.VertexFormat.POSITION_ONLY}))),a},t.CylinderGeometry=f});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./Math-9d37f659"],function(r,b){"use strict";var t={computePositions:function(r,t,e,a,i){var n,o=.5*r,s=-o,u=a+a,c=new Float64Array(3*(i?2*u:u)),f=0,h=0,y=i?3*u:0,M=i?3*(u+a):3*a;for(n=0;n<a;n++){var d=n/a*b.CesiumMath.TWO_PI,m=Math.cos(d),v=Math.sin(d),l=m*e,p=v*e,C=m*t,P=v*t;c[h+y]=l,c[h+y+1]=p,c[h+y+2]=s,c[h+M]=C,c[h+M+1]=P,c[h+M+2]=o,h+=3,i&&(c[f++]=l,c[f++]=p,c[f++]=s,c[f++]=C,c[f++]=P,c[f++]=o)}return c}};r.CylinderGeometryLibrary=t});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./when-60b00257","./Check-4274a1fd","./Math-9d37f659","./Cartesian2-2951f601","./Transforms-53ff6d12","./ComponentDatatype-a29c6075","./GeometryAttribute-2f728681","./GeometryAttributes-130e4d69","./GeometryPipeline-7b394c2b","./IndexDatatype-527cbd94","./GeometryOffsetAttribute-8756c94a","./VertexFormat-6af5bab1","./EllipseGeometryLibrary-bffb8c3e","./GeometryInstance-9e435e40"],function(e,U,t,y,Q,W,J,q,Z,b,v,K,f,B,C){"use strict";var X=new Q.Cartesian3,$=new Q.Cartesian3,ee=new Q.Cartesian3,te=new Q.Cartesian3,re=new Q.Cartesian2,ae=new W.Matrix3,Y=new W.Matrix3,ie=new W.Quaternion,ne=new Q.Cartesian3,oe=new Q.Cartesian3,se=new Q.Cartesian3,le=new Q.Cartographic,ue=new Q.Cartesian3,me=new Q.Cartesian2,pe=new Q.Cartesian2;function w(e,t,r){var a=t.vertexFormat,i=t.center,n=t.semiMajorAxis,o=t.semiMinorAxis,s=t.ellipsoid,l=t.stRotation,u=r?e.length/3*2:e.length/3,m=t.shadowVolume,p=a.st?new Float32Array(2*u):void 0,y=a.normal?new Float32Array(3*u):void 0,c=a.tangent?new Float32Array(3*u):void 0,d=a.bitangent?new Float32Array(3*u):void 0,f=m?new Float32Array(3*u):void 0,A=0,h=ne,x=oe,g=se,_=new W.GeographicProjection(s),b=_.project(s.cartesianToCartographic(i,le),ue),v=s.scaleToGeodeticSurface(i,X);s.geodeticSurfaceNormal(v,v);var C=ae,w=Y;if(0!==l){var M=W.Quaternion.fromAxisAngle(v,l,ie);C=W.Matrix3.fromQuaternion(M,C),M=W.Quaternion.fromAxisAngle(v,-l,ie),w=W.Matrix3.fromQuaternion(M,w)}else C=W.Matrix3.clone(W.Matrix3.IDENTITY,C),w=W.Matrix3.clone(W.Matrix3.IDENTITY,w);for(var E=Q.Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,me),I=Q.Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,pe),T=e.length,G=r?T:0,N=G/3*2,P=0;P<T;P+=3){var F=P+1,V=P+2,D=Q.Cartesian3.fromArray(e,P,X);if(a.st){var O=W.Matrix3.multiplyByVector(C,D,$),S=_.project(s.cartesianToCartographic(O,le),ee);Q.Cartesian3.subtract(S,b,S),re.x=(S.x+n)/(2*n),re.y=(S.y+o)/(2*o),E.x=Math.min(re.x,E.x),E.y=Math.min(re.y,E.y),I.x=Math.max(re.x,I.x),I.y=Math.max(re.y,I.y),r&&(p[A+N]=re.x,p[A+1+N]=re.y),p[A++]=re.x,p[A++]=re.y}(a.normal||a.tangent||a.bitangent||m)&&(h=s.geodeticSurfaceNormal(D,h),m&&(f[P+G]=-h.x,f[F+G]=-h.y,f[V+G]=-h.z),(a.normal||a.tangent||a.bitangent)&&((a.tangent||a.bitangent)&&(x=Q.Cartesian3.normalize(Q.Cartesian3.cross(Q.Cartesian3.UNIT_Z,h,x),x),W.Matrix3.multiplyByVector(w,x,x)),a.normal&&(y[P]=h.x,y[F]=h.y,y[V]=h.z,r&&(y[P+G]=-h.x,y[F+G]=-h.y,y[V+G]=-h.z)),a.tangent&&(c[P]=x.x,c[F]=x.y,c[V]=x.z,r&&(c[P+G]=-x.x,c[F+G]=-x.y,c[V+G]=-x.z)),a.bitangent&&(g=Q.Cartesian3.normalize(Q.Cartesian3.cross(h,x,g),g),d[P]=g.x,d[F]=g.y,d[V]=g.z,r&&(d[P+G]=g.x,d[F+G]=g.y,d[V+G]=g.z))))}if(a.st){T=p.length;for(var L=0;L<T;L+=2)p[L]=(p[L]-E.x)/(I.x-E.x),p[L+1]=(p[L+1]-E.y)/(I.y-E.y)}var R=new Z.GeometryAttributes;if(a.position){var j=B.EllipseGeometryLibrary.raisePositionsToHeight(e,t,r);R.position=new q.GeometryAttribute({componentDatatype:J.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:j})}if(a.st&&(R.st=new q.GeometryAttribute({componentDatatype:J.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:p})),a.normal&&(R.normal=new q.GeometryAttribute({componentDatatype:J.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:y})),a.tangent&&(R.tangent=new q.GeometryAttribute({componentDatatype:J.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:c})),a.bitangent&&(R.bitangent=new q.GeometryAttribute({componentDatatype:J.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:d})),m&&(R.extrudeDirection=new q.GeometryAttribute({componentDatatype:J.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:f})),r&&U.defined(t.offsetAttribute)){var k=new Uint8Array(u);if(t.offsetAttribute===K.GeometryOffsetAttribute.TOP)k=K.arrayFill(k,1,0,u/2);else{var z=t.offsetAttribute===K.GeometryOffsetAttribute.NONE?0:1;k=K.arrayFill(k,z)}R.applyOffset=new q.GeometryAttribute({componentDatatype:J.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:k})}return R}function M(e){var t,r,a,i,n,o=new Array(e*(e+1)*12-6),s=0;for(a=1,i=t=0;i<3;i++)o[s++]=a++,o[s++]=t,o[s++]=a;for(i=2;i<e+1;++i){for(a=i*(i+1)-1,t=(i-1)*i-1,o[s++]=a++,o[s++]=t,o[s++]=a,r=2*i,n=0;n<r-1;++n)o[s++]=a,o[s++]=t++,o[s++]=t,o[s++]=a++,o[s++]=t,o[s++]=a;o[s++]=a++,o[s++]=t,o[s++]=a}for(r=2*e,++a,++t,i=0;i<r-1;++i)o[s++]=a,o[s++]=t++,o[s++]=t,o[s++]=a++,o[s++]=t,o[s++]=a;for(o[s++]=a,o[s++]=t++,o[s++]=t,o[s++]=a++,o[s++]=t++,o[s++]=t,++t,i=e-1;1<i;--i){for(o[s++]=t++,o[s++]=t,o[s++]=a,r=2*i,n=0;n<r-1;++n)o[s++]=a,o[s++]=t++,o[s++]=t,o[s++]=a++,o[s++]=t,o[s++]=a;o[s++]=t++,o[s++]=t++,o[s++]=a++}for(i=0;i<3;i++)o[s++]=t++,o[s++]=t,o[s++]=a;return o}var u=new Q.Cartesian3;var E=new W.BoundingSphere,I=new W.BoundingSphere;function m(e){var t=e.center,r=e.ellipsoid,a=e.semiMajorAxis,i=Q.Cartesian3.multiplyByScalar(r.geodeticSurfaceNormal(t,X),e.height,X);E.center=Q.Cartesian3.add(t,i,E.center),E.radius=a,i=Q.Cartesian3.multiplyByScalar(r.geodeticSurfaceNormal(t,i),e.extrudedHeight,i),I.center=Q.Cartesian3.add(t,i,I.center),I.radius=a;var n=B.EllipseGeometryLibrary.computeEllipsePositions(e,!0,!0),o=n.positions,s=n.numPts,l=n.outerPositions,u=W.BoundingSphere.union(E,I),m=w(o,e,!0),p=M(s),y=p.length;p.length=2*y;for(var c=o.length/3,d=0;d<y;d+=3)p[d+y]=p[d+2]+c,p[d+1+y]=p[d+1]+c,p[d+2+y]=p[d]+c;var f=v.IndexDatatype.createTypedArray(2*c/3,p),A=new q.Geometry({attributes:m,indices:f,primitiveType:q.PrimitiveType.TRIANGLES}),h=function(e,t){var r=t.vertexFormat,a=t.center,i=t.semiMajorAxis,n=t.semiMinorAxis,o=t.ellipsoid,s=t.height,l=t.extrudedHeight,u=t.stRotation,m=e.length/3*2,p=new Float64Array(3*m),y=r.st?new Float32Array(2*m):void 0,c=r.normal?new Float32Array(3*m):void 0,d=r.tangent?new Float32Array(3*m):void 0,f=r.bitangent?new Float32Array(3*m):void 0,A=t.shadowVolume,h=A?new Float32Array(3*m):void 0,x=0,g=ne,_=oe,b=se,v=new W.GeographicProjection(o),C=v.project(o.cartesianToCartographic(a,le),ue),w=o.scaleToGeodeticSurface(a,X);o.geodeticSurfaceNormal(w,w);for(var M=W.Quaternion.fromAxisAngle(w,u,ie),E=W.Matrix3.fromQuaternion(M,ae),I=Q.Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,me),T=Q.Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,pe),G=e.length,N=G/3*2,P=0;P<G;P+=3){var F,V=P+1,D=P+2,O=Q.Cartesian3.fromArray(e,P,X);if(r.st){var S=W.Matrix3.multiplyByVector(E,O,$),L=v.project(o.cartesianToCartographic(S,le),ee);Q.Cartesian3.subtract(L,C,L),re.x=(L.x+i)/(2*i),re.y=(L.y+n)/(2*n),I.x=Math.min(re.x,I.x),I.y=Math.min(re.y,I.y),T.x=Math.max(re.x,T.x),T.y=Math.max(re.y,T.y),y[x+N]=re.x,y[x+1+N]=re.y,y[x++]=re.x,y[x++]=re.y}O=o.scaleToGeodeticSurface(O,O),F=Q.Cartesian3.clone(O,$),g=o.geodeticSurfaceNormal(O,g),A&&(h[P+G]=-g.x,h[V+G]=-g.y,h[D+G]=-g.z);var R=Q.Cartesian3.multiplyByScalar(g,s,te);if(O=Q.Cartesian3.add(O,R,O),R=Q.Cartesian3.multiplyByScalar(g,l,R),F=Q.Cartesian3.add(F,R,F),r.position&&(p[P+G]=F.x,p[V+G]=F.y,p[D+G]=F.z,p[P]=O.x,p[V]=O.y,p[D]=O.z),r.normal||r.tangent||r.bitangent){b=Q.Cartesian3.clone(g,b);var j=Q.Cartesian3.fromArray(e,(P+3)%G,te);Q.Cartesian3.subtract(j,O,j);var k=Q.Cartesian3.subtract(F,O,ee);g=Q.Cartesian3.normalize(Q.Cartesian3.cross(k,j,g),g),r.normal&&(c[P]=g.x,c[V]=g.y,c[D]=g.z,c[P+G]=g.x,c[V+G]=g.y,c[D+G]=g.z),r.tangent&&(_=Q.Cartesian3.normalize(Q.Cartesian3.cross(b,g,_),_),d[P]=_.x,d[V]=_.y,d[D]=_.z,d[P+G]=_.x,d[P+1+G]=_.y,d[P+2+G]=_.z),r.bitangent&&(f[P]=b.x,f[V]=b.y,f[D]=b.z,f[P+G]=b.x,f[V+G]=b.y,f[D+G]=b.z)}}if(r.st){G=y.length;for(var z=0;z<G;z+=2)y[z]=(y[z]-I.x)/(T.x-I.x),y[z+1]=(y[z+1]-I.y)/(T.y-I.y)}var B=new Z.GeometryAttributes;if(r.position&&(B.position=new q.GeometryAttribute({componentDatatype:J.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:p})),r.st&&(B.st=new q.GeometryAttribute({componentDatatype:J.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:y})),r.normal&&(B.normal=new q.GeometryAttribute({componentDatatype:J.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:c})),r.tangent&&(B.tangent=new q.GeometryAttribute({componentDatatype:J.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:d})),r.bitangent&&(B.bitangent=new q.GeometryAttribute({componentDatatype:J.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:f})),A&&(B.extrudeDirection=new q.GeometryAttribute({componentDatatype:J.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:h})),U.defined(t.offsetAttribute)){var Y=new Uint8Array(m);if(t.offsetAttribute===K.GeometryOffsetAttribute.TOP)Y=K.arrayFill(Y,1,0,m/2);else{var H=t.offsetAttribute===K.GeometryOffsetAttribute.NONE?0:1;Y=K.arrayFill(Y,H)}B.applyOffset=new q.GeometryAttribute({componentDatatype:J.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:Y})}return B}(l,e);p=function(e){for(var t=e.length/3,r=v.IndexDatatype.createTypedArray(t,6*t),a=0,i=0;i<t;i++){var n=i+t,o=(i+1)%t,s=o+t;r[a++]=i,r[a++]=n,r[a++]=o,r[a++]=o,r[a++]=n,r[a++]=s}return r}(l);var x=v.IndexDatatype.createTypedArray(2*l.length/3,p),g=new q.Geometry({attributes:h,indices:x,primitiveType:q.PrimitiveType.TRIANGLES}),_=b.GeometryPipeline.combineInstances([new C.GeometryInstance({geometry:A}),new C.GeometryInstance({geometry:g})]);return{boundingSphere:u,attributes:_[0].attributes,indices:_[0].indices}}function s(e,t,r,a,i,n,o){for(var s=B.EllipseGeometryLibrary.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:r,rotation:a,granularity:i},!1,!0).outerPositions,l=s.length/3,u=new Array(l),m=0;m<l;++m)u[m]=Q.Cartesian3.fromArray(s,3*m);var p=Q.Rectangle.fromCartesianArray(u,n,o);return p.width>y.CesiumMath.PI&&(p.north=0<p.north?y.CesiumMath.PI_OVER_TWO-y.CesiumMath.EPSILON7:p.north,p.south=p.south<0?y.CesiumMath.EPSILON7-y.CesiumMath.PI_OVER_TWO:p.south,p.east=y.CesiumMath.PI,p.west=-y.CesiumMath.PI),p}function A(e){var t=(e=U.defaultValue(e,U.defaultValue.EMPTY_OBJECT)).center,r=U.defaultValue(e.ellipsoid,Q.Ellipsoid.WGS84),a=e.semiMajorAxis,i=e.semiMinorAxis,n=U.defaultValue(e.granularity,y.CesiumMath.RADIANS_PER_DEGREE),o=U.defaultValue(e.vertexFormat,f.VertexFormat.DEFAULT),s=U.defaultValue(e.height,0),l=U.defaultValue(e.extrudedHeight,s);this._center=Q.Cartesian3.clone(t),this._semiMajorAxis=a,this._semiMinorAxis=i,this._ellipsoid=Q.Ellipsoid.clone(r),this._rotation=U.defaultValue(e.rotation,0),this._stRotation=U.defaultValue(e.stRotation,0),this._height=Math.max(l,s),this._granularity=n,this._vertexFormat=f.VertexFormat.clone(o),this._extrudedHeight=Math.min(l,s),this._shadowVolume=U.defaultValue(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}A.packedLength=Q.Cartesian3.packedLength+Q.Ellipsoid.packedLength+f.VertexFormat.packedLength+9,A.pack=function(e,t,r){return r=U.defaultValue(r,0),Q.Cartesian3.pack(e._center,t,r),r+=Q.Cartesian3.packedLength,Q.Ellipsoid.pack(e._ellipsoid,t,r),r+=Q.Ellipsoid.packedLength,f.VertexFormat.pack(e._vertexFormat,t,r),r+=f.VertexFormat.packedLength,t[r++]=e._semiMajorAxis,t[r++]=e._semiMinorAxis,t[r++]=e._rotation,t[r++]=e._stRotation,t[r++]=e._height,t[r++]=e._granularity,t[r++]=e._extrudedHeight,t[r++]=e._shadowVolume?1:0,t[r]=U.defaultValue(e._offsetAttribute,-1),t};var h=new Q.Cartesian3,x=new Q.Ellipsoid,g=new f.VertexFormat,_={center:h,ellipsoid:x,vertexFormat:g,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};A.unpack=function(e,t,r){t=U.defaultValue(t,0);var a=Q.Cartesian3.unpack(e,t,h);t+=Q.Cartesian3.packedLength;var i=Q.Ellipsoid.unpack(e,t,x);t+=Q.Ellipsoid.packedLength;var n=f.VertexFormat.unpack(e,t,g);t+=f.VertexFormat.packedLength;var o=e[t++],s=e[t++],l=e[t++],u=e[t++],m=e[t++],p=e[t++],y=e[t++],c=1===e[t++],d=e[t];return U.defined(r)?(r._center=Q.Cartesian3.clone(a,r._center),r._ellipsoid=Q.Ellipsoid.clone(i,r._ellipsoid),r._vertexFormat=f.VertexFormat.clone(n,r._vertexFormat),r._semiMajorAxis=o,r._semiMinorAxis=s,r._rotation=l,r._stRotation=u,r._height=m,r._granularity=p,r._extrudedHeight=y,r._shadowVolume=c,r._offsetAttribute=-1===d?void 0:d,r):(_.height=m,_.extrudedHeight=y,_.granularity=p,_.stRotation=u,_.rotation=l,_.semiMajorAxis=o,_.semiMinorAxis=s,_.shadowVolume=c,_.offsetAttribute=-1===d?void 0:d,new A(_))},A.computeRectangle=function(e,t){var r=(e=U.defaultValue(e,U.defaultValue.EMPTY_OBJECT)).center,a=U.defaultValue(e.ellipsoid,Q.Ellipsoid.WGS84),i=e.semiMajorAxis,n=e.semiMinorAxis,o=U.defaultValue(e.granularity,y.CesiumMath.RADIANS_PER_DEGREE);return s(r,i,n,U.defaultValue(e.rotation,0),o,a,t)},A.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){var t=e._height,r=e._extrudedHeight,a=!y.CesiumMath.equalsEpsilon(t,r,0,y.CesiumMath.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var i,n={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};if(a)n.extrudedHeight=r,n.shadowVolume=e._shadowVolume,n.offsetAttribute=e._offsetAttribute,i=m(n);else if(i=function(e){var t=e.center;u=Q.Cartesian3.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,u),e.height,u),u=Q.Cartesian3.add(t,u,u);var r=new W.BoundingSphere(u,e.semiMajorAxis),a=B.EllipseGeometryLibrary.computeEllipsePositions(e,!0,!1),i=a.positions,n=a.numPts,o=w(i,e,!1),s=M(n);return{boundingSphere:r,attributes:o,indices:s=v.IndexDatatype.createTypedArray(i.length/3,s)}}(n),U.defined(e._offsetAttribute)){var o=i.attributes.position.values.length,s=new Uint8Array(o/3),l=e._offsetAttribute===K.GeometryOffsetAttribute.NONE?0:1;K.arrayFill(s,l),i.attributes.applyOffset=new q.GeometryAttribute({componentDatatype:J.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:s})}return new q.Geometry({attributes:i.attributes,indices:i.indices,primitiveType:q.PrimitiveType.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:e._offsetAttribute})}},A.createShadowVolume=function(e,t,r){var a=e._granularity,i=e._ellipsoid,n=t(a,i),o=r(a,i);return new A({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:i,rotation:e._rotation,stRotation:e._stRotation,granularity:a,extrudedHeight:n,height:o,vertexFormat:f.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(A.prototype,{rectangle:{get:function(){return U.defined(this._rectangle)||(this._rectangle=s(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return U.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(e){var t=-e._stRotation;if(0==t)return[0,0,0,1,1,0];for(var r=B.EllipseGeometryLibrary.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,a=r.length/3,i=new Array(a),n=0;n<a;++n)i[n]=Q.Cartesian3.fromArray(r,3*n);var o=e._ellipsoid,s=e.rectangle;return q.Geometry._textureCoordinateRotationPoints(i,t,o,s)}(this)),this._textureCoordinateRotationPoints}}}),e.EllipseGeometry=A});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./Math-9d37f659","./Cartesian2-2951f601","./Transforms-53ff6d12"],function(a,R,W,c){"use strict";var r={},x=new W.Cartesian3,M=new W.Cartesian3,f=new c.Quaternion,z=new c.Matrix3;function S(a,r,e,t,i,n,s,o,l,C){var y=a+r;W.Cartesian3.multiplyByScalar(t,Math.cos(y),x),W.Cartesian3.multiplyByScalar(e,Math.sin(y),M),W.Cartesian3.add(x,M,x);var u=Math.cos(a);u*=u;var m=Math.sin(a);m*=m;var h=n/Math.sqrt(s*u+i*m)/o;return c.Quaternion.fromAxisAngle(x,h,f),c.Matrix3.fromQuaternion(f,z),c.Matrix3.multiplyByVector(z,l,C),W.Cartesian3.normalize(C,C),W.Cartesian3.multiplyByScalar(C,o,C),C}var B=new W.Cartesian3,Q=new W.Cartesian3,b=new W.Cartesian3,d=new W.Cartesian3;r.raisePositionsToHeight=function(a,r,e){for(var t=r.ellipsoid,i=r.height,n=r.extrudedHeight,s=e?a.length/3*2:a.length/3,o=new Float64Array(3*s),l=a.length,C=e?l:0,y=0;y<l;y+=3){var u=y+1,m=y+2,h=W.Cartesian3.fromArray(a,y,B);t.scaleToGeodeticSurface(h,h);var c=W.Cartesian3.clone(h,Q),x=t.geodeticSurfaceNormal(h,d),M=W.Cartesian3.multiplyByScalar(x,i,b);W.Cartesian3.add(h,M,h),e&&(W.Cartesian3.multiplyByScalar(x,n,M),W.Cartesian3.add(c,M,c),o[y+C]=c.x,o[u+C]=c.y,o[m+C]=c.z),o[y]=h.x,o[u]=h.y,o[m]=h.z}return o};var G=new W.Cartesian3,H=new W.Cartesian3,N=new W.Cartesian3;r.computeEllipsePositions=function(a,r,e){var t=a.semiMinorAxis,i=a.semiMajorAxis,n=a.rotation,s=a.center,o=8*a.granularity,l=t*t,C=i*i,y=i*t,u=W.Cartesian3.magnitude(s),m=W.Cartesian3.normalize(s,G),h=W.Cartesian3.cross(W.Cartesian3.UNIT_Z,s,H);h=W.Cartesian3.normalize(h,h);var c=W.Cartesian3.cross(m,h,N),x=1+Math.ceil(R.CesiumMath.PI_OVER_TWO/o),M=R.CesiumMath.PI_OVER_TWO/(x-1),f=R.CesiumMath.PI_OVER_TWO-x*M;f<0&&(x-=Math.ceil(Math.abs(f)/M));var z,d,_,v,O,p=r?new Array(3*(x*(x+2)*2)):void 0,w=0,P=B,T=Q,I=4*x*3,g=I-1,E=0,V=e?new Array(I):void 0;for(P=S(f=R.CesiumMath.PI_OVER_TWO,n,c,h,l,y,C,u,m,P),r&&(p[w++]=P.x,p[w++]=P.y,p[w++]=P.z),e&&(V[g--]=P.z,V[g--]=P.y,V[g--]=P.x),f=R.CesiumMath.PI_OVER_TWO-M,z=1;z<x+1;++z){if(P=S(f,n,c,h,l,y,C,u,m,P),T=S(Math.PI-f,n,c,h,l,y,C,u,m,T),r){for(p[w++]=P.x,p[w++]=P.y,p[w++]=P.z,_=2*z+2,d=1;d<_-1;++d)v=d/(_-1),O=W.Cartesian3.lerp(P,T,v,b),p[w++]=O.x,p[w++]=O.y,p[w++]=O.z;p[w++]=T.x,p[w++]=T.y,p[w++]=T.z}e&&(V[g--]=P.z,V[g--]=P.y,V[g--]=P.x,V[E++]=T.x,V[E++]=T.y,V[E++]=T.z),f=R.CesiumMath.PI_OVER_TWO-(z+1)*M}for(z=x;1<z;--z){if(P=S(-(f=R.CesiumMath.PI_OVER_TWO-(z-1)*M),n,c,h,l,y,C,u,m,P),T=S(f+Math.PI,n,c,h,l,y,C,u,m,T),r){for(p[w++]=P.x,p[w++]=P.y,p[w++]=P.z,_=2*(z-1)+2,d=1;d<_-1;++d)v=d/(_-1),O=W.Cartesian3.lerp(P,T,v,b),p[w++]=O.x,p[w++]=O.y,p[w++]=O.z;p[w++]=T.x,p[w++]=T.y,p[w++]=T.z}e&&(V[g--]=P.z,V[g--]=P.y,V[g--]=P.x,V[E++]=T.x,V[E++]=T.y,V[E++]=T.z)}P=S(-(f=R.CesiumMath.PI_OVER_TWO),n,c,h,l,y,C,u,m,P);var A={};return r&&(p[w++]=P.x,p[w++]=P.y,p[w++]=P.z,A.positions=p,A.numPts=x),e&&(V[g--]=P.z,V[g--]=P.y,V[g--]=P.x,A.outerPositions=V),A},a.EllipseGeometryLibrary=r});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./when-60b00257","./Check-4274a1fd","./Math-9d37f659","./Cartesian2-2951f601","./Transforms-53ff6d12","./ComponentDatatype-a29c6075","./GeometryAttribute-2f728681","./GeometryAttributes-130e4d69","./IndexDatatype-527cbd94","./GeometryOffsetAttribute-8756c94a","./EllipseGeometryLibrary-bffb8c3e"],function(e,A,t,_,g,v,x,E,M,C,G,L){"use strict";var O=new g.Cartesian3,u=new g.Cartesian3;var S=new v.BoundingSphere,V=new v.BoundingSphere;function c(e){var t=(e=A.defaultValue(e,A.defaultValue.EMPTY_OBJECT)).center,i=A.defaultValue(e.ellipsoid,g.Ellipsoid.WGS84),r=e.semiMajorAxis,a=e.semiMinorAxis,n=A.defaultValue(e.granularity,_.CesiumMath.RADIANS_PER_DEGREE),o=A.defaultValue(e.height,0),s=A.defaultValue(e.extrudedHeight,o);this._center=g.Cartesian3.clone(t),this._semiMajorAxis=r,this._semiMinorAxis=a,this._ellipsoid=g.Ellipsoid.clone(i),this._rotation=A.defaultValue(e.rotation,0),this._height=Math.max(s,o),this._granularity=n,this._extrudedHeight=Math.min(s,o),this._numberOfVerticalLines=Math.max(A.defaultValue(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}c.packedLength=g.Cartesian3.packedLength+g.Ellipsoid.packedLength+8,c.pack=function(e,t,i){return i=A.defaultValue(i,0),g.Cartesian3.pack(e._center,t,i),i+=g.Cartesian3.packedLength,g.Ellipsoid.pack(e._ellipsoid,t,i),i+=g.Ellipsoid.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=A.defaultValue(e._offsetAttribute,-1),t};var m=new g.Cartesian3,h=new g.Ellipsoid,y={center:m,ellipsoid:h,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};c.unpack=function(e,t,i){t=A.defaultValue(t,0);var r=g.Cartesian3.unpack(e,t,m);t+=g.Cartesian3.packedLength;var a=g.Ellipsoid.unpack(e,t,h);t+=g.Ellipsoid.packedLength;var n=e[t++],o=e[t++],s=e[t++],l=e[t++],u=e[t++],d=e[t++],f=e[t++],p=e[t];return A.defined(i)?(i._center=g.Cartesian3.clone(r,i._center),i._ellipsoid=g.Ellipsoid.clone(a,i._ellipsoid),i._semiMajorAxis=n,i._semiMinorAxis=o,i._rotation=s,i._height=l,i._granularity=u,i._extrudedHeight=d,i._numberOfVerticalLines=f,i._offsetAttribute=-1===p?void 0:p,i):(y.height=l,y.extrudedHeight=d,y.granularity=u,y.rotation=s,y.semiMajorAxis=n,y.semiMinorAxis=o,y.numberOfVerticalLines=f,y.offsetAttribute=-1===p?void 0:p,new c(y))},c.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){var t=e._height,i=e._extrudedHeight,r=!_.CesiumMath.equalsEpsilon(t,i,0,_.CesiumMath.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var a,n={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};if(r)n.extrudedHeight=i,n.offsetAttribute=e._offsetAttribute,a=function(e){var t=e.center,i=e.ellipsoid,r=e.semiMajorAxis,a=g.Cartesian3.multiplyByScalar(i.geodeticSurfaceNormal(t,O),e.height,O);S.center=g.Cartesian3.add(t,a,S.center),S.radius=r,a=g.Cartesian3.multiplyByScalar(i.geodeticSurfaceNormal(t,a),e.extrudedHeight,a),V.center=g.Cartesian3.add(t,a,V.center),V.radius=r;var n=L.EllipseGeometryLibrary.computeEllipsePositions(e,!1,!0).outerPositions,o=new M.GeometryAttributes({position:new E.GeometryAttribute({componentDatatype:x.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:L.EllipseGeometryLibrary.raisePositionsToHeight(n,e,!0)})});n=o.position.values;var s=v.BoundingSphere.union(S,V),l=n.length/3;if(A.defined(e.offsetAttribute)){var u=new Uint8Array(l);if(e.offsetAttribute===G.GeometryOffsetAttribute.TOP)u=G.arrayFill(u,1,0,l/2);else{var d=e.offsetAttribute===G.GeometryOffsetAttribute.NONE?0:1;u=G.arrayFill(u,d)}o.applyOffset=new E.GeometryAttribute({componentDatatype:x.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}var f=A.defaultValue(e.numberOfVerticalLines,16);f=_.CesiumMath.clamp(f,0,l/2);var p=C.IndexDatatype.createTypedArray(l,2*l+2*f);l/=2;var c,m,h=0;for(c=0;c<l;++c)p[h++]=c,p[h++]=(c+1)%l,p[h++]=c+l,p[h++]=(c+1)%l+l;if(0<f){var y=Math.min(f,l);m=Math.round(l/y);var b=Math.min(m*f,l);for(c=0;c<b;c+=m)p[h++]=c,p[h++]=c+l}return{boundingSphere:s,attributes:o,indices:p}}(n);else if(a=function(e){var t=e.center;u=g.Cartesian3.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,u),e.height,u),u=g.Cartesian3.add(t,u,u);for(var i=new v.BoundingSphere(u,e.semiMajorAxis),r=L.EllipseGeometryLibrary.computeEllipsePositions(e,!1,!0).outerPositions,a=new M.GeometryAttributes({position:new E.GeometryAttribute({componentDatatype:x.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:L.EllipseGeometryLibrary.raisePositionsToHeight(r,e,!1)})}),n=r.length/3,o=C.IndexDatatype.createTypedArray(n,2*n),s=0,l=0;l<n;++l)o[s++]=l,o[s++]=(l+1)%n;return{boundingSphere:i,attributes:a,indices:o}}(n),A.defined(e._offsetAttribute)){var o=a.attributes.position.values.length,s=new Uint8Array(o/3),l=e._offsetAttribute===G.GeometryOffsetAttribute.NONE?0:1;G.arrayFill(s,l),a.attributes.applyOffset=new E.GeometryAttribute({componentDatatype:x.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:s})}return new E.Geometry({attributes:a.attributes,indices:a.indices,primitiveType:E.PrimitiveType.LINES,boundingSphere:a.boundingSphere,offsetAttribute:e._offsetAttribute})}},e.EllipseOutlineGeometry=c});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./when-60b00257","./Check-4274a1fd","./Math-9d37f659","./Cartesian2-2951f601"],function(t,w,a,T,R){"use strict";function z(t,a,i,n,e,s,r){var h,o,d=(h=t)*(o=i)*(4+h*(4-3*o))/16;return(1-d)*t*a*(n+d*e*(r+d*s*(2*r*r-1)))}var y=new R.Cartesian3,E=new R.Cartesian3;function e(t,a,i,n){var e,s,r,h,o,d,u,c,M,l,g,_,p,f,v,m,C,H,O,S,q,U,w,A,b;R.Cartesian3.normalize(n.cartographicToCartesian(a,E),y),R.Cartesian3.normalize(n.cartographicToCartesian(i,E),E);!function(t,a,i,n,e,s,r){var h,o,d,u,c,M=(a-i)/a,l=s-n,g=Math.atan((1-M)*Math.tan(e)),_=Math.atan((1-M)*Math.tan(r)),p=Math.cos(g),f=Math.sin(g),v=Math.cos(_),m=Math.sin(_),C=p*v,H=p*m,O=f*m,S=f*v,q=l,U=T.CesiumMath.TWO_PI,w=Math.cos(q),A=Math.sin(q);do{w=Math.cos(q),A=Math.sin(q);var b,R=H-S*w;d=Math.sqrt(v*v*A*A+R*R),o=O+C*w,h=Math.atan2(d,o),U=q,c=o-2*O/(u=0===d?(b=0,1):1-(b=C*A/d)*b),isNaN(c)&&(c=0),q=l+z(M,b,u,h,d,o,c)}while(Math.abs(q-U)>T.CesiumMath.EPSILON12);var y=u*(a*a-i*i)/(i*i),E=y*(256+y*(y*(74-47*y)-128))/1024,P=c*c,x=i*(1+y*(4096+y*(y*(320-175*y)-768))/16384)*(h-E*d*(c+E*(o*(2*P-1)-E*c*(4*d*d-3)*(4*P-3)/6)/4)),D=Math.atan2(v*A,H-S*w),N=Math.atan2(p*A,H*w-S);t._distance=x,t._startHeading=D,t._endHeading=N,t._uSquared=y}(t,n.maximumRadius,n.minimumRadius,a.longitude,a.latitude,i.longitude,i.latitude),t._start=R.Cartographic.clone(a,t._start),t._end=R.Cartographic.clone(i,t._end),t._start.height=0,t._end.height=0,s=(e=t)._uSquared,r=e._ellipsoid.maximumRadius,h=e._ellipsoid.minimumRadius,o=(r-h)/r,d=Math.cos(e._startHeading),u=Math.sin(e._startHeading),c=(1-o)*Math.tan(e._start.latitude),M=1/Math.sqrt(1+c*c),l=M*c,g=Math.atan2(c,d),f=1-(p=(_=M*u)*_),v=Math.sqrt(f),U=1-3*(m=s/4)+35*(C=m*m)/4,w=1-5*m,A=(S=1+m-3*C/4+5*(H=C*m)/4-175*(O=C*C)/64)*g-(q=1-m+15*C/8-35*H/8)*Math.sin(2*g)*m/2-U*Math.sin(4*g)*C/16-w*Math.sin(6*g)*H/48-5*Math.sin(8*g)*O/512,(b=e._constants).a=r,b.b=h,b.f=o,b.cosineHeading=d,b.sineHeading=u,b.tanU=c,b.cosineU=M,b.sineU=l,b.sigma=g,b.sineAlpha=_,b.sineSquaredAlpha=p,b.cosineSquaredAlpha=f,b.cosineAlpha=v,b.u2Over4=m,b.u4Over16=C,b.u6Over64=H,b.u8Over256=O,b.a0=S,b.a1=q,b.a2=U,b.a3=w,b.distanceRatio=A}function i(t,a,i){var n=w.defaultValue(i,R.Ellipsoid.WGS84);this._ellipsoid=n,this._start=new R.Cartographic,this._end=new R.Cartographic,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,w.defined(t)&&w.defined(a)&&e(this,t,a,n)}Object.defineProperties(i.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),i.prototype.setEndPoints=function(t,a){e(this,t,a,this._ellipsoid)},i.prototype.interpolateUsingFraction=function(t,a){return this.interpolateUsingSurfaceDistance(this._distance*t,a)},i.prototype.interpolateUsingSurfaceDistance=function(t,a){var i=this._constants,n=i.distanceRatio+t/i.b,e=Math.cos(2*n),s=Math.cos(4*n),r=Math.cos(6*n),h=Math.sin(2*n),o=Math.sin(4*n),d=Math.sin(6*n),u=Math.sin(8*n),c=n*n,M=n*c,l=i.u8Over256,g=i.u2Over4,_=i.u6Over64,p=i.u4Over16,f=2*M*l*e/3+n*(1-g+7*p/4-15*_/4+579*l/64-(p-15*_/4+187*l/16)*e-(5*_/4-115*l/16)*s-29*l*r/16)+(g/2-p+71*_/32-85*l/16)*h+(5*p/16-5*_/4+383*l/96)*o-c*((_-11*l/2)*h+5*l*o/2)+(29*_/96-29*l/16)*d+539*l*u/1536,v=Math.asin(Math.sin(f)*i.cosineAlpha),m=Math.atan(i.a/i.b*Math.tan(v));f-=i.sigma;var C=Math.cos(2*i.sigma+f),H=Math.sin(f),O=Math.cos(f),S=i.cosineU*O,q=i.sineU*H,U=Math.atan2(H*i.sineHeading,S-q*i.cosineHeading)-z(i.f,i.sineAlpha,i.cosineSquaredAlpha,f,H,O,C);return w.defined(a)?(a.longitude=this._start.longitude+U,a.latitude=m,a.height=0,a):new R.Cartographic(this._start.longitude+U,m,0)},t.EllipsoidGeodesic=i});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./when-60b00257","./Check-4274a1fd","./Math-9d37f659","./Cartesian2-2951f601","./Transforms-53ff6d12","./ComponentDatatype-a29c6075","./GeometryAttribute-2f728681","./GeometryAttributes-130e4d69","./IndexDatatype-527cbd94","./GeometryOffsetAttribute-8756c94a","./VertexFormat-6af5bab1"],function(t,ut,e,lt,ft,ct,dt,Ct,pt,yt,_t,d){"use strict";var vt=new ft.Cartesian3,ht=new ft.Cartesian3,At=new ft.Cartesian3,xt=new ft.Cartesian3,bt=new ft.Cartesian3,l=new ft.Cartesian3(1,1,1),kt=Math.cos,wt=Math.sin;function C(t){t=ut.defaultValue(t,ut.defaultValue.EMPTY_OBJECT);var e=ut.defaultValue(t.radii,l),a=ut.defaultValue(t.innerRadii,e),i=ut.defaultValue(t.minimumClock,0),r=ut.defaultValue(t.maximumClock,lt.CesiumMath.TWO_PI),n=ut.defaultValue(t.minimumCone,0),o=ut.defaultValue(t.maximumCone,lt.CesiumMath.PI),m=Math.round(ut.defaultValue(t.stackPartitions,64)),s=Math.round(ut.defaultValue(t.slicePartitions,64)),u=ut.defaultValue(t.vertexFormat,d.VertexFormat.DEFAULT);this._radii=ft.Cartesian3.clone(e),this._innerRadii=ft.Cartesian3.clone(a),this._minimumClock=i,this._maximumClock=r,this._minimumCone=n,this._maximumCone=o,this._stackPartitions=m,this._slicePartitions=s,this._vertexFormat=d.VertexFormat.clone(u),this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidGeometry"}C.packedLength=2*ft.Cartesian3.packedLength+d.VertexFormat.packedLength+7,C.pack=function(t,e,a){return a=ut.defaultValue(a,0),ft.Cartesian3.pack(t._radii,e,a),a+=ft.Cartesian3.packedLength,ft.Cartesian3.pack(t._innerRadii,e,a),a+=ft.Cartesian3.packedLength,d.VertexFormat.pack(t._vertexFormat,e,a),a+=d.VertexFormat.packedLength,e[a++]=t._minimumClock,e[a++]=t._maximumClock,e[a++]=t._minimumCone,e[a++]=t._maximumCone,e[a++]=t._stackPartitions,e[a++]=t._slicePartitions,e[a]=ut.defaultValue(t._offsetAttribute,-1),e};var a,p=new ft.Cartesian3,y=new ft.Cartesian3,_=new d.VertexFormat,v={radii:p,innerRadii:y,vertexFormat:_,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};C.unpack=function(t,e,a){e=ut.defaultValue(e,0);var i=ft.Cartesian3.unpack(t,e,p);e+=ft.Cartesian3.packedLength;var r=ft.Cartesian3.unpack(t,e,y);e+=ft.Cartesian3.packedLength;var n=d.VertexFormat.unpack(t,e,_);e+=d.VertexFormat.packedLength;var o=t[e++],m=t[e++],s=t[e++],u=t[e++],l=t[e++],f=t[e++],c=t[e];return ut.defined(a)?(a._radii=ft.Cartesian3.clone(i,a._radii),a._innerRadii=ft.Cartesian3.clone(r,a._innerRadii),a._vertexFormat=d.VertexFormat.clone(n,a._vertexFormat),a._minimumClock=o,a._maximumClock=m,a._minimumCone=s,a._maximumCone=u,a._stackPartitions=l,a._slicePartitions=f,a._offsetAttribute=-1===c?void 0:c,a):(v.minimumClock=o,v.maximumClock=m,v.minimumCone=s,v.maximumCone=u,v.stackPartitions=l,v.slicePartitions=f,v.offsetAttribute=-1===c?void 0:c,new C(v))},C.createGeometry=function(t){var e=t._radii;if(!(e.x<=0||e.y<=0||e.z<=0)){var a=t._innerRadii;if(!(a.x<=0||a.y<=0||a.z<=0)){var i,r,n=t._minimumClock,o=t._maximumClock,m=t._minimumCone,s=t._maximumCone,u=t._vertexFormat,l=t._slicePartitions+1,f=t._stackPartitions+1;(l=Math.round(l*Math.abs(o-n)/lt.CesiumMath.TWO_PI))<2&&(l=2),(f=Math.round(f*Math.abs(s-m)/lt.CesiumMath.PI))<2&&(f=2);var c=0,d=[m],C=[n];for(i=0;i<f;i++)d.push(m+i*(s-m)/(f-1));for(d.push(s),r=0;r<l;r++)C.push(n+r*(o-n)/(l-1));C.push(o);var p=d.length,y=C.length,_=0,v=1,h=a.x!==e.x||a.y!==e.y||a.z!==e.z,A=!1,x=!1,b=!1;h&&(v=2,0<m&&(A=!0,_+=l-1),s<Math.PI&&(x=!0,_+=l-1),(o-n)%lt.CesiumMath.TWO_PI?(b=!0,_+=2*(f-1)+1):_+=1);var k=y*p*v,w=new Float64Array(3*k),F=_t.arrayFill(new Array(k),!1),P=_t.arrayFill(new Array(k),!1),g=l*f*v,V=6*(g+_+1-(l+f)*v),M=yt.IndexDatatype.createTypedArray(g,V),T=u.normal?new Float32Array(3*k):void 0,D=u.tangent?new Float32Array(3*k):void 0,G=u.bitangent?new Float32Array(3*k):void 0,L=u.st?new Float32Array(2*k):void 0,O=new Array(p),I=new Array(p);for(i=0;i<p;i++)O[i]=wt(d[i]),I[i]=kt(d[i]);var E=new Array(y),z=new Array(y);for(r=0;r<y;r++)z[r]=kt(C[r]),E[r]=wt(C[r]);for(i=0;i<p;i++)for(r=0;r<y;r++)w[c++]=e.x*O[i]*z[r],w[c++]=e.y*O[i]*E[r],w[c++]=e.z*I[i];var N,R,U,S,B=k/2;if(h)for(i=0;i<p;i++)for(r=0;r<y;r++)w[c++]=a.x*O[i]*z[r],w[c++]=a.y*O[i]*E[r],w[c++]=a.z*I[i],F[B]=!0,0<i&&i!==p-1&&0!==r&&r!==y-1&&(P[B]=!0),B++;for(c=0,i=1;i<p-2;i++)for(N=i*y,R=(i+1)*y,r=1;r<y-2;r++)M[c++]=R+r,M[c++]=R+r+1,M[c++]=N+r+1,M[c++]=R+r,M[c++]=N+r+1,M[c++]=N+r;if(h){var W=p*y;for(i=1;i<p-2;i++)for(N=W+i*y,R=W+(i+1)*y,r=1;r<y-2;r++)M[c++]=R+r,M[c++]=N+r,M[c++]=N+r+1,M[c++]=R+r,M[c++]=N+r+1,M[c++]=R+r+1}if(h){if(A)for(S=p*y,i=1;i<y-2;i++)M[c++]=i,M[c++]=i+1,M[c++]=S+i+1,M[c++]=i,M[c++]=S+i+1,M[c++]=S+i;if(x)for(U=p*y-y,S=p*y*v-y,i=1;i<y-2;i++)M[c++]=U+i+1,M[c++]=U+i,M[c++]=S+i,M[c++]=U+i+1,M[c++]=S+i,M[c++]=S+i+1}if(b){for(i=1;i<p-2;i++)S=y*p+y*i,U=y*i,M[c++]=S,M[c++]=U+y,M[c++]=U,M[c++]=S,M[c++]=S+y,M[c++]=U+y;for(i=1;i<p-2;i++)S=y*p+y*(i+1)-1,U=y*(i+1)-1,M[c++]=U+y,M[c++]=S,M[c++]=U,M[c++]=U+y,M[c++]=S+y,M[c++]=S}var Y=new pt.GeometryAttributes;u.position&&(Y.position=new Ct.GeometryAttribute({componentDatatype:dt.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:w}));var J,X=0,Z=0,j=0,q=0,H=k/2,K=ft.Ellipsoid.fromCartesian3(e),Q=ft.Ellipsoid.fromCartesian3(a);if(u.st||u.normal||u.tangent||u.bitangent){for(i=0;i<k;i++){J=F[i]?Q:K;var $=ft.Cartesian3.fromArray(w,3*i,vt),tt=J.geodeticSurfaceNormal($,ht);if(P[i]&&ft.Cartesian3.negate(tt,tt),u.st){var et=ft.Cartesian2.negate(tt,bt);L[X++]=Math.atan2(et.y,et.x)/lt.CesiumMath.TWO_PI+.5,L[X++]=Math.asin(tt.z)/Math.PI+.5}if(u.normal&&(T[Z++]=tt.x,T[Z++]=tt.y,T[Z++]=tt.z),u.tangent||u.bitangent){var at,it=At,rt=0;if(F[i]&&(rt=H),at=!A&&rt<=i&&i<rt+2*y?ft.Cartesian3.UNIT_X:ft.Cartesian3.UNIT_Z,ft.Cartesian3.cross(at,tt,it),ft.Cartesian3.normalize(it,it),u.tangent&&(D[j++]=it.x,D[j++]=it.y,D[j++]=it.z),u.bitangent){var nt=ft.Cartesian3.cross(tt,it,xt);ft.Cartesian3.normalize(nt,nt),G[q++]=nt.x,G[q++]=nt.y,G[q++]=nt.z}}}u.st&&(Y.st=new Ct.GeometryAttribute({componentDatatype:dt.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:L})),u.normal&&(Y.normal=new Ct.GeometryAttribute({componentDatatype:dt.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:T})),u.tangent&&(Y.tangent=new Ct.GeometryAttribute({componentDatatype:dt.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:D})),u.bitangent&&(Y.bitangent=new Ct.GeometryAttribute({componentDatatype:dt.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:G}))}if(ut.defined(t._offsetAttribute)){var ot=w.length,mt=new Uint8Array(ot/3),st=t._offsetAttribute===_t.GeometryOffsetAttribute.NONE?0:1;_t.arrayFill(mt,st),Y.applyOffset=new Ct.GeometryAttribute({componentDatatype:dt.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:mt})}return new Ct.Geometry({attributes:Y,indices:M,primitiveType:Ct.PrimitiveType.TRIANGLES,boundingSphere:ct.BoundingSphere.fromEllipsoid(K),offsetAttribute:t._offsetAttribute})}}},C.getUnitEllipsoid=function(){return ut.defined(a)||(a=C.createGeometry(new C({radii:new ft.Cartesian3(1,1,1),vertexFormat:d.VertexFormat.POSITION_ONLY}))),a},t.EllipsoidGeometry=C});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./when-60b00257","./Check-4274a1fd","./Math-9d37f659","./Cartesian2-2951f601","./Transforms-53ff6d12","./ComponentDatatype-a29c6075","./GeometryAttribute-2f728681","./GeometryAttributes-130e4d69","./IndexDatatype-527cbd94","./GeometryOffsetAttribute-8756c94a"],function(i,R,t,N,B,S,U,F,W,Y,J){"use strict";var f=new B.Cartesian3(1,1,1),j=Math.cos,q=Math.sin;function c(i){i=R.defaultValue(i,R.defaultValue.EMPTY_OBJECT);var t=R.defaultValue(i.radii,f),e=R.defaultValue(i.innerRadii,t),a=R.defaultValue(i.minimumClock,0),n=R.defaultValue(i.maximumClock,N.CesiumMath.TWO_PI),r=R.defaultValue(i.minimumCone,0),o=R.defaultValue(i.maximumCone,N.CesiumMath.PI),s=Math.round(R.defaultValue(i.stackPartitions,10)),m=Math.round(R.defaultValue(i.slicePartitions,8)),u=Math.round(R.defaultValue(i.subdivisions,128));this._radii=B.Cartesian3.clone(t),this._innerRadii=B.Cartesian3.clone(e),this._minimumClock=a,this._maximumClock=n,this._minimumCone=r,this._maximumCone=o,this._stackPartitions=s,this._slicePartitions=m,this._subdivisions=u,this._offsetAttribute=i.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}c.packedLength=2*B.Cartesian3.packedLength+8,c.pack=function(i,t,e){return e=R.defaultValue(e,0),B.Cartesian3.pack(i._radii,t,e),e+=B.Cartesian3.packedLength,B.Cartesian3.pack(i._innerRadii,t,e),e+=B.Cartesian3.packedLength,t[e++]=i._minimumClock,t[e++]=i._maximumClock,t[e++]=i._minimumCone,t[e++]=i._maximumCone,t[e++]=i._stackPartitions,t[e++]=i._slicePartitions,t[e++]=i._subdivisions,t[e]=R.defaultValue(i._offsetAttribute,-1),t};var C=new B.Cartesian3,_=new B.Cartesian3,h={radii:C,innerRadii:_,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};c.unpack=function(i,t,e){t=R.defaultValue(t,0);var a=B.Cartesian3.unpack(i,t,C);t+=B.Cartesian3.packedLength;var n=B.Cartesian3.unpack(i,t,_);t+=B.Cartesian3.packedLength;var r=i[t++],o=i[t++],s=i[t++],m=i[t++],u=i[t++],f=i[t++],d=i[t++],l=i[t];return R.defined(e)?(e._radii=B.Cartesian3.clone(a,e._radii),e._innerRadii=B.Cartesian3.clone(n,e._innerRadii),e._minimumClock=r,e._maximumClock=o,e._minimumCone=s,e._maximumCone=m,e._stackPartitions=u,e._slicePartitions=f,e._subdivisions=d,e._offsetAttribute=-1===l?void 0:l,e):(h.minimumClock=r,h.maximumClock=o,h.minimumCone=s,h.maximumCone=m,h.stackPartitions=u,h.slicePartitions=f,h.subdivisions=d,h.offsetAttribute=-1===l?void 0:l,new c(h))},c.createGeometry=function(i){var t=i._radii;if(!(t.x<=0||t.y<=0||t.z<=0)){var e=i._innerRadii;if(!(e.x<=0||e.y<=0||e.z<=0)){var a=i._minimumClock,n=i._maximumClock,r=i._minimumCone,o=i._maximumCone,s=i._subdivisions,m=B.Ellipsoid.fromCartesian3(t),u=i._slicePartitions+1,f=i._stackPartitions+1;(u=Math.round(u*Math.abs(n-a)/N.CesiumMath.TWO_PI))<2&&(u=2),(f=Math.round(f*Math.abs(o-r)/N.CesiumMath.PI))<2&&(f=2);var d=0,l=1,c=e.x!==t.x||e.y!==t.y||e.z!==t.z,C=!1,_=!1;c&&(l=2,0<r&&(C=!0,d+=u),o<Math.PI&&(_=!0,d+=u));var h,p,v,y,k=s*l*(f+u),b=new Float64Array(3*k),A=2*(k+d-(u+f)*l),x=Y.IndexDatatype.createTypedArray(k,A),P=0,w=new Array(f),M=new Array(f);for(h=0;h<f;h++)y=r+h*(o-r)/(f-1),w[h]=q(y),M[h]=j(y);var V=new Array(s),g=new Array(s);for(h=0;h<s;h++)v=a+h*(n-a)/(s-1),V[h]=q(v),g[h]=j(v);for(h=0;h<f;h++)for(p=0;p<s;p++)b[P++]=t.x*w[h]*g[p],b[P++]=t.y*w[h]*V[p],b[P++]=t.z*M[h];if(c)for(h=0;h<f;h++)for(p=0;p<s;p++)b[P++]=e.x*w[h]*g[p],b[P++]=e.y*w[h]*V[p],b[P++]=e.z*M[h];for(w.length=s,M.length=s,h=0;h<s;h++)y=r+h*(o-r)/(s-1),w[h]=q(y),M[h]=j(y);for(V.length=u,g.length=u,h=0;h<u;h++)v=a+h*(n-a)/(u-1),V[h]=q(v),g[h]=j(v);for(h=0;h<s;h++)for(p=0;p<u;p++)b[P++]=t.x*w[h]*g[p],b[P++]=t.y*w[h]*V[p],b[P++]=t.z*M[h];if(c)for(h=0;h<s;h++)for(p=0;p<u;p++)b[P++]=e.x*w[h]*g[p],b[P++]=e.y*w[h]*V[p],b[P++]=e.z*M[h];for(h=P=0;h<f*l;h++){var G=h*s;for(p=0;p<s-1;p++)x[P++]=G+p,x[P++]=G+p+1}var E=f*s*l;for(h=0;h<u;h++)for(p=0;p<s-1;p++)x[P++]=E+h+p*u,x[P++]=E+h+(p+1)*u;if(c)for(E=f*s*l+u*s,h=0;h<u;h++)for(p=0;p<s-1;p++)x[P++]=E+h+p*u,x[P++]=E+h+(p+1)*u;if(c){var O=f*s*l,D=O+s*u;if(C)for(h=0;h<u;h++)x[P++]=O+h,x[P++]=D+h;if(_)for(O+=s*u-u,D+=s*u-u,h=0;h<u;h++)x[P++]=O+h,x[P++]=D+h}var I=new W.GeometryAttributes({position:new F.GeometryAttribute({componentDatatype:U.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:b})});if(R.defined(i._offsetAttribute)){var T=b.length,z=new Uint8Array(T/3),L=i._offsetAttribute===J.GeometryOffsetAttribute.NONE?0:1;J.arrayFill(z,L),I.applyOffset=new F.GeometryAttribute({componentDatatype:U.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:z})}return new F.Geometry({attributes:I,indices:x,primitiveType:F.PrimitiveType.LINES,boundingSphere:S.BoundingSphere.fromEllipsoid(m),offsetAttribute:i._offsetAttribute})}}},i.EllipsoidOutlineGeometry=c});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./when-60b00257","./Check-4274a1fd","./Math-9d37f659","./Cartesian2-2951f601"],function(t,m,i,_,g){"use strict";function p(t,i,a){if(0===t)return i*a;var e=t*t,n=e*e,s=n*e,h=s*e,u=h*e,r=u*e,o=a;return i*((1-e/4-3*n/64-5*s/256-175*h/16384-441*u/65536-4851*r/1048576)*o-(3*e/8+3*n/32+45*s/1024+105*h/4096+2205*u/131072+6237*r/524288)*Math.sin(2*o)+(15*n/256+45*s/1024+525*h/16384+1575*u/65536+155925*r/8388608)*Math.sin(4*o)-(35*s/3072+175*h/12288+3675*u/262144+13475*r/1048576)*Math.sin(6*o)+(315*h/131072+2205*u/524288+43659*r/8388608)*Math.sin(8*o)-(693*u/1310720+6237*r/5242880)*Math.sin(10*o)+1001*r/8388608*Math.sin(12*o))}function C(t,i){if(0===t)return Math.log(Math.tan(.5*(_.CesiumMath.PI_OVER_TWO+i)));var a=t*Math.sin(i);return Math.log(Math.tan(.5*(_.CesiumMath.PI_OVER_TWO+i)))-t/2*Math.log((1+a)/(1-a))}var f=new g.Cartesian3,P=new g.Cartesian3;function n(t,i,a,e){g.Cartesian3.normalize(e.cartographicToCartesian(i,P),f),g.Cartesian3.normalize(e.cartographicToCartesian(a,P),P);var n,s,h,u,r,o,l,d=e.maximumRadius,M=e.minimumRadius,c=d*d,m=M*M;t._ellipticitySquared=(c-m)/c,t._ellipticity=Math.sqrt(t._ellipticitySquared),t._start=g.Cartographic.clone(i,t._start),t._start.height=0,t._end=g.Cartographic.clone(a,t._end),t._end.height=0,t._heading=(n=t,s=i.longitude,h=i.latitude,u=a.longitude,r=a.latitude,o=C(n._ellipticity,h),l=C(n._ellipticity,r),Math.atan2(_.CesiumMath.negativePiToPi(u-s),l-o)),t._distance=function(t,i,a,e,n,s,h){var u=t._heading,r=s-e,o=0;if(_.CesiumMath.equalsEpsilon(Math.abs(u),_.CesiumMath.PI_OVER_TWO,_.CesiumMath.EPSILON8))if(i===a)o=i*Math.cos(n)*_.CesiumMath.negativePiToPi(r);else{var l=Math.sin(n);o=i*Math.cos(n)*_.CesiumMath.negativePiToPi(r)/Math.sqrt(1-t._ellipticitySquared*l*l)}else{var d=p(t._ellipticity,i,n);o=(p(t._ellipticity,i,h)-d)/Math.cos(u)}return Math.abs(o)}(t,e.maximumRadius,e.minimumRadius,i.longitude,i.latitude,a.longitude,a.latitude)}function M(t,i,a,e,n,s){var h,u,r,o=n*n;if(Math.abs(_.CesiumMath.PI_OVER_TWO-Math.abs(i))>_.CesiumMath.EPSILON8){u=function(t,i,a){var e=t/a;if(0===i)return e;var n=e*e,s=n*e,h=s*e,u=i*i,r=u*u,o=r*u,l=o*u,d=l*u,M=d*u,c=Math.sin(2*e),m=Math.cos(2*e),_=Math.sin(4*e),g=Math.cos(4*e),p=Math.sin(6*e),C=Math.cos(6*e),f=Math.sin(8*e),P=Math.cos(8*e),v=Math.sin(10*e);return e+e*u/4+7*e*r/64+15*e*o/256+579*e*l/16384+1515*e*d/65536+16837*e*M/1048576+(3*e*r/16+45*e*o/256-e*(32*n-561)*l/4096-e*(232*n-1677)*d/16384+e*(399985-90560*n+512*h)*M/5242880)*m+(21*e*o/256+483*e*l/4096-e*(224*n-1969)*d/16384-e*(33152*n-112599)*M/1048576)*g+(151*e*l/4096+4681*e*d/65536+1479*e*M/16384-453*s*M/32768)*C+(1097*e*d/65536+42783*e*M/1048576)*P+8011*e*M/1048576*Math.cos(10*e)+(3*u/8+3*r/16+213*o/2048-3*n*o/64+255*l/4096-33*n*l/512+20861*d/524288-33*n*d/512+h*d/1024+28273*M/1048576-471*n*M/8192+9*h*M/4096)*c+(21*r/256+21*o/256+533*l/8192-21*n*l/512+197*d/4096-315*n*d/4096+584039*M/16777216-12517*n*M/131072+7*h*M/2048)*_+(151*o/6144+151*l/4096+5019*d/131072-453*n*d/16384+26965*M/786432-8607*n*M/131072)*p+(1097*l/131072+1097*d/65536+225797*M/10485760-1097*n*M/65536)*f+(8011*d/2621440+8011*M/1048576)*v+293393*M/251658240*Math.sin(12*e)}(p(n,e,t.latitude)+a*Math.cos(i),n,e);var l=C(n,t.latitude),d=C(n,u);r=Math.tan(i)*(d-l),h=_.CesiumMath.negativePiToPi(t.longitude+r)}else{var M;if(u=t.latitude,0===n)M=e*Math.cos(t.latitude);else{var c=Math.sin(t.latitude);M=e*Math.cos(t.latitude)/Math.sqrt(1-o*c*c)}r=a/M,h=0<i?_.CesiumMath.negativePiToPi(t.longitude+r):_.CesiumMath.negativePiToPi(t.longitude-r)}return m.defined(s)?(s.longitude=h,s.latitude=u,s.height=0,s):new g.Cartographic(h,u,0)}function c(t,i,a){var e=m.defaultValue(a,g.Ellipsoid.WGS84);this._ellipsoid=e,this._start=new g.Cartographic,this._end=new g.Cartographic,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,m.defined(t)&&m.defined(i)&&n(this,t,i,e)}Object.defineProperties(c.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}}),c.fromStartHeadingDistance=function(t,i,a,e,n){var s=m.defaultValue(e,g.Ellipsoid.WGS84),h=s.maximumRadius,u=s.minimumRadius,r=h*h,o=u*u,l=Math.sqrt((r-o)/r),d=M(t,i=_.CesiumMath.negativePiToPi(i),a,s.maximumRadius,l);return!m.defined(n)||m.defined(e)&&!e.equals(n.ellipsoid)?new c(t,d,s):(n.setEndPoints(t,d),n)},c.prototype.setEndPoints=function(t,i){n(this,t,i,this._ellipsoid)},c.prototype.interpolateUsingFraction=function(t,i){return this.interpolateUsingSurfaceDistance(t*this._distance,i)},c.prototype.interpolateUsingSurfaceDistance=function(t,i){return M(this._start,this._heading,t,this._ellipsoid.maximumRadius,this._ellipticity,i)},c.prototype.findIntersectionWithLongitude=function(t,i){var a=this._ellipticity,e=this._heading,n=Math.abs(e),s=this._start;if(t=_.CesiumMath.negativePiToPi(t),_.CesiumMath.equalsEpsilon(Math.abs(t),Math.PI,_.CesiumMath.EPSILON14)&&(t=_.CesiumMath.sign(s.longitude)*Math.PI),m.defined(i)||(i=new g.Cartographic),Math.abs(_.CesiumMath.PI_OVER_TWO-n)<=_.CesiumMath.EPSILON8)return i.longitude=t,i.latitude=s.latitude,i.height=0,i;if(_.CesiumMath.equalsEpsilon(Math.abs(_.CesiumMath.PI_OVER_TWO-n),_.CesiumMath.PI_OVER_TWO,_.CesiumMath.EPSILON8)){if(_.CesiumMath.equalsEpsilon(t,s.longitude,_.CesiumMath.EPSILON12))return;return i.longitude=t,i.latitude=_.CesiumMath.PI_OVER_TWO*_.CesiumMath.sign(_.CesiumMath.PI_OVER_TWO-e),i.height=0,i}var h,u=s.latitude,r=a*Math.sin(u),o=Math.tan(.5*(_.CesiumMath.PI_OVER_TWO+u))*Math.exp((t-s.longitude)/Math.tan(e)),l=(1+r)/(1-r),d=s.latitude;do{h=d;var M=a*Math.sin(h),c=(1+M)/(1-M);d=2*Math.atan(o*Math.pow(c/l,a/2))-_.CesiumMath.PI_OVER_TWO}while(!_.CesiumMath.equalsEpsilon(d,h,_.CesiumMath.EPSILON12));return i.longitude=t,i.latitude=d,i.height=0,i},c.prototype.findIntersectionWithLatitude=function(t,i){var a=this._ellipticity,e=this._heading,n=this._start;if(!_.CesiumMath.equalsEpsilon(Math.abs(e),_.CesiumMath.PI_OVER_TWO,_.CesiumMath.EPSILON8)){var s=C(a,n.latitude),h=C(a,t),u=Math.tan(e)*(h-s),r=_.CesiumMath.negativePiToPi(n.longitude+u);return m.defined(i)?(i.longitude=r,i.latitude=t,i.height=0,i):new g.Cartographic(r,t,0)}},t.EllipsoidRhumbLine=c});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./when-60b00257","./Check-4274a1fd","./Cartesian2-2951f601","./Transforms-53ff6d12","./IntersectionTests-57fe18b2","./Plane-df4a621e"],function(e,p,n,x,s,o,a){"use strict";function y(e,n,t){this.minimum=x.Cartesian3.clone(p.defaultValue(e,x.Cartesian3.ZERO)),this.maximum=x.Cartesian3.clone(p.defaultValue(n,x.Cartesian3.ZERO)),t=p.defined(t)?x.Cartesian3.clone(t):x.Cartesian3.midpoint(this.minimum,this.maximum,new x.Cartesian3),this.center=t}y.fromPoints=function(e,n){if(p.defined(n)||(n=new y),!p.defined(e)||0===e.length)return n.minimum=x.Cartesian3.clone(x.Cartesian3.ZERO,n.minimum),n.maximum=x.Cartesian3.clone(x.Cartesian3.ZERO,n.maximum),n.center=x.Cartesian3.clone(x.Cartesian3.ZERO,n.center),n;for(var t=e[0].x,i=e[0].y,a=e[0].z,r=e[0].x,s=e[0].y,o=e[0].z,m=e.length,l=1;l<m;l++){var u=e[l],c=u.x,d=u.y,f=u.z;t=Math.min(c,t),r=Math.max(c,r),i=Math.min(d,i),s=Math.max(d,s),a=Math.min(f,a),o=Math.max(f,o)}var h=n.minimum;h.x=t,h.y=i,h.z=a;var C=n.maximum;return C.x=r,C.y=s,C.z=o,n.center=x.Cartesian3.midpoint(h,C,n.center),n},y.clone=function(e,n){if(p.defined(e))return p.defined(n)?(n.minimum=x.Cartesian3.clone(e.minimum,n.minimum),n.maximum=x.Cartesian3.clone(e.maximum,n.maximum),n.center=x.Cartesian3.clone(e.center,n.center),n):new y(e.minimum,e.maximum,e.center)},y.equals=function(e,n){return e===n||p.defined(e)&&p.defined(n)&&x.Cartesian3.equals(e.center,n.center)&&x.Cartesian3.equals(e.minimum,n.minimum)&&x.Cartesian3.equals(e.maximum,n.maximum)};var m=new x.Cartesian3;y.intersectPlane=function(e,n){m=x.Cartesian3.subtract(e.maximum,e.minimum,m);var t=x.Cartesian3.multiplyByScalar(m,.5,m),i=n.normal,a=t.x*Math.abs(i.x)+t.y*Math.abs(i.y)+t.z*Math.abs(i.z),r=x.Cartesian3.dot(e.center,i)+n.distance;return 0<r-a?s.Intersect.INSIDE:r+a<0?s.Intersect.OUTSIDE:s.Intersect.INTERSECTING},y.prototype.clone=function(e){return y.clone(this,e)},y.prototype.intersectPlane=function(e){return y.intersectPlane(this,e)},y.prototype.equals=function(e){return y.equals(this,e)};var r=new s.Cartesian4;function t(e,n){e=(n=p.defaultValue(n,x.Ellipsoid.WGS84)).scaleToGeodeticSurface(e);var t=s.Transforms.eastNorthUpToFixedFrame(e,n);this._ellipsoid=n,this._origin=e,this._xAxis=x.Cartesian3.fromCartesian4(s.Matrix4.getColumn(t,0,r)),this._yAxis=x.Cartesian3.fromCartesian4(s.Matrix4.getColumn(t,1,r));var i=x.Cartesian3.fromCartesian4(s.Matrix4.getColumn(t,2,r));this._plane=a.Plane.fromPointNormal(e,i)}Object.defineProperties(t.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var i=new y;t.fromPoints=function(e,n){return new t(y.fromPoints(e,i).center,n)};var l=new o.Ray,u=new x.Cartesian3;t.prototype.projectPointOntoPlane=function(e,n){var t=l;t.origin=e,x.Cartesian3.normalize(e,t.direction);var i=o.IntersectionTests.rayPlane(t,this._plane,u);if(p.defined(i)||(x.Cartesian3.negate(t.direction,t.direction),i=o.IntersectionTests.rayPlane(t,this._plane,u)),p.defined(i)){var a=x.Cartesian3.subtract(i,this._origin,i),r=x.Cartesian3.dot(this._xAxis,a),s=x.Cartesian3.dot(this._yAxis,a);return p.defined(n)?(n.x=r,n.y=s,n):new x.Cartesian2(r,s)}},t.prototype.projectPointsOntoPlane=function(e,n){p.defined(n)||(n=[]);for(var t=0,i=e.length,a=0;a<i;a++){var r=this.projectPointOntoPlane(e[a],n[t]);p.defined(r)&&(n[t]=r,t++)}return n.length=t,n},t.prototype.projectPointToNearestOnPlane=function(e,n){p.defined(n)||(n=new x.Cartesian2);var t=l;t.origin=e,x.Cartesian3.clone(this._plane.normal,t.direction);var i=o.IntersectionTests.rayPlane(t,this._plane,u);p.defined(i)||(x.Cartesian3.negate(t.direction,t.direction),i=o.IntersectionTests.rayPlane(t,this._plane,u));var a=x.Cartesian3.subtract(i,this._origin,i),r=x.Cartesian3.dot(this._xAxis,a),s=x.Cartesian3.dot(this._yAxis,a);return n.x=r,n.y=s,n},t.prototype.projectPointsToNearestOnPlane=function(e,n){p.defined(n)||(n=[]);var t=e.length;n.length=t;for(var i=0;i<t;i++)n[i]=this.projectPointToNearestOnPlane(e[i],n[i]);return n};var c=new x.Cartesian3;t.prototype.projectPointOntoEllipsoid=function(e,n){p.defined(n)||(n=new x.Cartesian3);var t=this._ellipsoid,i=this._origin,a=this._xAxis,r=this._yAxis,s=c;return x.Cartesian3.multiplyByScalar(a,e.x,s),n=x.Cartesian3.add(i,s,n),x.Cartesian3.multiplyByScalar(r,e.y,s),x.Cartesian3.add(n,s,n),t.scaleToGeocentricSurface(n,n),n},t.prototype.projectPointsOntoEllipsoid=function(e,n){var t=e.length;p.defined(n)?n.length=t:n=new Array(t);for(var i=0;i<t;++i)n[i]=this.projectPointOntoEllipsoid(e[i],n[i]);return n},e.AxisAlignedBoundingBox=y,e.EllipsoidTangentPlane=t});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./when-60b00257","./Check-4274a1fd","./Cartesian2-2951f601"],function(e,h,n,i){"use strict";function a(){this.high=i.Cartesian3.clone(i.Cartesian3.ZERO),this.low=i.Cartesian3.clone(i.Cartesian3.ZERO)}a.encode=function(e,n){var i;return h.defined(n)||(n={high:0,low:0}),0<=e?(i=65536*Math.floor(e/65536),n.high=i,n.low=e-i):(i=65536*Math.floor(-e/65536),n.high=-i,n.low=e+i),n};var r={high:0,low:0};a.fromCartesian=function(e,n){h.defined(n)||(n=new a);var i=n.high,o=n.low;return a.encode(e.x,r),i.x=r.high,o.x=r.low,a.encode(e.y,r),i.y=r.high,o.y=r.low,a.encode(e.z,r),i.z=r.high,o.z=r.low,n};var t=new a;a.writeElements=function(e,n,i){a.fromCartesian(e,t);var o=t.high,h=t.low;n[i]=o.x,n[i+1]=o.y,n[i+2]=o.z,n[i+3]=h.x,n[i+4]=h.y,n[i+5]=h.z},e.EncodedCartesian3=a});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./when-60b00257","./Check-4274a1fd","./Math-9d37f659","./Cartesian2-2951f601","./Transforms-53ff6d12","./ComponentDatatype-a29c6075","./GeometryAttribute-2f728681","./GeometryAttributes-130e4d69","./Plane-df4a621e","./VertexFormat-6af5bab1"],function(t,F,e,i,V,E,O,P,z,f,l){"use strict";function h(t){this.planes=F.defaultValue(t,[])}var p=[new V.Cartesian3,new V.Cartesian3,new V.Cartesian3];V.Cartesian3.clone(V.Cartesian3.UNIT_X,p[0]),V.Cartesian3.clone(V.Cartesian3.UNIT_Y,p[1]),V.Cartesian3.clone(V.Cartesian3.UNIT_Z,p[2]);var d=new V.Cartesian3,c=new V.Cartesian3,u=new f.Plane(new V.Cartesian3(1,0,0),0);function r(t){t=F.defaultValue(t,F.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=F.defaultValue(t.near,1),this._near=this.near,this.far=F.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new h,this._orthographicMatrix=new E.Matrix4}function s(t){t.top===t._top&&t.bottom===t._bottom&&t.left===t._left&&t.right===t._right&&t.near===t._near&&t.far===t._far||(t._left=t.left,t._right=t.right,t._top=t.top,t._bottom=t.bottom,t._near=t.near,t._far=t.far,t._orthographicMatrix=E.Matrix4.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t._orthographicMatrix))}h.fromBoundingSphere=function(t,e){F.defined(e)||(e=new h);var a=p.length,i=e.planes;i.length=2*a;for(var r=t.center,n=t.radius,o=0,s=0;s<a;++s){var f=p[s],u=i[o],l=i[o+1];F.defined(u)||(u=i[o]=new E.Cartesian4),F.defined(l)||(l=i[o+1]=new E.Cartesian4),V.Cartesian3.multiplyByScalar(f,-n,d),V.Cartesian3.add(r,d,d),u.x=f.x,u.y=f.y,u.z=f.z,u.w=-V.Cartesian3.dot(f,d),V.Cartesian3.multiplyByScalar(f,n,d),V.Cartesian3.add(r,d,d),l.x=-f.x,l.y=-f.y,l.z=-f.z,l.w=-V.Cartesian3.dot(V.Cartesian3.negate(f,c),d),o+=2}return e},h.prototype.computeVisibility=function(t){for(var e=this.planes,a=!1,i=0,r=e.length;i<r;++i){var n=t.intersectPlane(f.Plane.fromCartesian4(e[i],u));if(n===E.Intersect.OUTSIDE)return E.Intersect.OUTSIDE;n===E.Intersect.INTERSECTING&&(a=!0)}return a?E.Intersect.INTERSECTING:E.Intersect.INSIDE},h.prototype.computeVisibilityWithPlaneMask=function(t,e){if(e===h.MASK_OUTSIDE||e===h.MASK_INSIDE)return e;for(var a=h.MASK_INSIDE,i=this.planes,r=0,n=i.length;r<n;++r){var o=r<31?1<<r:0;if(!(r<31&&0==(e&o))){var s=t.intersectPlane(f.Plane.fromCartesian4(i[r],u));if(s===E.Intersect.OUTSIDE)return h.MASK_OUTSIDE;s===E.Intersect.INTERSECTING&&(a|=o)}}return a},h.MASK_OUTSIDE=4294967295,h.MASK_INSIDE=0,h.MASK_INDETERMINATE=2147483647,Object.defineProperties(r.prototype,{projectionMatrix:{get:function(){return s(this),this._orthographicMatrix}}});var m=new V.Cartesian3,C=new V.Cartesian3,_=new V.Cartesian3,y=new V.Cartesian3;function v(t){t=F.defaultValue(t,F.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new r,this.width=t.width,this._width=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=F.defaultValue(t.near,1),this._near=this.near,this.far=F.defaultValue(t.far,5e8),this._far=this.far}function n(t){var e=t._offCenterFrustum;if(t.width!==t._width||t.aspectRatio!==t._aspectRatio||t.near!==t._near||t.far!==t._far){t._aspectRatio=t.aspectRatio,t._width=t.width,t._near=t.near,t._far=t.far;var a=1/t.aspectRatio;e.right=.5*t.width,e.left=-e.right,e.top=a*e.right,e.bottom=-e.top,e.near=t.near,e.far=t.far}}function o(t){t=F.defaultValue(t,F.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=F.defaultValue(t.near,1),this._near=this.near,this.far=F.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new h,this._perspectiveMatrix=new E.Matrix4,this._infinitePerspective=new E.Matrix4}function g(t){var e=t.top,a=t.bottom,i=t.right,r=t.left,n=t.near,o=t.far;e===t._top&&a===t._bottom&&r===t._left&&i===t._right&&n===t._near&&o===t._far||(t._left=r,t._right=i,t._top=e,t._bottom=a,t._near=n,t._far=o,t._perspectiveMatrix=E.Matrix4.computePerspectiveOffCenter(r,i,a,e,n,o,t._perspectiveMatrix),t._infinitePerspective=E.Matrix4.computeInfinitePerspectiveOffCenter(r,i,a,e,n,t._infinitePerspective))}r.prototype.computeCullingVolume=function(t,e,a){var i=this._cullingVolume.planes,r=this.top,n=this.bottom,o=this.right,s=this.left,f=this.near,u=this.far,l=V.Cartesian3.cross(e,a,m);V.Cartesian3.normalize(l,l);var h=C;V.Cartesian3.multiplyByScalar(e,f,h),V.Cartesian3.add(t,h,h);var p=_;V.Cartesian3.multiplyByScalar(l,s,p),V.Cartesian3.add(h,p,p);var d=i[0];return F.defined(d)||(d=i[0]=new E.Cartesian4),d.x=l.x,d.y=l.y,d.z=l.z,d.w=-V.Cartesian3.dot(l,p),V.Cartesian3.multiplyByScalar(l,o,p),V.Cartesian3.add(h,p,p),d=i[1],F.defined(d)||(d=i[1]=new E.Cartesian4),d.x=-l.x,d.y=-l.y,d.z=-l.z,d.w=-V.Cartesian3.dot(V.Cartesian3.negate(l,y),p),V.Cartesian3.multiplyByScalar(a,n,p),V.Cartesian3.add(h,p,p),d=i[2],F.defined(d)||(d=i[2]=new E.Cartesian4),d.x=a.x,d.y=a.y,d.z=a.z,d.w=-V.Cartesian3.dot(a,p),V.Cartesian3.multiplyByScalar(a,r,p),V.Cartesian3.add(h,p,p),d=i[3],F.defined(d)||(d=i[3]=new E.Cartesian4),d.x=-a.x,d.y=-a.y,d.z=-a.z,d.w=-V.Cartesian3.dot(V.Cartesian3.negate(a,y),p),d=i[4],F.defined(d)||(d=i[4]=new E.Cartesian4),d.x=e.x,d.y=e.y,d.z=e.z,d.w=-V.Cartesian3.dot(e,h),V.Cartesian3.multiplyByScalar(e,u,p),V.Cartesian3.add(t,p,p),d=i[5],F.defined(d)||(d=i[5]=new E.Cartesian4),d.x=-e.x,d.y=-e.y,d.z=-e.z,d.w=-V.Cartesian3.dot(V.Cartesian3.negate(e,y),p),this._cullingVolume},r.prototype.getPixelDimensions=function(t,e,a,i,r){s(this);var n=i*(this.right-this.left)/t,o=i*(this.top-this.bottom)/e;return r.x=n,r.y=o,r},r.prototype.clone=function(t){return F.defined(t)||(t=new r),t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},r.prototype.equals=function(t){return F.defined(t)&&t instanceof r&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},r.prototype.equalsEpsilon=function(t,e,a){return t===this||F.defined(t)&&t instanceof r&&i.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&i.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&i.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&i.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&i.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&i.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},v.packedLength=4,v.pack=function(t,e,a){return a=F.defaultValue(a,0),e[a++]=t.width,e[a++]=t.aspectRatio,e[a++]=t.near,e[a]=t.far,e},v.unpack=function(t,e,a){return e=F.defaultValue(e,0),F.defined(a)||(a=new v),a.width=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e],a},Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return n(this),this._offCenterFrustum.projectionMatrix}}}),v.prototype.computeCullingVolume=function(t,e,a){return n(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},v.prototype.getPixelDimensions=function(t,e,a,i,r){return n(this),this._offCenterFrustum.getPixelDimensions(t,e,a,i,r)},v.prototype.clone=function(t){return F.defined(t)||(t=new v),t.aspectRatio=this.aspectRatio,t.width=this.width,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._width=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},v.prototype.equals=function(t){return!!(F.defined(t)&&t instanceof v)&&(n(this),n(t),this.width===t.width&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},v.prototype.equalsEpsilon=function(t,e,a){return!!(F.defined(t)&&t instanceof v)&&(n(this),n(t),i.CesiumMath.equalsEpsilon(this.width,t.width,e,a)&&i.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))},Object.defineProperties(o.prototype,{projectionMatrix:{get:function(){return g(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return g(this),this._infinitePerspective}}});var w=new V.Cartesian3,x=new V.Cartesian3,M=new V.Cartesian3,b=new V.Cartesian3;function R(t){t=F.defaultValue(t,F.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new o,this.fov=t.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=F.defaultValue(t.near,1),this._near=this.near,this.far=F.defaultValue(t.far,5e8),this._far=this.far,this.xOffset=F.defaultValue(t.xOffset,0),this._xOffset=this.xOffset,this.yOffset=F.defaultValue(t.yOffset,0),this._yOffset=this.yOffset}function S(t){var e=t._offCenterFrustum;t.fov===t._fov&&t.aspectRatio===t._aspectRatio&&t.near===t._near&&t.far===t._far&&t.xOffset===t._xOffset&&t.yOffset===t._yOffset||(t._aspectRatio=t.aspectRatio,t._fov=t.fov,t._fovy=t.aspectRatio<=1?t.fov:2*Math.atan(Math.tan(.5*t.fov)/t.aspectRatio),t._near=t.near,t._far=t.far,t._sseDenominator=2*Math.tan(.5*t._fovy),t._xOffset=t.xOffset,t._yOffset=t.yOffset,e.top=t.near*Math.tan(.5*t._fovy),e.bottom=-e.top,e.right=t.aspectRatio*e.top,e.left=-e.right,e.near=t.near,e.far=t.far,e.right+=t.xOffset,e.left+=t.xOffset,e.top+=t.yOffset,e.bottom+=t.yOffset)}o.prototype.computeCullingVolume=function(t,e,a){var i=this._cullingVolume.planes,r=this.top,n=this.bottom,o=this.right,s=this.left,f=this.near,u=this.far,l=V.Cartesian3.cross(e,a,w),h=x;V.Cartesian3.multiplyByScalar(e,f,h),V.Cartesian3.add(t,h,h);var p=M;V.Cartesian3.multiplyByScalar(e,u,p),V.Cartesian3.add(t,p,p);var d=b;V.Cartesian3.multiplyByScalar(l,s,d),V.Cartesian3.add(h,d,d),V.Cartesian3.subtract(d,t,d),V.Cartesian3.normalize(d,d),V.Cartesian3.cross(d,a,d),V.Cartesian3.normalize(d,d);var c=i[0];return F.defined(c)||(c=i[0]=new E.Cartesian4),c.x=d.x,c.y=d.y,c.z=d.z,c.w=-V.Cartesian3.dot(d,t),V.Cartesian3.multiplyByScalar(l,o,d),V.Cartesian3.add(h,d,d),V.Cartesian3.subtract(d,t,d),V.Cartesian3.cross(a,d,d),V.Cartesian3.normalize(d,d),c=i[1],F.defined(c)||(c=i[1]=new E.Cartesian4),c.x=d.x,c.y=d.y,c.z=d.z,c.w=-V.Cartesian3.dot(d,t),V.Cartesian3.multiplyByScalar(a,n,d),V.Cartesian3.add(h,d,d),V.Cartesian3.subtract(d,t,d),V.Cartesian3.cross(l,d,d),V.Cartesian3.normalize(d,d),c=i[2],F.defined(c)||(c=i[2]=new E.Cartesian4),c.x=d.x,c.y=d.y,c.z=d.z,c.w=-V.Cartesian3.dot(d,t),V.Cartesian3.multiplyByScalar(a,r,d),V.Cartesian3.add(h,d,d),V.Cartesian3.subtract(d,t,d),V.Cartesian3.cross(d,l,d),V.Cartesian3.normalize(d,d),c=i[3],F.defined(c)||(c=i[3]=new E.Cartesian4),c.x=d.x,c.y=d.y,c.z=d.z,c.w=-V.Cartesian3.dot(d,t),c=i[4],F.defined(c)||(c=i[4]=new E.Cartesian4),c.x=e.x,c.y=e.y,c.z=e.z,c.w=-V.Cartesian3.dot(e,h),V.Cartesian3.negate(e,d),c=i[5],F.defined(c)||(c=i[5]=new E.Cartesian4),c.x=d.x,c.y=d.y,c.z=d.z,c.w=-V.Cartesian3.dot(d,p),this._cullingVolume},o.prototype.getPixelDimensions=function(t,e,a,i,r){g(this);var n=1/this.near,o=this.top*n,s=2*i*a*o/e,f=2*i*a*(o=this.right*n)/t;return r.x=f,r.y=s,r},o.prototype.clone=function(t){return F.defined(t)||(t=new o),t.right=this.right,t.left=this.left,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},o.prototype.equals=function(t){return F.defined(t)&&t instanceof o&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},o.prototype.equalsEpsilon=function(t,e,a){return t===this||F.defined(t)&&t instanceof o&&i.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&i.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&i.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&i.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&i.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&i.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},R.packedLength=6,R.pack=function(t,e,a){return a=F.defaultValue(a,0),e[a++]=t.fov,e[a++]=t.aspectRatio,e[a++]=t.near,e[a++]=t.far,e[a++]=t.xOffset,e[a]=t.yOffset,e},R.unpack=function(t,e,a){return e=F.defaultValue(e,0),F.defined(a)||(a=new R),a.fov=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e++],a.xOffset=t[e++],a.yOffset=t[e],a},Object.defineProperties(R.prototype,{projectionMatrix:{get:function(){return S(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return S(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return S(this),this._fovy}},sseDenominator:{get:function(){return S(this),this._sseDenominator}}}),R.prototype.computeCullingVolume=function(t,e,a){return S(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},R.prototype.getPixelDimensions=function(t,e,a,i,r){return S(this),this._offCenterFrustum.getPixelDimensions(t,e,a,i,r)},R.prototype.clone=function(t){return F.defined(t)||(t=new R),t.aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._fov=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},R.prototype.equals=function(t){return!!(F.defined(t)&&t instanceof R)&&(S(this),S(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},R.prototype.equalsEpsilon=function(t,e,a){return!!(F.defined(t)&&t instanceof R)&&(S(this),S(t),i.CesiumMath.equalsEpsilon(this.fov,t.fov,e,a)&&i.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))};function T(t){var e,a,i=t.frustum,r=t.orientation,n=t.origin,o=F.defaultValue(t.vertexFormat,l.VertexFormat.DEFAULT),s=F.defaultValue(t._drawNearPlane,!0);i instanceof R?(e=0,a=R.packedLength):i instanceof v&&(e=1,a=v.packedLength),this._frustumType=e,this._frustum=i.clone(),this._origin=V.Cartesian3.clone(n),this._orientation=E.Quaternion.clone(r),this._drawNearPlane=s,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+V.Cartesian3.packedLength+E.Quaternion.packedLength+l.VertexFormat.packedLength}T.pack=function(t,e,a){a=F.defaultValue(a,0);var i=t._frustumType,r=t._frustum;return 0===(e[a++]=i)?(R.pack(r,e,a),a+=R.packedLength):(v.pack(r,e,a),a+=v.packedLength),V.Cartesian3.pack(t._origin,e,a),a+=V.Cartesian3.packedLength,E.Quaternion.pack(t._orientation,e,a),a+=E.Quaternion.packedLength,l.VertexFormat.pack(t._vertexFormat,e,a),e[a+=l.VertexFormat.packedLength]=t._drawNearPlane?1:0,e};var k=new R,A=new v,D=new E.Quaternion,I=new V.Cartesian3,q=new l.VertexFormat;function B(t,e,a,i,r,n,o,s){for(var f=t/3*2,u=0;u<4;++u)F.defined(e)&&(e[t]=n.x,e[t+1]=n.y,e[t+2]=n.z),F.defined(a)&&(a[t]=o.x,a[t+1]=o.y,a[t+2]=o.z),F.defined(i)&&(i[t]=s.x,i[t+1]=s.y,i[t+2]=s.z),t+=3;r[f]=0,r[1+f]=0,r[2+f]=1,r[3+f]=0,r[4+f]=1,r[5+f]=1,r[6+f]=0,r[7+f]=1}T.unpack=function(t,e,a){e=F.defaultValue(e,0);var i,r=t[e++];0===r?(i=R.unpack(t,e,k),e+=R.packedLength):(i=v.unpack(t,e,A),e+=v.packedLength);var n=V.Cartesian3.unpack(t,e,I);e+=V.Cartesian3.packedLength;var o=E.Quaternion.unpack(t,e,D);e+=E.Quaternion.packedLength;var s=l.VertexFormat.unpack(t,e,q),f=1===t[e+=l.VertexFormat.packedLength];if(!F.defined(a))return new T({frustum:i,origin:n,orientation:o,vertexFormat:s,_drawNearPlane:f});var u=r===a._frustumType?a._frustum:void 0;return a._frustum=i.clone(u),a._frustumType=r,a._origin=V.Cartesian3.clone(n,a._origin),a._orientation=E.Quaternion.clone(o,a._orientation),a._vertexFormat=l.VertexFormat.clone(s,a._vertexFormat),a._drawNearPlane=f,a};var L=new E.Matrix3,N=new E.Matrix4,G=new E.Matrix4,j=new V.Cartesian3,U=new V.Cartesian3,Q=new V.Cartesian3,K=new V.Cartesian3,Y=new V.Cartesian3,J=new V.Cartesian3,W=new Array(3),X=new Array(4);X[0]=new E.Cartesian4(-1,-1,1,1),X[1]=new E.Cartesian4(1,-1,1,1),X[2]=new E.Cartesian4(1,1,1,1),X[3]=new E.Cartesian4(-1,1,1,1);for(var Z=new Array(4),a=0;a<4;++a)Z[a]=new E.Cartesian4;T._computeNearFarPlanes=function(t,e,a,i,r,n,o,s){var f=E.Matrix3.fromQuaternion(e,L),u=F.defaultValue(n,j),l=F.defaultValue(o,U),h=F.defaultValue(s,Q);u=E.Matrix3.getColumn(f,0,u),l=E.Matrix3.getColumn(f,1,l),h=E.Matrix3.getColumn(f,2,h),V.Cartesian3.normalize(u,u),V.Cartesian3.normalize(l,l),V.Cartesian3.normalize(h,h),V.Cartesian3.negate(u,u);var p,d,c=E.Matrix4.computeView(t,h,l,u,N);if(0===a){var m=i.projectionMatrix,C=E.Matrix4.multiply(m,c,G);d=E.Matrix4.inverse(C,G)}else p=E.Matrix4.inverseTransformation(c,G);F.defined(d)?(W[0]=i.near,W[1]=i.far):(W[0]=0,W[1]=i.near,W[2]=i.far);for(var _=0;_<2;++_)for(var y=0;y<4;++y){var v=E.Cartesian4.clone(X[y],Z[y]);if(F.defined(d)){var g=1/(v=E.Matrix4.multiplyByVector(d,v,v)).w;V.Cartesian3.multiplyByScalar(v,g,v),V.Cartesian3.subtract(v,t,v),V.Cartesian3.normalize(v,v);var w=V.Cartesian3.dot(h,v);V.Cartesian3.multiplyByScalar(v,W[_]/w,v),V.Cartesian3.add(v,t,v)}else{F.defined(i._offCenterFrustum)&&(i=i._offCenterFrustum);var x=W[_],M=W[_+1];v.x=.5*(v.x*(i.right-i.left)+i.left+i.right),v.y=.5*(v.y*(i.top-i.bottom)+i.bottom+i.top),v.z=.5*(v.z*(x-M)-x-M),v.w=1,E.Matrix4.multiplyByVector(p,v,v)}r[12*_+3*y]=v.x,r[12*_+3*y+1]=v.y,r[12*_+3*y+2]=v.z}},T.createGeometry=function(t){var e=t._frustumType,a=t._frustum,i=t._origin,r=t._orientation,n=t._drawNearPlane,o=t._vertexFormat,s=n?6:5,f=new Float64Array(72);T._computeNearFarPlanes(i,r,e,a,f);var u=24;f[u]=f[12],f[u+1]=f[13],f[u+2]=f[14],f[u+3]=f[0],f[u+4]=f[1],f[u+5]=f[2],f[u+6]=f[9],f[u+7]=f[10],f[u+8]=f[11],f[u+9]=f[21],f[u+10]=f[22],f[u+11]=f[23],f[u+=12]=f[15],f[u+1]=f[16],f[u+2]=f[17],f[u+3]=f[3],f[u+4]=f[4],f[u+5]=f[5],f[u+6]=f[0],f[u+7]=f[1],f[u+8]=f[2],f[u+9]=f[12],f[u+10]=f[13],f[u+11]=f[14],f[u+=12]=f[3],f[u+1]=f[4],f[u+2]=f[5],f[u+3]=f[15],f[u+4]=f[16],f[u+5]=f[17],f[u+6]=f[18],f[u+7]=f[19],f[u+8]=f[20],f[u+9]=f[6],f[u+10]=f[7],f[u+11]=f[8],f[u+=12]=f[6],f[u+1]=f[7],f[u+2]=f[8],f[u+3]=f[18],f[u+4]=f[19],f[u+5]=f[20],f[u+6]=f[21],f[u+7]=f[22],f[u+8]=f[23],f[u+9]=f[9],f[u+10]=f[10],f[u+11]=f[11],n||(f=f.subarray(12));var l=new z.GeometryAttributes({position:new P.GeometryAttribute({componentDatatype:O.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})});if(F.defined(o.normal)||F.defined(o.tangent)||F.defined(o.bitangent)||F.defined(o.st)){var h=F.defined(o.normal)?new Float32Array(12*s):void 0,p=F.defined(o.tangent)?new Float32Array(12*s):void 0,d=F.defined(o.bitangent)?new Float32Array(12*s):void 0,c=F.defined(o.st)?new Float32Array(8*s):void 0,m=j,C=U,_=Q,y=V.Cartesian3.negate(m,K),v=V.Cartesian3.negate(C,Y),g=V.Cartesian3.negate(_,J);u=0,n&&(B(u,h,p,d,c,g,m,C),u+=12),B(u,h,p,d,c,_,y,C),B(u+=12,h,p,d,c,y,g,C),B(u+=12,h,p,d,c,v,g,y),B(u+=12,h,p,d,c,m,_,C),B(u+=12,h,p,d,c,C,_,y),F.defined(h)&&(l.normal=new P.GeometryAttribute({componentDatatype:O.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:h})),F.defined(p)&&(l.tangent=new P.GeometryAttribute({componentDatatype:O.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:p})),F.defined(d)&&(l.bitangent=new P.GeometryAttribute({componentDatatype:O.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:d})),F.defined(c)&&(l.st=new P.GeometryAttribute({componentDatatype:O.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:c}))}for(var w=new Uint16Array(6*s),x=0;x<s;++x){var M=6*x,b=4*x;w[M]=b,w[1+M]=1+b,w[2+M]=2+b,w[3+M]=b,w[4+M]=2+b,w[5+M]=3+b}return new P.Geometry({attributes:l,indices:w,primitiveType:P.PrimitiveType.TRIANGLES,boundingSphere:E.BoundingSphere.fromVertices(f)})},t.FrustumGeometry=T,t.OrthographicFrustum=v,t.PerspectiveFrustum=R});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./when-60b00257","./Check-4274a1fd","./Cartesian2-2951f601","./Transforms-53ff6d12","./WebGLConstants-779bf0bc"],function(t,a,e,O,v,n){"use strict";var r=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3});function M(t,e,n,r){this[0]=a.defaultValue(t,0),this[1]=a.defaultValue(n,0),this[2]=a.defaultValue(e,0),this[3]=a.defaultValue(r,0)}M.packedLength=4,M.pack=function(t,e,n){return n=a.defaultValue(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e},M.unpack=function(t,e,n){return e=a.defaultValue(e,0),a.defined(n)||(n=new M),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n},M.clone=function(t,e){if(a.defined(t))return a.defined(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):new M(t[0],t[2],t[1],t[3])},M.fromArray=function(t,e,n){return e=a.defaultValue(e,0),a.defined(n)||(n=new M),n[0]=t[e],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],n},M.fromColumnMajorArray=function(t,e){return M.clone(t,e)},M.fromRowMajorArray=function(t,e){return a.defined(e)?(e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3],e):new M(t[0],t[1],t[2],t[3])},M.fromScale=function(t,e){return a.defined(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=t.y,e):new M(t.x,0,0,t.y)},M.fromUniformScale=function(t,e){return a.defined(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=t,e):new M(t,0,0,t)},M.fromRotation=function(t,e){var n=Math.cos(t),r=Math.sin(t);return a.defined(e)?(e[0]=n,e[1]=r,e[2]=-r,e[3]=n,e):new M(n,-r,r,n)},M.toArray=function(t,e){return a.defined(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):[t[0],t[1],t[2],t[3]]},M.getElementIndex=function(t,e){return 2*t+e},M.getColumn=function(t,e,n){var r=2*e,a=t[r],i=t[1+r];return n.x=a,n.y=i,n},M.setColumn=function(t,e,n,r){var a=2*e;return(r=M.clone(t,r))[a]=n.x,r[1+a]=n.y,r},M.getRow=function(t,e,n){var r=t[e],a=t[e+2];return n.x=r,n.y=a,n},M.setRow=function(t,e,n,r){return(r=M.clone(t,r))[e]=n.x,r[e+2]=n.y,r};var i=new O.Cartesian2;M.getScale=function(t,e){return e.x=O.Cartesian2.magnitude(O.Cartesian2.fromElements(t[0],t[1],i)),e.y=O.Cartesian2.magnitude(O.Cartesian2.fromElements(t[2],t[3],i)),e};var u=new O.Cartesian2;M.getMaximumScale=function(t){return M.getScale(t,u),O.Cartesian2.maximumComponent(u)},M.multiply=function(t,e,n){var r=t[0]*e[0]+t[2]*e[1],a=t[0]*e[2]+t[2]*e[3],i=t[1]*e[0]+t[3]*e[1],u=t[1]*e[2]+t[3]*e[3];return n[0]=r,n[1]=i,n[2]=a,n[3]=u,n},M.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n},M.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n},M.multiplyByVector=function(t,e,n){var r=t[0]*e.x+t[2]*e.y,a=t[1]*e.x+t[3]*e.y;return n.x=r,n.y=a,n},M.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n},M.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.y,n[3]=t[3]*e.y,n},M.negate=function(t,e){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},M.transpose=function(t,e){var n=t[0],r=t[2],a=t[1],i=t[3];return e[0]=n,e[1]=r,e[2]=a,e[3]=i,e},M.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e},M.equals=function(t,e){return t===e||a.defined(t)&&a.defined(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},M.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]},M.equalsEpsilon=function(t,e,n){return t===e||a.defined(t)&&a.defined(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n},M.IDENTITY=Object.freeze(new M(1,0,0,1)),M.ZERO=Object.freeze(new M(0,0,0,0)),M.COLUMN0ROW0=0,M.COLUMN0ROW1=1,M.COLUMN1ROW0=2,M.COLUMN1ROW1=3,Object.defineProperties(M.prototype,{length:{get:function(){return M.packedLength}}}),M.prototype.clone=function(t){return M.clone(this,t)},M.prototype.equals=function(t){return M.equals(this,t)},M.prototype.equalsEpsilon=function(t,e){return M.equalsEpsilon(this,t,e)},M.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"};var o={POINTS:n.WebGLConstants.POINTS,LINES:n.WebGLConstants.LINES,LINE_LOOP:n.WebGLConstants.LINE_LOOP,LINE_STRIP:n.WebGLConstants.LINE_STRIP,TRIANGLES:n.WebGLConstants.TRIANGLES,TRIANGLE_STRIP:n.WebGLConstants.TRIANGLE_STRIP,TRIANGLE_FAN:n.WebGLConstants.TRIANGLE_FAN,validate:function(t){return t===o.POINTS||t===o.LINES||t===o.LINE_LOOP||t===o.LINE_STRIP||t===o.TRIANGLES||t===o.TRIANGLE_STRIP||t===o.TRIANGLE_FAN}},s=Object.freeze(o);function f(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=a.defaultValue(t.primitiveType,s.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=a.defaultValue(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}f.computeNumberOfVertices=function(t){var e=-1;for(var n in t.attributes)if(t.attributes.hasOwnProperty(n)&&a.defined(t.attributes[n])&&a.defined(t.attributes[n].values)){var r=t.attributes[n];e=r.values.length/r.componentsPerAttribute}return e};var R=new O.Cartographic,P=new O.Cartesian3,V=new v.Matrix4,G=[new O.Cartographic,new O.Cartographic,new O.Cartographic],_=[new O.Cartesian2,new O.Cartesian2,new O.Cartesian2],W=[new O.Cartesian2,new O.Cartesian2,new O.Cartesian2],B=new O.Cartesian3,F=new v.Quaternion,k=new v.Matrix4,Y=new M;f._textureCoordinateRotationPoints=function(t,e,n,r){var a,i=O.Rectangle.center(r,R),u=O.Cartographic.toCartesian(i,n,P),o=v.Transforms.eastNorthUpToFixedFrame(u,n,V),s=v.Matrix4.inverse(o,V),f=_,c=G;c[0].longitude=r.west,c[0].latitude=r.south,c[1].longitude=r.west,c[1].latitude=r.north,c[2].longitude=r.east,c[2].latitude=r.south;var l=B;for(a=0;a<3;a++)O.Cartographic.toCartesian(c[a],n,l),l=v.Matrix4.multiplyByPointAsVector(s,l,l),f[a].x=l.x,f[a].y=l.y;var d=v.Quaternion.fromAxisAngle(O.Cartesian3.UNIT_Z,-e,F),y=v.Matrix3.fromQuaternion(d,k),m=t.length,p=Number.POSITIVE_INFINITY,h=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY,I=Number.NEGATIVE_INFINITY;for(a=0;a<m;a++)l=v.Matrix4.multiplyByPointAsVector(s,t[a],l),l=v.Matrix3.multiplyByVector(y,l,l),p=Math.min(p,l.x),h=Math.min(h,l.y),N=Math.max(N,l.x),I=Math.max(I,l.y);var C=M.fromRotation(e,Y),b=W;b[0].x=p,b[0].y=h,b[1].x=p,b[1].y=I,b[2].x=N,b[2].y=h;var T=f[0],E=f[2].x-T.x,x=f[1].y-T.y;for(a=0;a<3;a++){var L=b[a];M.multiplyByVector(C,L,L),L.x=(L.x-T.x)/E,L.y=(L.y-T.y)/x}var w=b[0],g=b[1],S=b[2],A=new Array(6);return O.Cartesian2.pack(w,A),O.Cartesian2.pack(g,A,2),O.Cartesian2.pack(S,A,4),A},t.Geometry=f,t.GeometryAttribute=function(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=a.defaultValue(t.normalize,!1),this.values=t.values},t.GeometryType=r,t.Matrix2=M,t.PrimitiveType=s});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./when-60b00257"],function(t,n){"use strict";t.GeometryAttributes=function(t){t=n.defaultValue(t,n.defaultValue.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./when-60b00257","./Check-4274a1fd","./Transforms-53ff6d12"],function(e,t,i,r){"use strict";e.GeometryInstance=function(e){e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=r.Matrix4.clone(t.defaultValue(e.modelMatrix,r.Matrix4.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=t.defaultValue(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./when-60b00257","./Check-4274a1fd"],function(e,h,t){"use strict";var a=Object.freeze({NONE:0,TOP:1,ALL:2});e.GeometryOffsetAttribute=a,e.arrayFill=function(e,t,a,f){if("function"==typeof e.fill)return e.fill(t,a,f);for(var r=e.length>>>0,n=h.defaultValue(a,0),i=n<0?Math.max(r+n,0):Math.min(n,r),l=h.defaultValue(f,r),u=l<0?Math.max(r+l,0):Math.min(l,r);i<u;)e[i]=t,i++;return e}});
/**
* Cesium - https://github.com/CesiumGS/cesium
*
* Copyright 2011-2020 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.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
*/
define(["exports","./when-60b00257","./Check-4274a1fd","./Math-9d37f659","./Cartesian2-2951f601","./Transforms-53ff6d12","./ComponentDatatype-a29c6075","./GeometryAttribute-2f728681","./AttributeCompression-a0720a96","./EncodedCartesian3-c262bebc","./IndexDatatype-527cbd94","./IntersectionTests-57fe18b2","./Plane-df4a621e"],function(e,_,t,q,U,Y,M,G,P,l,w,Z,a){"use strict";var x=new U.Cartesian3,S=new U.Cartesian3,I=new U.Cartesian3;var s={calculateACMR:function(e){var t=(e=_.defaultValue(e,_.defaultValue.EMPTY_OBJECT)).indices,r=e.maximumIndex,a=_.defaultValue(e.cacheSize,24),i=t.length;if(!_.defined(r))for(var n=r=0,s=t[n];n<i;)r<s&&(r=s),s=t[++n];for(var o=[],u=0;u<r+1;u++)o[u]=0;for(var p=a+1,d=0;d<i;++d)p-o[t[d]]>a&&(o[t[d]]=p,++p);return(p-a+1)/(i/3)}};s.tipsify=function(e){var v,t=(e=_.defaultValue(e,_.defaultValue.EMPTY_OBJECT)).indices,r=e.maximumIndex,a=_.defaultValue(e.cacheSize,24);function i(e,t,r,a,i,n,s){for(var o,u=-1,p=-1,d=0;d<r.length;){var l=r[d];a[l].numLiveTriangles&&(o=0,i-a[l].timeStamp+2*a[l].numLiveTriangles<=t&&(o=i-a[l].timeStamp),(p<o||-1===p)&&(p=o,u=l)),++d}return-1===u?function(e,t,r){for(;1<=t.length;){var a=t[t.length-1];if(t.splice(t.length-1,1),0<e[a].numLiveTriangles)return a}for(;v<r;){if(0<e[v].numLiveTriangles)return++v-1;++v}return-1}(a,n,s):u}var n=t.length,s=0,o=0,u=t[o],p=n;if(_.defined(r))s=r+1;else{for(;o<p;)s<u&&(s=u),u=t[++o];if(-1===s)return 0;++s}var d,l=[];for(d=0;d<s;d++)l[d]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};for(var y=o=0;o<p;)l[t[o]].vertexTriangles.push(y),++l[t[o]].numLiveTriangles,l[t[o+1]].vertexTriangles.push(y),++l[t[o+1]].numLiveTriangles,l[t[o+2]].vertexTriangles.push(y),++l[t[o+2]].numLiveTriangles,++y,o+=3;var f=0,c=a+1;v=1;var m,C,h,b,g=[],A=[],T=0,x=[],P=n/3,w=[];for(d=0;d<P;d++)w[d]=!1;for(;-1!==f;){g=[],b=(C=l[f]).vertexTriangles.length;for(var S=0;S<b;++S)if(!w[y=C.vertexTriangles[S]]){w[y]=!0,o=y+y+y;for(var I=0;I<3;++I)h=t[o],g.push(h),A.push(h),x[T]=h,++T,--(m=l[h]).numLiveTriangles,c-m.timeStamp>a&&(m.timeStamp=c,++c),++o}f=i(0,a,g,l,c,A,s)}return x};var r={};function o(e,t,r,a,i){e[t++]=r,e[t++]=a,e[t++]=a,e[t++]=i,e[t++]=i,e[t]=r}function f(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&_.defined(e[r])&&_.defined(e[r].values)){var a=e[r];t[r]=new G.GeometryAttribute({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return t}function c(e,t,r){for(var a in t)if(t.hasOwnProperty(a)&&_.defined(t[a])&&_.defined(t[a].values))for(var i=t[a],n=0;n<i.componentsPerAttribute;++n)e[a].values.push(i.values[r*i.componentsPerAttribute+n])}r.toWireframe=function(e){var t=e.indices;if(_.defined(t)){switch(e.primitiveType){case G.PrimitiveType.TRIANGLES:e.indices=function(e){for(var t=e.length,r=t/3*6,a=w.IndexDatatype.createTypedArray(t,r),i=0,n=0;n<t;n+=3,i+=6)o(a,i,e[n],e[n+1],e[n+2]);return a}(t);break;case G.PrimitiveType.TRIANGLE_STRIP:e.indices=function(e){var t=e.length;if(3<=t){var r=6*(t-2),a=w.IndexDatatype.createTypedArray(t,r);o(a,0,e[0],e[1],e[2]);for(var i=6,n=3;n<t;++n,i+=6)o(a,i,e[n-1],e[n],e[n-2]);return a}return new Uint16Array}(t);break;case G.PrimitiveType.TRIANGLE_FAN:e.indices=function(e){if(0<e.length){for(var t=e.length-1,r=6*(t-1),a=w.IndexDatatype.createTypedArray(t,r),i=e[0],n=0,s=1;s<t;++s,n+=6)o(a,n,i,e[s],e[s+1]);return a}return new Uint16Array}(t)}e.primitiveType=G.PrimitiveType.LINES}return e},r.createLineSegmentsForVectors=function(e,t,r){t=_.defaultValue(t,"normal"),r=_.defaultValue(r,1e4);for(var a,i=e.attributes.position.values,n=e.attributes[t].values,s=i.length,o=new Float64Array(2*s),u=0,p=0;p<s;p+=3)o[u++]=i[p],o[u++]=i[p+1],o[u++]=i[p+2],o[u++]=i[p]+n[p]*r,o[u++]=i[p+1]+n[p+1]*r,o[u++]=i[p+2]+n[p+2]*r;var d=e.boundingSphere;return _.defined(d)&&(a=new Y.BoundingSphere(d.center,d.radius+r)),new G.Geometry({attributes:{position:new G.GeometryAttribute({componentDatatype:M.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:G.PrimitiveType.LINES,boundingSphere:a})},r.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],a=e.attributes,i={},n=0,s=r.length;for(t=0;t<s;++t){var o=r[t];_.defined(a[o])&&(i[o]=n++)}for(var u in a)a.hasOwnProperty(u)&&!_.defined(i[u])&&(i[u]=n++);return i},r.reorderForPreVertexCache=function(e){var t=G.Geometry.computeNumberOfVertices(e),r=e.indices;if(_.defined(r)){for(var a=new Int32Array(t),i=0;i<t;i++)a[i]=-1;for(var n,s=r,o=s.length,u=w.IndexDatatype.createTypedArray(t,o),p=0,d=0,l=0;p<o;)-1!==(n=a[s[p]])?u[d]=n:(a[n=s[p]]=l,u[d]=l,++l),++p,++d;e.indices=u;var v=e.attributes;for(var y in v)if(v.hasOwnProperty(y)&&_.defined(v[y])&&_.defined(v[y].values)){for(var f=v[y],c=f.values,m=0,C=f.componentsPerAttribute,h=M.ComponentDatatype.createTypedArray(f.componentDatatype,l*C);m<t;){var b=a[m];if(-1!==b)for(var g=0;g<C;g++)h[C*b+g]=c[C*m+g];++m}f.values=h}}return e},r.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===G.PrimitiveType.TRIANGLES&&_.defined(r)){for(var a=r.length,i=0,n=0;n<a;n++)r[n]>i&&(i=r[n]);e.indices=s.tipsify({indices:r,maximumIndex:i,cacheSize:t})}return e},r.fitToUnsignedShortIndices=function(e){var t=[],r=G.Geometry.computeNumberOfVertices(e);if(_.defined(e.indices)&&r>=q.CesiumMath.SIXTY_FOUR_KILOBYTES){var a,i=[],n=[],s=0,o=f(e.attributes),u=e.indices,p=u.length;e.primitiveType===G.PrimitiveType.TRIANGLES?a=3:e.primitiveType===G.PrimitiveType.LINES?a=2:e.primitiveType===G.PrimitiveType.POINTS&&(a=1);for(var d=0;d<p;d+=a){for(var l=0;l<a;++l){var v=u[d+l],y=i[v];_.defined(y)||(y=s++,i[v]=y,c(o,e.attributes,v)),n.push(y)}s+a>=q.CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(new G.Geometry({attributes:o,indices:n,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],n=[],s=0,o=f(e.attributes))}0!==n.length&&t.push(new G.Geometry({attributes:o,indices:n,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var m=new U.Cartesian3,C=new U.Cartographic;r.projectTo2D=function(e,t,r,a,i){for(var n=e.attributes[t],s=(i=_.defined(i)?i:new Y.GeographicProjection).ellipsoid,o=n.values,u=new Float64Array(o.length),p=0,d=0;d<o.length;d+=3){var l=U.Cartesian3.fromArray(o,d,m),v=s.cartesianToCartographic(l,C),y=i.project(v,m);u[p++]=y.x,u[p++]=y.y,u[p++]=y.z}return e.attributes[r]=n,e.attributes[a]=new G.GeometryAttribute({componentDatatype:M.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u}),delete e.attributes[t],e};var v={high:0,low:0};r.encodeAttribute=function(e,t,r,a){for(var i=e.attributes[t],n=i.values,s=n.length,o=new Float32Array(s),u=new Float32Array(s),p=0;p<s;++p)l.EncodedCartesian3.encode(n[p],v),o[p]=v.high,u[p]=v.low;var d=i.componentsPerAttribute;return e.attributes[r]=new G.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:d,values:o}),e.attributes[a]=new G.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:d,values:u}),delete e.attributes[t],e};var n=new U.Cartesian3;function i(e,t){if(_.defined(t))for(var r=t.values,a=r.length,i=0;i<a;i+=3)U.Cartesian3.unpack(r,i,n),Y.Matrix4.multiplyByPoint(e,n,n),U.Cartesian3.pack(n,r,i)}function u(e,t){if(_.defined(t))for(var r=t.values,a=r.length,i=0;i<a;i+=3)U.Cartesian3.unpack(r,i,n),Y.Matrix3.multiplyByVector(e,n,n),n=U.Cartesian3.normalize(n,n),U.Cartesian3.pack(n,r,i)}var p=new Y.Matrix4,d=new Y.Matrix3;r.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(Y.Matrix4.equals(t,Y.Matrix4.IDENTITY))return e;var r=e.geometry.attributes;i(t,r.position),i(t,r.prevPosition),i(t,r.nextPosition),(_.defined(r.normal)||_.defined(r.tangent)||_.defined(r.bitangent))&&(Y.Matrix4.inverse(t,p),Y.Matrix4.transpose(p,p),Y.Matrix4.getMatrix3(p,d),u(d,r.normal),u(d,r.tangent),u(d,r.bitangent));var a=e.geometry.boundingSphere;return _.defined(a)&&(e.geometry.boundingSphere=Y.BoundingSphere.transform(a,t,a)),e.modelMatrix=Y.Matrix4.clone(Y.Matrix4.IDENTITY),e};var O=new U.Cartesian3;function y(e,t){var r,a,i,n,s,o,u,p,d=e.length,l=(e[0].modelMatrix,_.defined(e[0][t].indices)),v=e[0][t].primitiveType,y=function(e,t){var r,a=e.length,i={},n=e[0][t].attributes;for(r in n)if(n.hasOwnProperty(r)&&_.defined(n[r])&&_.defined(n[r].values)){for(var s=n[r],o=s.values.length,u=!0,p=1;p<a;++p){var d=e[p][t].attributes[r];if(!_.defined(d)||s.componentDatatype!==d.componentDatatype||s.componentsPerAttribute!==d.componentsPerAttribute||s.normalize!==d.normalize){u=!1;break}o+=d.values.length}u&&(i[r]=new G.GeometryAttribute({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:M.ComponentDatatype.createTypedArray(s.componentDatatype,o)}))}return i}(e,t);for(r in y)if(y.hasOwnProperty(r))for(s=y[r].values,a=n=0;a<d;++a)for(u=(o=e[a][t].attributes[r].values).length,i=0;i<u;++i)s[n++]=o[i];if(l){var f=0;for(a=0;a<d;++a)f+=e[a][t].indices.length;var c=G.Geometry.computeNumberOfVertices(new G.Geometry({attributes:y,primitiveType:G.PrimitiveType.POINTS})),m=w.IndexDatatype.createTypedArray(c,f),C=0,h=0;for(a=0;a<d;++a){var b=e[a][t].indices,g=b.length;for(n=0;n<g;++n)m[C++]=h+b[n];h+=G.Geometry.computeNumberOfVertices(e[a][t])}p=m}var A,T=new U.Cartesian3,x=0;for(a=0;a<d;++a){if(A=e[a][t].boundingSphere,!_.defined(A)){T=void 0;break}U.Cartesian3.add(A.center,T,T)}if(_.defined(T))for(U.Cartesian3.divideByScalar(T,d,T),a=0;a<d;++a){A=e[a][t].boundingSphere;var P=U.Cartesian3.magnitude(U.Cartesian3.subtract(A.center,T,O))+A.radius;x<P&&(x=P)}return new G.Geometry({attributes:y,indices:p,primitiveType:v,boundingSphere:_.defined(T)?new Y.BoundingSphere(T,x):void 0})}r.combineInstances=function(e){for(var t=[],r=[],a=e.length,i=0;i<a;++i){var n=e[i];_.defined(n.geometry)?t.push(n):_.defined(n.westHemisphereGeometry)&&_.defined(n.eastHemisphereGeometry)&&r.push(n)}var s=[];return 0<t.length&&s.push(y(t,"geometry")),0<r.length&&(s.push(y(r,"westHemisphereGeometry")),s.push(y(r,"eastHemisphereGeometry"))),s};var T=new U.Cartesian3,E=new U.Cartesian3,N=new U.Cartesian3,L=new U.Cartesian3;r.computeNormal=function(e){var t,r=e.indices,a=e.attributes,i=a.position.values,n=a.position.values.length/3,s=r.length,o=new Array(n),u=new Array(s/3),p=new Array(s);for(t=0;t<n;t++)o[t]={indexOffset:0,count:0,currentCount:0};var d=0;for(t=0;t<s;t+=3){var l=r[t],v=r[t+1],y=r[t+2],f=3*l,c=3*v,m=3*y;E.x=i[f],E.y=i[1+f],E.z=i[2+f],N.x=i[c],N.y=i[1+c],N.z=i[2+c],L.x=i[m],L.y=i[1+m],L.z=i[2+m],o[l].count++,o[v].count++,o[y].count++,U.Cartesian3.subtract(N,E,N),U.Cartesian3.subtract(L,E,L),u[d]=U.Cartesian3.cross(N,L,new U.Cartesian3),d++}var C,h=0;for(t=0;t<n;t++)o[t].indexOffset+=h,h+=o[t].count;for(t=d=0;t<s;t+=3){var b=(C=o[r[t]]).indexOffset+C.currentCount;p[b]=d,C.currentCount++,p[b=(C=o[r[t+1]]).indexOffset+C.currentCount]=d,C.currentCount++,p[b=(C=o[r[t+2]]).indexOffset+C.currentCount]=d,C.currentCount++,d++}var g=new Float32Array(3*n);for(t=0;t<n;t++){var A=3*t;if(C=o[t],U.Cartesian3.clone(U.Cartesian3.ZERO,T),0<C.count){for(d=0;d<C.count;d++)U.Cartesian3.add(T,u[p[C.indexOffset+d]],T);U.Cartesian3.equalsEpsilon(U.Cartesian3.ZERO,T,q.CesiumMath.EPSILON10)&&U.Cartesian3.clone(u[p[C.indexOffset]],T)}U.Cartesian3.equalsEpsilon(U.Cartesian3.ZERO,T,q.CesiumMath.EPSILON10)&&(T.z=1),U.Cartesian3.normalize(T,T),g[A]=T.x,g[1+A]=T.y,g[2+A]=T.z}return e.attributes.normal=new G.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:g}),e};var R=new U.Cartesian3,V=new U.Cartesian3,F=new U.Cartesian3;r.computeTangentAndBitangent=function(e){e.attributes;var t,r,a,i,n=e.indices,s=e.attributes.position.values,o=e.attributes.normal.values,u=e.attributes.st.values,p=e.attributes.position.values.length/3,d=n.length,l=new Array(3*p);for(t=0;t<l.length;t++)l[t]=0;for(t=0;t<d;t+=3){var v=n[t],y=n[t+1],f=n[t+2];a=3*y,i=3*f;var c=2*v,m=2*y,C=2*f,h=s[r=3*v],b=s[r+1],g=s[r+2],A=u[c],T=u[1+c],x=u[1+m]-T,P=u[1+C]-T,w=1/((u[m]-A)*P-(u[C]-A)*x),S=(P*(s[a]-h)-x*(s[i]-h))*w,I=(P*(s[a+1]-b)-x*(s[i+1]-b))*w,O=(P*(s[a+2]-g)-x*(s[i+2]-g))*w;l[r]+=S,l[r+1]+=I,l[r+2]+=O,l[a]+=S,l[a+1]+=I,l[a+2]+=O,l[i]+=S,l[i+1]+=I,l[i+2]+=O}var E=new Float32Array(3*p),N=new Float32Array(3*p);for(t=0;t<p;t++){a=(r=3*t)+1,i=r+2;var L=U.Cartesian3.fromArray(o,r,R),z=U.Cartesian3.fromArray(l,r,F),D=U.Cartesian3.dot(L,z);U.Cartesian3.multiplyByScalar(L,D,V),U.Cartesian3.normalize(U.Cartesian3.subtract(z,V,z),z),E[r]=z.x,E[a]=z.y,E[i]=z.z,U.Cartesian3.normalize(U.Cartesian3.cross(L,z,z),z),N[r]=z.x,N[a]=z.y,N[i]=z.z}return e.attributes.tangent=new G.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:E}),e.attributes.bitangent=new G.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:N}),e};var z=new U.Cartesian2,D=new U.Cartesian3,B=new U.Cartesian3,k=new U.Cartesian3,H=new U.Cartesian2;function h(e){switch(e.primitiveType){case G.PrimitiveType.TRIANGLE_FAN:return function(e){var t=G.Geometry.computeNumberOfVertices(e),r=w.IndexDatatype.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var a=3,i=3;i<t;++i)r[a++]=i-1,r[a++]=0,r[a++]=i;return e.indices=r,e.primitiveType=G.PrimitiveType.TRIANGLES,e}(e);case G.PrimitiveType.TRIANGLE_STRIP:return function(e){var t=G.Geometry.computeNumberOfVertices(e),r=w.IndexDatatype.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,3<t&&(r[3]=0,r[4]=2,r[5]=3);for(var a=6,i=3;i<t-1;i+=2)r[a++]=i,r[a++]=i-1,r[a++]=i+1,i+2<t&&(r[a++]=i,r[a++]=i+1,r[a++]=i+2);return e.indices=r,e.primitiveType=G.PrimitiveType.TRIANGLES,e}(e);case G.PrimitiveType.TRIANGLES:return function(e){if(_.defined(e.indices))return e;for(var t=G.Geometry.computeNumberOfVertices(e),r=w.IndexDatatype.createTypedArray(t,t),a=0;a<t;++a)r[a]=a;return e.indices=r,e}(e);case G.PrimitiveType.LINE_STRIP:return function(e){var t=G.Geometry.computeNumberOfVertices(e),r=w.IndexDatatype.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var a=2,i=2;i<t;++i)r[a++]=i-1,r[a++]=i;return e.indices=r,e.primitiveType=G.PrimitiveType.LINES,e}(e);case G.PrimitiveType.LINE_LOOP:return function(e){var t=G.Geometry.computeNumberOfVertices(e),r=w.IndexDatatype.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var a=2,i=2;i<t;++i)r[a++]=i-1,r[a++]=i;return r[a++]=t-1,r[a]=0,e.indices=r,e.primitiveType=G.PrimitiveType.LINES,e}(e);case G.PrimitiveType.LINES:return function(e){if(_.defined(e.indices))return e;for(var t=G.Geometry.computeNumberOfVertices(e),r=w.IndexDatatype.createTypedArray(t,t),a=0;a<t;++a)r[a]=a;return e.indices=r,e}(e)}return e}function b(e,t){Math.abs(e.y)<q.CesiumMath.EPSILON6&&(e.y=t?-q.CesiumMath.EPSILON6:q.CesiumMath.EPSILON6)}r.compressVertices=function(e){var t,r,a=e.attributes.extrudeDirection;if(_.defined(a)){var i=a.values;r=i.length/3;var n=new Float32Array(2*r),s=0;for(t=0;t<r;++t)U.Cartesian3.fromArray(i,3*t,D),U.Cartesian3.equals(D,U.Cartesian3.ZERO)?s+=2:(H=P.AttributeCompression.octEncodeInRange(D,65535,H),n[s++]=H.x,n[s++]=H.y);return e.attributes.compressedAttributes=new G.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:n}),delete e.attributes.extrudeDirection,e}var o=e.attributes.normal,u=e.attributes.st,p=_.defined(o),d=_.defined(u);if(!p&&!d)return e;var l,v,y,f,c=e.attributes.tangent,m=e.attributes.bitangent,C=_.defined(c),h=_.defined(m);p&&(l=o.values),d&&(v=u.values),C&&(y=c.values),h&&(f=m.values);var b=r=(p?l.length:v.length)/(p?3:2),g=d&&p?2:1;b*=g+=C||h?1:0;var A=new Float32Array(b),T=0;for(t=0;t<r;++t){d&&(U.Cartesian2.fromArray(v,2*t,z),A[T++]=P.AttributeCompression.compressTextureCoordinates(z));var x=3*t;p&&_.defined(y)&&_.defined(f)?(U.Cartesian3.fromArray(l,x,D),U.Cartesian3.fromArray(y,x,B),U.Cartesian3.fromArray(f,x,k),P.AttributeCompression.octPack(D,B,k,z),A[T++]=z.x,A[T++]=z.y):(p&&(U.Cartesian3.fromArray(l,x,D),A[T++]=P.AttributeCompression.octEncodeFloat(D)),C&&(U.Cartesian3.fromArray(y,x,D),A[T++]=P.AttributeCompression.octEncodeFloat(D)),h&&(U.Cartesian3.fromArray(f,x,D),A[T++]=P.AttributeCompression.octEncodeFloat(D)))}return e.attributes.compressedAttributes=new G.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:g,values:A}),p&&delete e.attributes.normal,d&&delete e.attributes.st,h&&delete e.attributes.bitangent,C&&delete e.attributes.tangent,e};var g=new U.Cartesian3;function A(e,t,r,a){U.Cartesian3.add(e,U.Cartesian3.multiplyByScalar(U.Cartesian3.subtract(t,e,g),e.y/(e.y-t.y),g),r),U.Cartesian3.clone(r,a),b(r,!0),b(a,!1)}var W=new U.Cartesian3,X=new U.Cartesian3,j=new U.Cartesian3,J=new U.Cartesian3,K={positions:new Array(7),indices:new Array(9)};function Q(e,t,r){if(!(0<=e.x||0<=t.x||0<=r.x)){!function(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return b(e,e.y<0),b(t,t.y<0),b(r,r.y<0);var a=Math.abs(e.y),i=Math.abs(t.y),n=Math.abs(r.y),s=(i<a?n<a?q.CesiumMath.sign(e.y):q.CesiumMath.sign(r.y):n<i?q.CesiumMath.sign(t.y):q.CesiumMath.sign(r.y))<0;b(e,s),b(t,s),b(r,s)}(e,t,r);var a=e.y<0,i=t.y<0,n=r.y<0,s=0;s+=a?1:0,s+=i?1:0,s+=n?1:0;var o=K.indices;1==s?(o[1]=3,o[2]=4,o[5]=6,o[7]=6,o[8]=5,a?(A(e,t,W,j),A(e,r,X,J),o[0]=0,o[3]=1,o[4]=2,o[6]=1):i?(A(t,r,W,j),A(t,e,X,J),o[0]=1,o[3]=2,o[4]=0,o[6]=2):n&&(A(r,e,W,j),A(r,t,X,J),o[0]=2,o[3]=0,o[4]=1,o[6]=0)):2==s&&(o[2]=4,o[4]=4,o[5]=3,o[7]=5,o[8]=6,a?i?n||(A(r,e,W,j),A(r,t,X,J),o[0]=0,o[1]=1,o[3]=0,o[6]=2):(A(t,r,W,j),A(t,e,X,J),o[0]=2,o[1]=0,o[3]=2,o[6]=1):(A(e,t,W,j),A(e,r,X,J),o[0]=1,o[1]=2,o[3]=1,o[6]=0));var u=K.positions;return u[0]=e,u[1]=t,u[2]=r,u.length=3,1!=s&&2!=s||(u[3]=W,u[4]=X,u[5]=j,u[6]=J,u.length=7),K}}function $(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var a in r)if(r.hasOwnProperty(a)&&_.defined(r[a])&&_.defined(r[a].values)){var i=r[a];i.values=M.ComponentDatatype.createTypedArray(i.componentDatatype,i.values)}var n=G.Geometry.computeNumberOfVertices(e);return e.indices=w.IndexDatatype.createTypedArray(n,e.indices),t&&(e.boundingSphere=Y.BoundingSphere.fromVertices(r.position.values)),e}}function ee(e){var t=e.attributes,r={};for(var a in t)if(t.hasOwnProperty(a)&&_.defined(t[a])&&_.defined(t[a].values)){var i=t[a];r[a]=new G.GeometryAttribute({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new G.Geometry({attributes:r,indices:[],primitiveType:e.primitiveType})}function te(e,t,r){var a=_.defined(e.geometry.boundingSphere);t=$(t,a),r=$(r,a),_.defined(r)&&!_.defined(t)?e.geometry=r:!_.defined(r)&&_.defined(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function re(v,y){var f=new v,c=new v,m=new v;return function(e,t,r,a,i,n,s,o){var u=v.fromArray(i,e*y,f),p=v.fromArray(i,t*y,c),d=v.fromArray(i,r*y,m);v.multiplyByScalar(u,a.x,u),v.multiplyByScalar(p,a.y,p),v.multiplyByScalar(d,a.z,d);var l=v.add(u,p,u);v.add(l,d,l),o&&v.normalize(l,l),v.pack(l,n,s*y)}}var ae=re(Y.Cartesian4,4),ie=re(U.Cartesian3,3),ne=re(U.Cartesian2,2),se=function(e,t,r,a,i,n,s){var o=i[e]*a.x,u=i[t]*a.y,p=i[r]*a.z;n[s]=o+u+p>q.CesiumMath.EPSILON6?1:0},oe=new U.Cartesian3,ue=new U.Cartesian3,pe=new U.Cartesian3,de=new U.Cartesian3;function le(e,t,r,a,i,n,s,o,u,p,d,l,v,y,f,c){if(_.defined(n)||_.defined(s)||_.defined(o)||_.defined(u)||_.defined(p)||0!==y){var m=function(e,t,r,a,i){var n,s,o,u,p,d,l,v;if(_.defined(i)||(i=new U.Cartesian3),_.defined(t.z)){if(U.Cartesian3.equalsEpsilon(e,t,q.CesiumMath.EPSILON14))return U.Cartesian3.clone(U.Cartesian3.UNIT_X,i);if(U.Cartesian3.equalsEpsilon(e,r,q.CesiumMath.EPSILON14))return U.Cartesian3.clone(U.Cartesian3.UNIT_Y,i);if(U.Cartesian3.equalsEpsilon(e,a,q.CesiumMath.EPSILON14))return U.Cartesian3.clone(U.Cartesian3.UNIT_Z,i);n=U.Cartesian3.subtract(r,t,x),s=U.Cartesian3.subtract(a,t,S),o=U.Cartesian3.subtract(e,t,I),u=U.Cartesian3.dot(n,n),p=U.Cartesian3.dot(n,s),d=U.Cartesian3.dot(n,o),l=U.Cartesian3.dot(s,s),v=U.Cartesian3.dot(s,o)}else{if(U.Cartesian2.equalsEpsilon(e,t,q.CesiumMath.EPSILON14))return U.Cartesian3.clone(U.Cartesian3.UNIT_X,i);if(U.Cartesian2.equalsEpsilon(e,r,q.CesiumMath.EPSILON14))return U.Cartesian3.clone(U.Cartesian3.UNIT_Y,i);if(U.Cartesian2.equalsEpsilon(e,a,q.CesiumMath.EPSILON14))return U.Cartesian3.clone(U.Cartesian3.UNIT_Z,i);n=U.Cartesian2.subtract(r,t,x),s=U.Cartesian2.subtract(a,t,S),o=U.Cartesian2.subtract(e,t,I),u=U.Cartesian2.dot(n,n),p=U.Cartesian2.dot(n,s),d=U.Cartesian2.dot(n,o),l=U.Cartesian2.dot(s,s),v=U.Cartesian2.dot(s,o)}i.y=l*d-p*v,i.z=u*v-p*d;var y=u*l-p*p;return 0!==i.y&&(i.y/=y),0!==i.z&&(i.z/=y),i.x=1-i.y-i.z,i}(a,U.Cartesian3.fromArray(i,3*e,oe),U.Cartesian3.fromArray(i,3*t,ue),U.Cartesian3.fromArray(i,3*r,pe),de);if(_.defined(n)&&ie(e,t,r,m,n,l.normal.values,c,!0),_.defined(p)){var C,h=U.Cartesian3.fromArray(p,3*e,oe),b=U.Cartesian3.fromArray(p,3*t,ue),g=U.Cartesian3.fromArray(p,3*r,pe);U.Cartesian3.multiplyByScalar(h,m.x,h),U.Cartesian3.multiplyByScalar(b,m.y,b),U.Cartesian3.multiplyByScalar(g,m.z,g),U.Cartesian3.equals(h,U.Cartesian3.ZERO)&&U.Cartesian3.equals(b,U.Cartesian3.ZERO)&&U.Cartesian3.equals(g,U.Cartesian3.ZERO)?((C=oe).x=0,C.y=0,C.z=0):(C=U.Cartesian3.add(h,b,h),U.Cartesian3.add(C,g,C),U.Cartesian3.normalize(C,C)),U.Cartesian3.pack(C,l.extrudeDirection.values,3*c)}if(_.defined(d)&&se(e,t,r,m,d,l.applyOffset.values,c),_.defined(s)&&ie(e,t,r,m,s,l.tangent.values,c,!0),_.defined(o)&&ie(e,t,r,m,o,l.bitangent.values,c,!0),_.defined(u)&&ne(e,t,r,m,u,l.st.values,c),0<y)for(var A=0;A<y;A++){var T=v[A];ve(e,t,r,m,c,f[T],l[T])}}}function ve(e,t,r,a,i,n,s){var o=n.componentsPerAttribute,u=n.values,p=s.values;switch(o){case 4:ae(e,t,r,a,u,p,i,!1);break;case 3:ie(e,t,r,a,u,p,i,!1);break;case 2:ne(e,t,r,a,u,p,i,!1);break;default:p[i]=u[e]*a.x+u[t]*a.y+u[r]*a.z}}function ye(e,t,r,a,i,n){var s=e.position.values.length/3;if(-1===i)return e.position.values.push(n.x,n.y,n.z),t.push(s),s;var o=a[i],u=r[o];return-1===u?(r[o]=s,e.position.values.push(n.x,n.y,n.z),t.push(s),s):(t.push(u),u)}var fe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ce(e){var t=e.geometry,r=t.attributes,a=r.position.values,i=_.defined(r.normal)?r.normal.values:void 0,n=_.defined(r.bitangent)?r.bitangent.values:void 0,s=_.defined(r.tangent)?r.tangent.values:void 0,o=_.defined(r.st)?r.st.values:void 0,u=_.defined(r.extrudeDirection)?r.extrudeDirection.values:void 0,p=_.defined(r.applyOffset)?r.applyOffset.values:void 0,d=t.indices,l=[];for(var v in r)r.hasOwnProperty(v)&&!fe[v]&&_.defined(r[v])&&l.push(v);var y,f,c,m,C=l.length,h=ee(t),b=ee(t),g=[];g.length=a.length/3;var A=[];for(A.length=a.length/3,m=0;m<g.length;++m)g[m]=-1,A[m]=-1;var T=d.length;for(m=0;m<T;m+=3){var x=d[m],P=d[m+1],w=d[m+2],S=U.Cartesian3.fromArray(a,3*x),I=U.Cartesian3.fromArray(a,3*P),O=U.Cartesian3.fromArray(a,3*w),E=Q(S,I,O);if(_.defined(E)&&3<E.positions.length)for(var N=E.positions,L=E.indices,z=L.length,D=0;D<z;++D){var M=L[D],G=N[M];c=G.y<0?(y=b.attributes,f=b.indices,g):(y=h.attributes,f=h.indices,A),le(x,P,w,G,a,i,s,n,o,u,p,y,l,C,r,ye(y,f,c,d,M<3?m+M:-1,G))}else _.defined(E)&&(S=E.positions[0],I=E.positions[1],O=E.positions[2]),c=S.y<0?(y=b.attributes,f=b.indices,g):(y=h.attributes,f=h.indices,A),le(x,P,w,S,a,i,s,n,o,u,p,y,l,C,r,ye(y,f,c,d,m,S)),le(x,P,w,I,a,i,s,n,o,u,p,y,l,C,r,ye(y,f,c,d,m+1,I)),le(x,P,w,O,a,i,s,n,o,u,p,y,l,C,r,ye(y,f,c,d,m+2,O))}te(e,b,h)}var me=a.Plane.fromPointNormal(U.Cartesian3.ZERO,U.Cartesian3.UNIT_Y),Ce=new U.Cartesian3,he=new U.Cartesian3;function be(e,t,r,a,i,n,s){if(_.defined(s)){var o=U.Cartesian3.fromArray(a,3*e,oe);U.Cartesian3.equalsEpsilon(o,r,q.CesiumMath.EPSILON10)?n.applyOffset.values[i]=s[e]:n.applyOffset.values[i]=s[t]}}function ge(e){var t,r=e.geometry,a=r.attributes,i=a.position.values,n=_.defined(a.applyOffset)?a.applyOffset.values:void 0,s=r.indices,o=ee(r),u=ee(r),p=s.length,d=[];d.length=i.length/3;var l=[];for(l.length=i.length/3,t=0;t<d.length;++t)d[t]=-1,l[t]=-1;for(t=0;t<p;t+=2){var v=s[t],y=s[t+1],f=U.Cartesian3.fromArray(i,3*v,oe),c=U.Cartesian3.fromArray(i,3*y,ue);Math.abs(f.y)<q.CesiumMath.EPSILON6&&(f.y<0?f.y=-q.CesiumMath.EPSILON6:f.y=q.CesiumMath.EPSILON6),Math.abs(c.y)<q.CesiumMath.EPSILON6&&(c.y<0?c.y=-q.CesiumMath.EPSILON6:c.y=q.CesiumMath.EPSILON6);var m=o.attributes,C=o.indices,h=l,b=u.attributes,g=u.indices,A=d,T=Z.IntersectionTests.lineSegmentPlane(f,c,me,pe);if(_.defined(T)){var x=U.Cartesian3.multiplyByScalar(U.Cartesian3.UNIT_Y,5*q.CesiumMath.EPSILON9,Ce);f.y<0&&(U.Cartesian3.negate(x,x),m=u.attributes,C=u.indices,h=d,b=o.attributes,g=o.indices,A=l);var P=U.Cartesian3.add(T,x,he);be(v,y,f,i,ye(m,C,h,s,t,f),m,n),be(v,y,P,i,ye(m,C,h,s,-1,P),m,n),U.Cartesian3.negate(x,x),U.Cartesian3.add(T,x,P),be(v,y,P,i,ye(b,g,A,s,-1,P),b,n),be(v,y,c,i,ye(b,g,A,s,t+1,c),b,n)}else{var w,S,I;I=f.y<0?(w=u.attributes,S=u.indices,d):(w=o.attributes,S=o.indices,l),be(v,y,f,i,ye(w,S,I,s,t,f),w,n),be(v,y,c,i,ye(w,S,I,s,t+1,c),w,n)}}te(e,u,o)}var Ae=new U.Cartesian2,Te=new U.Cartesian2,xe=new U.Cartesian3,Pe=new U.Cartesian3,we=new U.Cartesian3,Se=new U.Cartesian3,Ie=new U.Cartesian3,Oe=new U.Cartesian3,Ee=new Y.Cartesian4;function Ne(e){for(var t=e.attributes,r=t.position.values,a=t.prevPosition.values,i=t.nextPosition.values,n=r.length,s=0;s<n;s+=3){var o=U.Cartesian3.unpack(r,s,xe);if(!(0<o.x)){var u=U.Cartesian3.unpack(a,s,Pe);(o.y<0&&0<u.y||0<o.y&&u.y<0)&&(0<s-3?(a[s]=r[s-3],a[s+1]=r[s-2],a[s+2]=r[s-1]):U.Cartesian3.pack(o,a,s));var p=U.Cartesian3.unpack(i,s,we);(o.y<0&&0<p.y||0<o.y&&p.y<0)&&(s+3<n?(i[s]=r[s+3],i[s+1]=r[s+4],i[s+2]=r[s+5]):U.Cartesian3.pack(o,i,s))}}}var Le=5*q.CesiumMath.EPSILON9,ze=q.CesiumMath.EPSILON6;r.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(_.defined(r)&&(0<r.center.x-r.radius||Y.BoundingSphere.intersectPlane(r,a.Plane.ORIGIN_ZX_PLANE)!==Y.Intersect.INTERSECTING))return e;if(t.geometryType!==G.GeometryType.NONE)switch(t.geometryType){case G.GeometryType.POLYLINES:!function(e){var t,r,a,i=e.geometry,n=i.attributes,s=n.position.values,o=n.prevPosition.values,u=n.nextPosition.values,p=n.expandAndWidth.values,d=_.defined(n.st)?n.st.values:void 0,l=_.defined(n.color)?n.color.values:void 0,v=ee(i),y=ee(i),f=!1,c=s.length/3;for(t=0;t<c;t+=4){var m=t,C=t+2,h=U.Cartesian3.fromArray(s,3*m,xe),b=U.Cartesian3.fromArray(s,3*C,Pe);if(Math.abs(h.y)<ze)for(h.y=ze*(b.y<0?-1:1),s[3*t+1]=h.y,s[3*(t+1)+1]=h.y,r=3*m;r<3*m+12;r+=3)o[r]=s[3*t],o[r+1]=s[3*t+1],o[r+2]=s[3*t+2];if(Math.abs(b.y)<ze)for(b.y=ze*(h.y<0?-1:1),s[3*(t+2)+1]=b.y,s[3*(t+3)+1]=b.y,r=3*m;r<3*m+12;r+=3)u[r]=s[3*(t+2)],u[r+1]=s[3*(t+2)+1],u[r+2]=s[3*(t+2)+2];var g=v.attributes,A=v.indices,T=y.attributes,x=y.indices,P=Z.IntersectionTests.lineSegmentPlane(h,b,me,Se);if(_.defined(P)){f=!0;var w=U.Cartesian3.multiplyByScalar(U.Cartesian3.UNIT_Y,Le,Ie);h.y<0&&(U.Cartesian3.negate(w,w),g=y.attributes,A=y.indices,T=v.attributes,x=v.indices);var S=U.Cartesian3.add(P,w,Oe);g.position.values.push(h.x,h.y,h.z,h.x,h.y,h.z),g.position.values.push(S.x,S.y,S.z),g.position.values.push(S.x,S.y,S.z),g.prevPosition.values.push(o[3*m],o[3*m+1],o[3*m+2]),g.prevPosition.values.push(o[3*m+3],o[3*m+4],o[3*m+5]),g.prevPosition.values.push(h.x,h.y,h.z,h.x,h.y,h.z),g.nextPosition.values.push(S.x,S.y,S.z),g.nextPosition.values.push(S.x,S.y,S.z),g.nextPosition.values.push(S.x,S.y,S.z),g.nextPosition.values.push(S.x,S.y,S.z),U.Cartesian3.negate(w,w),U.Cartesian3.add(P,w,S),T.position.values.push(S.x,S.y,S.z),T.position.values.push(S.x,S.y,S.z),T.position.values.push(b.x,b.y,b.z,b.x,b.y,b.z),T.prevPosition.values.push(S.x,S.y,S.z),T.prevPosition.values.push(S.x,S.y,S.z),T.prevPosition.values.push(S.x,S.y,S.z),T.prevPosition.values.push(S.x,S.y,S.z),T.nextPosition.values.push(b.x,b.y,b.z,b.x,b.y,b.z),T.nextPosition.values.push(u[3*C],u[3*C+1],u[3*C+2]),T.nextPosition.values.push(u[3*C+3],u[3*C+4],u[3*C+5]);var I=U.Cartesian2.fromArray(p,2*m,Ae),O=Math.abs(I.y);g.expandAndWidth.values.push(-1,O,1,O),g.expandAndWidth.values.push(-1,-O,1,-O),T.expandAndWidth.values.push(-1,O,1,O),T.expandAndWidth.values.push(-1,-O,1,-O);var E=U.Cartesian3.magnitudeSquared(U.Cartesian3.subtract(P,h,we));if(E/=U.Cartesian3.magnitudeSquared(U.Cartesian3.subtract(b,h,we)),_.defined(l)){var N=Y.Cartesian4.fromArray(l,4*m,Ee),L=Y.Cartesian4.fromArray(l,4*C,Ee),z=q.CesiumMath.lerp(N.x,L.x,E),D=q.CesiumMath.lerp(N.y,L.y,E),M=q.CesiumMath.lerp(N.z,L.z,E),G=q.CesiumMath.lerp(N.w,L.w,E);for(r=4*m;r<4*m+8;++r)g.color.values.push(l[r]);for(g.color.values.push(z,D,M,G),g.color.values.push(z,D,M,G),T.color.values.push(z,D,M,G),T.color.values.push(z,D,M,G),r=4*C;r<4*C+8;++r)T.color.values.push(l[r])}if(_.defined(d)){var R=U.Cartesian2.fromArray(d,2*m,Ae),V=U.Cartesian2.fromArray(d,2*(t+3),Te),F=q.CesiumMath.lerp(R.x,V.x,E);for(r=2*m;r<2*m+4;++r)g.st.values.push(d[r]);for(g.st.values.push(F,R.y),g.st.values.push(F,V.y),T.st.values.push(F,R.y),T.st.values.push(F,V.y),r=2*C;r<2*C+4;++r)T.st.values.push(d[r])}a=g.position.values.length/3-4,A.push(a,a+2,a+1),A.push(a+1,a+2,a+3),a=T.position.values.length/3-4,x.push(a,a+2,a+1),x.push(a+1,a+2,a+3)}else{var B,k;for(k=h.y<0?(B=y.attributes,y.indices):(B=v.attributes,v.indices),B.position.values.push(h.x,h.y,h.z),B.position.values.push(h.x,h.y,h.z),B.position.values.push(b.x,b.y,b.z),B.position.values.push(b.x,b.y,b.z),r=3*t;r<3*t+12;++r)B.prevPosition.values.push(o[r]),B.nextPosition.values.push(u[r]);for(r=2*t;r<2*t+8;++r)B.expandAndWidth.values.push(p[r]),_.defined(d)&&B.st.values.push(d[r]);if(_.defined(l))for(r=4*t;r<4*t+16;++r)B.color.values.push(l[r]);a=B.position.values.length/3-4,k.push(a,a+2,a+1),k.push(a+1,a+2,a+3)}}f&&(Ne(y),Ne(v)),te(e,y,v)}(e);break;case G.GeometryType.TRIANGLES:ce(e);break;case G.GeometryType.LINES:ge(e)}else h(t),t.primitiveType===G.PrimitiveType.TRIANGLES?ce(e):t.primitiveType===G.PrimitiveType.LINES&&ge(e);return e},e.GeometryPipeline=r});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment