hi-ucs/front/public/leaflet/libs/iClientfor3D/Workers/createRectangleGeometry.js

63 lines
190 KiB
Vue
Raw Normal View History

2022-06-14 09:32:49 +08:00
/**
* Cesium - https://github.com/AnalyticalGraphicsInc/cesium
*
* Copyright 2011-2017 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/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details.
*/
/**
@license
mersenne-twister.js - https://gist.github.com/banksean/300494
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The names of its contributors may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(n,a){if(!e(a))throw new t(r(n))},a.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},a.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},a.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},a.typeOf.number.lessThan=function(e,r,n){if(a.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(e,r,n){if(a.typeOf.number(e,r),n>=r)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),n>r)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},a.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},a.typeOf.number.equals=function(e,r,n,i){if(a.typeOf.number(e,n),a.typeOf.number(r,i),n!==i)throw new t(e+" must be equal to "+r+", the actual values are "+n+" and "+i)},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e&&null!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";var a={};a.Radious=6378137,a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14
}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a,i,o,u,s,c){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(i,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(o,0),this[8]=r(c,0)}function c(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function l(e){for(var t=0,r=0;3>r;++r){var n=e[s.getElementIndex(d[r],h[r])];t+=2*n*n}return Math.sqrt(t)}function f(e,t){for(var r=u.EPSILON15,n=0,a=1,i=0;3>i;++i){var o=Math.abs(e[s.getElementIndex(d[i],h[i])]);o>n&&(a=i,n=o)}var c=1,l=0,f=h[a],p=d[a];if(Math.abs(e[s.getElementIndex(p,f)])>r){var y,m=e[s.getElementIndex(p,p)],E=e[s.getElementIndex(f,f)],O=e[s.getElementIndex(p,f)],T=(m-E)/2/O;y=0>T?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+y*y),l=y*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(p,p)]=c,t[s.getElementIndex(p,f)]=l,t[s.getElementIndex(f,p)]=-l,t}s.packedLength=9,s.pack=function(e,n,a){return t.typeOf.object("value",e),t.defined("array",n),a=r(a,0),n[a++]=e[0],n[a++]=e[1],n[a++]=e[2],n[a++]=e[3],n[a++]=e[4],n[a++]=e[5],n[a++]=e[6],n[a++]=e[7],n[a++]=e[8],n},s.unpack=function(e,a,i){return t.defined("array",e),a=r(a,0),n(i)||(i=new s),i[0]=e[a++],i[1]=e[a++],i[2]=e[a++],i[3]=e[a++],i[4]=e[a++],i[5]=e[a++],i[6]=e[a++],i[7]=e[a++],i[8]=e[a++],i},s.clone=function(e,t){return n(e)?n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},s.fromArray=function(e,a,i){return t.defined("array",e),a=r(a,0),n(i)||(i=new s),i[0]=e[a],i[1]=e[a+1],i[2]=e[a+2],i[3]=e[a+3],i[4]=e[a+4],i[5]=e[a+5],i[6]=e[a+6],i[7]=e[a+7],i[8]=e[a+8],i},s.fromColumnMajorArray=function(e,r){return t.defined("values",e),s.clone(e,r)},s.fromRowMajorArray=function(e,r){return t.defined("values",e),n(r)?(r[0]=e[0],r[1]=e[3],r[2]=e[6],r[3]=e[1],r[4]=e[4],r[5]=e[7],r[6]=e[2],r[7]=e[5],r[8]=e[8],r):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,r){t.typeOf.object("quaternion",e);var a=e.x*e.x,i=e.x*e.y,o=e.x*e.z,u=e.x*e.w,c=e.y*e.y,l=e.y*e.z,f=e.y*e.w,p=e.z*e.z,y=e.z*e.w,h=e.w*e.w,d=a-c-p+h,m=2*(i-y),E=2*(o+f),O=2*(i+y),T=-a+c-p+h,_=2*(l-u),v=2*(o-f),b=2*(l+u),w=-a-c+p+h;return n(r)?(r[0]=d,r[1]=O,r[2]=v,r[3]=m,r[4]=T,r[5]=b,r[6]=E,r[7]=_,r[8]=w,r):new s(d,m,E,O,T,_,v,b,w)},s.fromHeadingPitchRoll=function(e,r){t.typeOf.object("headingPitchRoll",e);var a=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),u=Math.sin(-e.pitch),c=Math.sin(-e.heading),l=Math.sin(e.roll),f=a*i,p=-o*c+l*u*i,y=l*c+o*u*i,h=a*c,d=o*i+l*u*c,m=-l*i+o*u*c,E=-u,O=l*a,T=o*a;return n(r)?(r[0]=f,r[1]=h,r[2]=E,r[3]=p,r[4]=d,r[5]=O,r[6]=y,r[7]=m,r[8]=T,r):new s(f,p,y,h,d,m,E,O,T)},s.fromScale=function(e,r){return t.typeOf.object("scale",e),n(r)?(r[0]=e.x,r[1]=0,r[2]=0,r[3]=0,r[4]=e.y,r[5]=0,r[6]=0,r[7]=0,r[8]=e.z,r):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,r){return t.typeOf.number("scale",e),n(r)?(r[0]=e,r[1]=0,r[2]=0,r[3]=0,r[4]=e,r[5]=0,r[6]=0,r[7]=0,r[8]=e,r):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,r){return t.typeOf.object("vector",e),n(r)?(r[0]=0,r[1]=e.z,r[2]=-e.y,r[3]=-e.z,r[4]=0,r[5]=e.x,r[6]=e.y,r[7]=-e.x,r[8]=0,r):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,r){t.typeOf.number("angle",e);var a=Math.cos(e),i=Math.sin(e);return n(r)?(r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=a,r[5]=i,r[6]=0,r[7]=-i,r[8]=a,r):new s(1,0,0,0,a,-i,0,i,a)},s.fromRotationY=function(e,r){t.typeOf.number("angle",e);var a=Math.cos(e),i=Math.sin(e);return n(r)?(r[0]=a,r[1]=0,r[2]=-i,r[3]=0,r[4]=1,r[5]=0,r[6]=i,r[7]=0,r[8]=a,r):new s(a,0,i,0,1,0,-i,0,a)},s.fromRotationZ=function(e,r){t.typeOf.number("angle",e);var a=Math.cos(e),i=Math.sin(e);return n(r)?(r[0]=a,r[1]=i,r[2]=0,r[3]=-i,r[4]=a,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r):new s(a,-i,0,i,a,0,0,0,1)},s.toArray=function(e,r){return t.typeOf.object("matrix",e),n(r)?(r[0]=e[0],r[1]=e
n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var a=e[0],i=e[4],o=e[8],f=e[12],p=e[1],y=e[5],h=e[9],d=e[13],m=e[2],v=e[6],b=e[10],w=e[14],R=e[3],g=e[7],A=e[11],N=e[15],S=b*N,x=w*A,I=v*N,M=w*g,C=v*A,P=b*g,L=m*N,U=w*R,F=m*A,D=b*R,B=m*g,z=v*R,j=S*y+M*h+C*d-(x*y+I*h+P*d),q=x*p+L*h+D*d-(S*p+U*h+F*d),G=I*p+U*y+B*d-(M*p+L*y+z*d),V=P*p+F*y+z*h-(C*p+D*y+B*h),X=x*i+I*o+P*f-(S*i+M*o+C*f),W=S*a+U*o+F*f-(x*a+L*o+D*f),H=M*a+L*i+z*f-(I*a+U*i+B*f),Y=C*a+D*i+B*o-(P*a+F*i+z*o);S=o*d,x=f*h,I=i*d,M=f*y,C=i*h,P=o*y,L=a*d,U=f*p,F=a*h,D=o*p,B=a*y,z=i*p;var k=S*g+M*A+C*N-(x*g+I*A+P*N),Z=x*R+L*A+D*N-(S*R+U*A+F*N),K=I*R+U*g+B*N-(M*R+L*g+z*N),Q=P*R+F*g+z*A-(C*R+D*g+B*A),J=I*b+P*w+x*v-(C*w+S*v+M*b),$=F*w+S*m+U*b-(L*b+D*w+x*m),ee=L*v+z*w+M*m-(B*w+I*m+U*v),te=B*b+C*m+D*v-(F*v+z*b+P*m),re=a*j+i*q+o*G+f*V;if(Math.abs(re)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return re=1/re,n[0]=j*re,n[1]=q*re,n[2]=G*re,n[3]=V*re,n[4]=X*re,n[5]=W*re,n[6]=H*re,n[7]=Y*re,n[8]=k*re,n[9]=Z*re,n[10]=K*re,n[11]=Q*re,n[12]=J*re,n[13]=$*re,n[14]=ee*re,n[15]=te*re,n},l.inverseTransformation=function(e,t){r.typeOf.object("matrix",e),r.typeOf.object("result",t);var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],p=e[12],y=e[13],h=e[14],d=-n*p-a*y-i*h,m=-o*p-u*y-s*h,E=-c*p-l*y-f*h;return t[0]=n,t[1]=o,t[2]=c,t[3]=0,t[4]=a,t[5]=u,t[6]=l,t[7]=0,t[8]=i,t[9]=s,t[10]=f,t[11]=0,t[12]=d,t[13]=m,t[14]=E,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function p(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var y=new e,h=new e,d=new e,m=new e,E=new e,O=new e,T=new e,_=new e,v=new e,b=new e,w=new e,R=new e;p.fromPoints=function(t,r){if(a(r)||(r=new p),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n,i=e.clone(t[0],T),o=e.clone(i,y),u=e.clone(i,h),s=e.clone(i,d),c=e.clone(i,m),l=e.clone(i,E),f=e.clone(i,O),g=t.length;for(n=1;g>n;n++){e.clone(t[n],i);var A=i.x,N=i.y,S=i.z;A<o.x&&e.clone(i,o),A>c.x&&e.clone(i,c),N<u.y&&e.clone(i,u),N>l.y&&e.clone(i,l),S<s.z&&e.clone(i,s),S>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,_)),I=e.magnitudeSquared(e.subtract(l,u,_)),M=e.magnitudeSquared(e.subtract(f,s,_)),C=o,P=c,L=x;I>L&&(L=I,C=u,P=l),M>L&&(L=M,C=s,P=f);var U=v;U.x=.5*(C.x+P.x),U.y=.5*(C.y+P.y),U.z=.5*(C.z+P.z);var F=e.magnitudeSquared(e.subtract(P,U,_)),D=Math.sqrt(F),B=b;B.x=o.x,B.y=u.y,B.z=s.z;var z=w;z.x=c.x,z.y=l.y,z.z=f.z;var j=e.multiplyByScalar(e.add(B,z,_),.5,R),q=0;for(n=0;g>n;n++){e.clone(t[n],i);var G=e.magnitude(e.subtract(i,j,_));G>q&&(q=G);var V=e.magnitudeSquared(e.subtract(i,U,_));if(V>F){var X=Math.sqrt(V);D=.5*(D+X),F=D*D;var W=X-D;U.x=(D*U.x+W*i.x)/X,U.y=(D*U.y+W*i.y)/X,U.z=(D*U.z+W*i.z)/X}}return
COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){if(!t(e))throw new r("value is required.");switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e
function g(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function A(e){for(var t=e.length,r=t/3*6,n=m.createTypedArray(t,r),a=0,i=0;t>i;i+=3,a+=6)g(n,a,e[i],e[i+1],e[i+2]);return n}function N(e){var t=e.length;if(t>=3){var r=6*(t-2),n=m.createTypedArray(t,r);g(n,0,e[0],e[1],e[2]);for(var a=6,i=3;t>i;++i,a+=6)g(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function S(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=m.createTypedArray(t,r),a=e[0],i=0,o=1;t>o;++o,i+=6)g(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function x(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new h({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function I(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function M(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;n>i;i+=3)a.unpack(r,i,ie),v.multiplyByPoint(e,ie,ie),a.pack(ie,r,i)}function C(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;n>i;i+=3)a.unpack(r,i,ie),_.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,r,i)}function P(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,f=1;n>f;++f){var p=e[f][t].attributes[r];if(!c(p)||o.componentDatatype!==p.componentDatatype||o.componentsPerAttribute!==p.componentsPerAttribute||o.normalize!==p.normalize){l=!1;break}s+=p.values.length}l&&(a[r]=new h({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function L(e,t){var n,i,o,u,s=e.length,f=e[0].modelMatrix,p=c(e[0][t].indices),h=e[0][t].primitiveType;for(i=1;s>i;++i){if(!v.equals(e[i].modelMatrix,f))throw new l("All instances must have the same modelMatrix.");if(c(e[i][t].indices)!==p)throw new l("All instance geometries must have an indices or not have one.");if(e[i][t].primitiveType!==h)throw new l("All instance geometries must have the same primitiveType.")}var d,E,O,T=P(e,t);for(n in T)if(T.hasOwnProperty(n))for(d=T[n].values,u=0,i=0;s>i;++i)for(E=e[i][t].attributes[n].values,O=E.length,o=0;O>o;++o)d[u++]=E[o];var _;if(p){var b=0;for(i=0;s>i;++i)b+=e[i][t].indices.length;var R=y.computeNumberOfVertices(new y({attributes:T,primitiveType:w.POINTS})),g=m.createTypedArray(R,b),A=0,N=0;for(i=0;s>i;++i){var S=e[i][t].indices,x=S.length;for(u=0;x>u;++u)g[A++]=N+S[u];N+=y.computeNumberOfVertices(e[i][t])}_=g}var I,M=new a,C=0;for(i=0;s>i;++i){if(I=e[i][t].boundingSphere,!c(I)){M=void 0;break}a.add(I.center,M,M)}if(c(M))for(a.divideByScalar(M,s,M),i=0;s>i;++i){I=e[i][t].boundingSphere;var L=a.magnitude(a.subtract(I.center,M,se))+I.radius;L>C&&(C=L)}return new y({attributes:T,indices:_,primitiveType:h,boundingSphere:c(M)?new r(M,C):void 0})}function U(e){if(c(e.indices))return e;var t=y.computeNumberOfVertices(e);if(3>t)throw new l("The number of vertices must be at least three.");if(t%3!==0)throw new l("The number of vertices must be a multiple of three.");for(var r=m.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function F(e){var t=y.computeNumberOfVertices(e);if(3>t)throw new l("The number of vertices must be at least three.");var r=m.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;t>a;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=w.TRIANGLES,e}function D(e){var t=y.computeNumberOfVertices(e);if(3>t)throw new l("The number of vertices must be at least 3.");var r=m.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var n=6,a=3;t-1>a;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,t>a+2&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=w.TRIANGLES,e}function B(e){if(c(e.indices))return e;var t=y.computeNumberOfVertices(e);if(2>t)throw new l("The number of vertices must be at least two.");if(t%2!==0)throw new l("The
vertices:[],holes:[],dimensions:t},n=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;t>o;o++)r.vertices.push(e[a][i][o]);a>0&&(n+=e[a-1].length,r.holes.push(n))}return r},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===r.CLOCKWISE||e===r.COUNTER_CLOCKWISE}};return e(r)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,r,n,a,i,o,u,s,c,l,f,p){"use strict";var y=new r,h=new r,d={};d.computeArea2D=function(e){n.defined("positions",e),n.typeOf.number.greaterThanOrEquals("positions.length",e.length,3);for(var t=e.length,r=0,a=t-1,i=0;t>i;a=i++){var o=e[a],u=e[i];r+=o.x*u.y-u.x*o.y}return.5*r},d.computeWindingOrder2D=function(e){var t=d.computeArea2D(e);return t>0?p.COUNTER_CLOCKWISE:p.CLOCKWISE},d.triangulate=function(r,a){n.defined("positions",r);var i=t.packArray(r);return e(i,a,2)};var m=new r,E=new r,O=new r,T=new r,_=new r,v=new r,b=new r;return d.computeSubdivision=function(e,t,u,p){p=i(p,l.RADIANS_PER_DEGREE),n.typeOf.object("ellipsoid",e),n.defined("positions",t),n.defined("indices",u),n.typeOf.number.greaterThanOrEquals("indices.length",u.length,3),n.typeOf.number.equals("indices.length % 3","0",u.length%3,0),n.typeOf.number.greaterThan("granularity",p,0);var y,h=u.slice(0),d=t.length,w=new Array(3*d),R=0;for(y=0;d>y;y++){var g=t[y];w[R++]=g.x,w[R++]=g.y,w[R++]=g.z}for(var A=[],N={},S=e.maximumRadius,x=l.chordLength(p,S),I=x*x;h.length>0;){var M,C,P=h.pop(),L=h.pop(),U=h.pop(),F=r.fromArray(w,3*U,m),D=r.fromArray(w,3*L,E),B=r.fromArray(w,3*P,O),z=r.multiplyByScalar(r.normalize(F,T),S,T),j=r.multiplyByScalar(r.normalize(D,_),S,_),q=r.multiplyByScalar(r.normalize(B,v),S,v),G=r.magnitudeSquared(r.subtract(z,j,b)),V=r.magnitudeSquared(r.subtract(j,q,b)),X=r.magnitudeSquared(r.subtract(q,z,b)),W=Math.max(G,V,X);W>I?G===W?(M=Math.min(U,L)+" "+Math.max(U,L),y=N[M],o(y)||(C=r.add(F,D,b),r.multiplyByScalar(C,.5,C),w.push(C.x,C.y,C.z),y=w.length/3-1,N[M]=y),h.push(U,y,P),h.push(y,L,P)):V===W?(M=Math.min(L,P)+" "+Math.max(L,P),y=N[M],o(y)||(C=r.add(D,B,b),r.multiplyByScalar(C,.5,C),w.push(C.x,C.y,C.z),y=w.length/3-1,N[M]=y),h.push(L,y,U),h.push(y,P,U)):X===W&&(M=Math.min(P,U)+" "+Math.max(P,U),y=N[M],o(y)||(C=r.add(B,F,b),r.multiplyByScalar(C,.5,C),w.push(C.x,C.y,C.z),y=w.length/3-1,N[M]=y),h.push(P,y,L),h.push(y,U,L)):(A.push(U),A.push(L),A.push(P))}return new s({attributes:{position:new c({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:w})},indices:A,primitiveType:f.TRIANGLES})},d.scaleToGeodeticHeight=function(e,t,n,a){n=i(n,u.WGS84);var s=y,c=h;if(t=i(t,0),a=i(a,!0),o(e))for(var l=e.length,f=0;l>f;f+=3)r.fromArray(e,f,c),a&&(c=n.scaleToGeodeticSurface(c,c)),0!==t&&(s=n.geodeticSurfaceNormal(c,s),r.multiplyByScalar(s,t,s),r.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},d}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a){this.x=r(e,0),this.y=r(t,0),this.z=r(n,0),this.w=r(a,0)}var c=new e;s.fromAxisAngle=function(r,a,i){t.typeOf.object("axis",r),t.typeOf.number("angle",a);var o=a/2,u=Math.sin(o);c=e.normalize(r,c);var l=c.x*u,f=c.y*u,p=c.z*u,y=Math.cos(o);return n(i)?(i.x=l,i.y=f,i.z=p,i.w=y,i):new s(l,f,p,y)};var l=[1,2,0],f=new Array(3);s.fromRotationMatrix=function(e,r){t.typeOf.object("matrix",e);var a,i,o,c,p,y=e[u.COLUMN0ROW0],h=e[u.COLUMN1ROW1],d=e[u.COLUMN2ROW2],m=y+h+d;if(m>0)a=Math.sqrt(m+1),p=.5*a,a=.5/a,i=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*a,o=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*a,c=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*a;else{var E=l,O=0;h>y&&(O=1),d>y&&d>h&&(O=2);var T=E[O],_=E[T];a=Math.sqrt(e[u.getElementIndex(O,O)]-e[u.getElementIndex(T,T)]-e[u.getElementIndex(_,_)]+1);var v=f;v[O]=.5*a,a=.5/a,p=(e[