352 lines
4.1 MiB
JavaScript
352 lines
4.1 MiB
JavaScript
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Cesium={})}(this,function(exports){"use strict";function appendForwardSlash(e){return 0!==e.length&&"/"===e[e.length-1]||(e+="/"),e}function defined(e){return null!=e}function DeveloperError(e){let t;this.name="DeveloperError",this.message=e;try{throw new Error}catch(e){t=e.stack}this.stack=t}defined(Object.create)&&(DeveloperError.prototype=Object.create(Error.prototype),DeveloperError.prototype.constructor=DeveloperError),DeveloperError.prototype.toString=function(){let e=this.name+": "+this.message;return defined(this.stack)&&(e+=`
|
||
|
`+this.stack.toString()),e},DeveloperError.throwInstantiationError=function(){throw new DeveloperError("This function defines an interface and should not be called directly.")};const Check={};function getUndefinedErrorMessage(e){return e+" is required, actual value was undefined"}function getFailedTypeErrorMessage(e,t,i){return`Expected ${i} to be typeof ${t}, actual typeof was `+e}function defaultValue(e,t){return null!=e?e:t}Check.typeOf={},Check.defined=function(e,t){if(!defined(t))throw new DeveloperError(getUndefinedErrorMessage(e))},Check.typeOf.func=function(e,t){if("function"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"function",e))},Check.typeOf.string=function(e,t){if("string"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"string",e))},Check.typeOf.number=function(e,t){if("number"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"number",e))},Check.typeOf.number.lessThan=function(e,t,i){if(Check.typeOf.number(e,t),i<=t)throw new DeveloperError(`Expected ${e} to be less than ${i}, actual value was `+t)},Check.typeOf.number.lessThanOrEquals=function(e,t,i){if(Check.typeOf.number(e,t),i<t)throw new DeveloperError(`Expected ${e} to be less than or equal to ${i}, actual value was `+t)},Check.typeOf.number.greaterThan=function(e,t,i){if(Check.typeOf.number(e,t),t<=i)throw new DeveloperError(`Expected ${e} to be greater than ${i}, actual value was `+t)},Check.typeOf.number.greaterThanOrEquals=function(e,t,i){if(Check.typeOf.number(e,t),t<i)throw new DeveloperError(`Expected ${e} to be greater than or equal to ${i}, actual value was `+t)},Check.typeOf.object=function(e,t){if("object"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"object",e))},Check.typeOf.bool=function(e,t){if("boolean"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"boolean",e))},Check.typeOf.bigint=function(e,t){if("bigint"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"bigint",e))},Check.typeOf.number.equals=function(e,t,i,n){if(Check.typeOf.number(e,i),Check.typeOf.number(t,n),i!==n)throw new DeveloperError(e+` must be equal to ${t}, the actual values are ${i} and `+n)},defaultValue.EMPTY_OBJECT=Object.freeze({});var MersenneTwister=function(e){null==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,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};MersenneTwister.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++)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},MersenneTwister.prototype.init_by_array=function(e,t){var i,n,r;for(this.init_seed(19650218),i=1,n=0,r=this.N>t?this.N:t;r;r--){var a=this.mt[i-1]^this.mt[i-1]>>>30;this.mt[i]=(this.mt[i]^(1664525*((4294901760&a)>>>16)<<16)+1664525*(65535&a))+e[n]+n,this.mt[i]>>>=0,n++,++i>=this.N&&(this.mt[0]=this.mt[this.N-1],i=1),t<=n&&(n=0)}for(r=this.N-1;r;r--)a=this.mt[i-1]^this.mt[i-1]>>>30,this.mt[i]=(this.mt[i]^(1566083941*((4294901760&a)>>>16)<<16)+1566083941*(65535&a))-i,this.mt[i]>>>=0,++i>=this.N&&(this.mt[0]=this.mt[this.N-1],i=1);this.mt[0]=2147483648},MersenneTwister.prototype.random_int=function(){var e,t,i=new Array(0,this.MATRIX_A);if(this.mti>=this.N){for(this.mti==this.N+1&&this.init_seed(5489),t=0;t<this.N-this.M;t++)e=this.mt[t]&this.UPPER_MASK|this.mt[t+1]&this.LOWER_MASK,this.mt[t]=this.mt[t+this.M]^e>>>1^i[1&e];for(;t<this.N-1;t++)e=this.mt[t]&this.UPPER_MASK|this.mt[t+1]&this.LOWER_MASK,this.mt[t]=this.mt[t+(this.M-this.N)]^e>>>1^i[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^i[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,((e^=e<<15&4022730752)^e>>>18)>>>0},MersenneTwister.prototype.random_int31=function(){return this.random_int()>>>1},MersenneTwister.prototyp
|
||
|
(${this[1]}, ${this[4]}, ${this[7]})
|
||
|
(${this[2]}, ${this[5]}, ${this[8]})`},Cartesian4.fromElements=function(e,t,i,n,r){return defined(r)?(r.x=e,r.y=t,r.z=i,r.w=n,r):new Cartesian4(e,t,i,n)},Cartesian4.fromColor=function(e,t){return defined(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new Cartesian4(e.red,e.green,e.blue,e.alpha)},Cartesian4.clone=function(e,t){if(defined(e))return defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new Cartesian4(e.x,e.y,e.z,e.w)},Cartesian4.packedLength=4,Cartesian4.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.z,t[i]=e.w,t},Cartesian4.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Cartesian4:i).x=e[t++],i.y=e[t++],i.z=e[t++],i.w=e[t],i},Cartesian4.packArray=function(t,i){var n=t.length,e=4*n;defined(i)?!Array.isArray(i)&&i.length!==e||i.length===e||(i.length=e):i=new Array(e);for(let e=0;e<n;++e)Cartesian4.pack(t[e],i,4*e);return i},Cartesian4.unpackArray=function(t,i){const n=t.length;defined(i)?i.length=n/4:i=new Array(n/4);for(let e=0;e<n;e+=4){const n=e/4;i[n]=Cartesian4.unpack(t,e,i[n])}return i},Cartesian4.fromArray=Cartesian4.unpack,Cartesian4.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},Cartesian4.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},Cartesian4.minimumByComponent=function(e,t,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i.w=Math.min(e.w,t.w),i},Cartesian4.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i.w=Math.max(e.w,t.w),i},Cartesian4.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},Cartesian4.magnitude=function(e){return Math.sqrt(Cartesian4.magnitudeSquared(e))};const distanceScratch$2=new Cartesian4;Cartesian4.distance=function(e,t){return Cartesian4.subtract(e,t,distanceScratch$2),Cartesian4.magnitude(distanceScratch$2)},Cartesian4.distanceSquared=function(e,t){return Cartesian4.subtract(e,t,distanceScratch$2),Cartesian4.magnitudeSquared(distanceScratch$2)},Cartesian4.normalize=function(e,t){var i=Cartesian4.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,t.w=e.w/i,t},Cartesian4.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},Cartesian4.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i.w=e.w*t.w,i},Cartesian4.divideComponents=function(e,t,i){return i.x=e.x/t.x,i.y=e.y/t.y,i.z=e.z/t.z,i.w=e.w/t.w,i},Cartesian4.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},Cartesian4.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},Cartesian4.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},Cartesian4.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},Cartesian4.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},Cartesian4.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};const lerpScratch$2=new Cartesian4;Cartesian4.lerp=function(e,t,i,n){return Cartesian4.multiplyByScalar(t,i,lerpScratch$2),n=Cartesian4.multiplyByScalar(e,1-i,n),Cartesian4.add(lerpScratch$2,n,n)};const mostOrthogonalAxisScratch$1=new Cartesian4;Cartesian4.mostOrthogonalAxis=function(e,t){e=Cartesian4.normalize(e,mostOrthogonalAxisScratch$1);return Cartesian4.abs(e,e),e.x<=e.y?e.x<=e.z?e.x<=e.w?Cartesian4.clone(Cartesian4.UNIT_X,t):Cartesian4.clone(Cartesian4.UNIT_W,t):e.z<=e.w?Cartesian4.clone(Cartesian4.UNIT_Z,t):Cartesian4.clone(Cartesian4.UNIT_W,t):e.y<=e.z?e.y<=e.w?Cartesian4.clone(Cartesian4.UNIT_Y,t):Cartesian4.clone(Cartesian4.UNIT_W,t):e.z<=e.w?Cartesian4.clone(Cartesian4.UNIT_Z,t):Cartesian4.clone(Cartesian4.UNIT_W,t)},Cartesian4.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},Cartesian4.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]&&e.w===t[i+3]},Cartesian4.equalsEpsilon=function(e,t,i,n){return e===t||defined(e)&&defined(t)&&CesiumMath.equalsEpsilon(e.x,t.x,i,n)&&CesiumMath.equalsEpsilon(e.y,t.y,i,n)&&CesiumMath.equalsEpsi
|
||
|
`+this.stack.toString()),e},Matrix4.packedLength=16,Matrix4.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t[i++]=e[4],t[i++]=e[5],t[i++]=e[6],t[i++]=e[7],t[i++]=e[8],t[i++]=e[9],t[i++]=e[10],t[i++]=e[11],t[i++]=e[12],t[i++]=e[13],t[i++]=e[14],t[i]=e[15],t},Matrix4.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Matrix4:i)[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},Matrix4.packArray=function(t,i){var n=t.length,e=16*n;defined(i)?!Array.isArray(i)&&i.length!==e||i.length===e||(i.length=e):i=new Array(e);for(let e=0;e<n;++e)Matrix4.pack(t[e],i,16*e);return i},Matrix4.unpackArray=function(t,i){const n=t.length;defined(i)?i.length=n/16:i=new Array(n/16);for(let e=0;e<n;e+=16){const n=e/16;i[n]=Matrix4.unpack(t,e,i[n])}return i},Matrix4.clone=function(e,t){if(defined(e))return defined(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[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new Matrix4(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},Matrix4.fromArray=Matrix4.unpack,Matrix4.fromColumnMajorArray=function(e,t){return Matrix4.clone(e,t)},Matrix4.fromRowMajorArray=function(e,t){return defined(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new Matrix4(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},Matrix4.fromRotationTranslation=function(e,t,i){return t=defaultValue(t,Cartesian3.ZERO),defined(i)?(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=0,i[4]=e[3],i[5]=e[4],i[6]=e[5],i[7]=0,i[8]=e[6],i[9]=e[7],i[10]=e[8],i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i):new Matrix4(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)},Matrix4.fromTranslationQuaternionRotationScale=function(e,t,i,n){defined(n)||(n=new Matrix4);var r=i.x,a=i.y,o=i.z,s=t.x*t.x,l=t.x*t.y,c=t.x*t.z,u=t.x*t.w,d=t.y*t.y,h=t.y*t.z,p=t.y*t.w,f=t.z*t.z,m=t.z*t.w,g=t.w*t.w,_=2*(l-m),i=2*(c+p),t=2*(l+m),l=d-s-f+g,m=2*(h-u),p=2*(c-p),h=2*(h+u),u=-s-d+f+g;return n[0]=(s-d-f+g)*r,n[1]=t*r,n[2]=p*r,n[3]=0,n[4]=_*a,n[5]=l*a,n[6]=h*a,n[7]=0,n[8]=i*o,n[9]=m*o,n[10]=u*o,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},Matrix4.fromTranslationRotationScale=function(e,t){return Matrix4.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},Matrix4.fromTranslation=function(e,t){return Matrix4.fromRotationTranslation(Matrix3.IDENTITY,e,t)},Matrix4.fromScale=function(e,t){return defined(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Matrix4(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},Matrix4.fromUniformScale=function(e,t){return defined(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Matrix4(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)},Matrix4.fromRotation=function(e,t){return(t=!defined(t)?new Matrix4:t)[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};const fromCameraF=new Cartesian3,fromCameraR=new Cartesian3,fromCameraU=new Cartesian3;Matrix4.fromCamera=function(e,t){var i=e.position,n=e.direction,r=e.up;Cartesian3.normalize(n,fromCameraF),Cartesian3.normalize(Cartesian3.cross(fromCameraF,r,fromCameraR),fromCameraR),Cartesian3.normalize(Cartesian3.cross(fromCameraR,fromCameraF,fromCameraU),fromCameraU);var a=fromCameraR.x,o=fromCameraR.y,s=fromCameraR.z,l=fromCameraF.x,c=fromCameraF.y,u=fromCameraF.z,d=fromCameraU.x,h=fromCameraU.y,p=fromCameraU.z,f=i.x,e=i.y,n=i.z,r=a*-f+o*-e+s*-n,i=d*-f+h*-e+p*-n,n=l*f+c*e+u*n;return defined(t)?(t[0]=a,t[1]=d,t[2]=-l,t[3]=0,t[4]=o,t[5]=h,t[6]=-c,t[7]=0,t[8]=s,t[
|
||
|
(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
|
||
|
(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
|
||
|
(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`},Object.defineProperties(Rectangle.prototype,{width:{get:function(){return Rectangle.computeWidth(this)}},height:{get:function(){return Rectangle.computeHeight(this)}}}),Rectangle.packedLength=4,Rectangle.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.west,t[i++]=e.south,t[i++]=e.east,t[i]=e.north,t},Rectangle.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Rectangle:i).west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},Rectangle.computeWidth=function(e){let t=e.east;e=e.west;return t<e&&(t+=CesiumMath.TWO_PI),t-e},Rectangle.computeHeight=function(e){return e.north-e.south},Rectangle.fromDegrees=function(e,t,i,n,r){return e=CesiumMath.toRadians(defaultValue(e,0)),t=CesiumMath.toRadians(defaultValue(t,0)),i=CesiumMath.toRadians(defaultValue(i,0)),n=CesiumMath.toRadians(defaultValue(n,0)),defined(r)?(r.west=e,r.south=t,r.east=i,r.north=n,r):new Rectangle(e,t,i,n)},Rectangle.fromRadians=function(e,t,i,n,r){return defined(r)?(r.west=defaultValue(e,0),r.south=defaultValue(t,0),r.east=defaultValue(i,0),r.north=defaultValue(n,0),r):new Rectangle(e,t,i,n)},Rectangle.fromCartographicArray=function(i,e){let n=Number.MAX_VALUE,r=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,l=-Number.MAX_VALUE;for(let e=0,t=i.length;e<t;e++){var c=i[e];n=Math.min(n,c.longitude),r=Math.max(r,c.longitude),s=Math.min(s,c.latitude),l=Math.max(l,c.latitude);c=0<=c.longitude?c.longitude:c.longitude+CesiumMath.TWO_PI;a=Math.min(a,c),o=Math.max(o,c)}return r-n>o-a&&(n=a,r=o,r>CesiumMath.PI&&(r-=CesiumMath.TWO_PI),n>CesiumMath.PI&&(n-=CesiumMath.TWO_PI)),defined(e)?(e.west=n,e.south=s,e.east=r,e.north=l,e):new Rectangle(n,s,r,l)},Rectangle.fromCartesianArray=function(i,n,e){n=defaultValue(n,Ellipsoid.WGS84);let r=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,l=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let e=0,t=i.length;e<t;e++){var u=n.cartesianToCartographic(i[e]);r=Math.min(r,u.longitude),a=Math.max(a,u.longitude),l=Math.min(l,u.latitude),c=Math.max(c,u.latitude);u=0<=u.longitude?u.longitude:u.longitude+CesiumMath.TWO_PI;o=Math.min(o,u),s=Math.max(s,u)}return a-r>s-o&&(r=o,a=s,a>CesiumMath.PI&&(a-=CesiumMath.TWO_PI),r>CesiumMath.PI&&(r-=CesiumMath.TWO_PI)),defined(e)?(e.west=r,e.south=l,e.east=a,e.north=c,e):new Rectangle(r,l,a,c)},Rectangle.clone=function(e,t){if(defined(e))return defined(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Rectangle(e.west,e.south,e.east,e.north)},Rectangle.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e.west-t.west)<=i&&Math.abs(e.south-t.south)<=i&&Math.abs(e.east-t.east)<=i&&Math.abs(e.north-t.north)<=i},Rectangle.prototype.clone=function(e){return Rectangle.clone(this,e)},Rectangle.prototype.equals=function(e){return Rectangle.equals(this,e)},Rectangle.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},Rectangle.prototype.equalsEpsilon=function(e,t){return Rectangle.equalsEpsilon(this,e,t)},Rectangle.validate=function(e){},Rectangle.southwest=function(e,t){return defined(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Cartographic(e.west,e.south)},Rectangle.northwest=function(e,t){return defined(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Cartographic(e.west,e.north)},Rectangle.northeast=function(e,t){return defined(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Cartographic(e.east,e.north)},Rectangle.southeast=function(e,t){return defined(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Cartographic(e.east,e.south)},Rectangle.center=function(e,t){let i=e.east;var n=e.west;i<n&&(i+=CesiumMath.TWO_PI);n=CesiumMath.negativePiToPi(.5*(n+i)),e=.5*(e.south+e.north);return defined(t)?(t.longitude=n,t.latitude=e,t.height=0,t):new Cartographic(n,e)},Rectangle.intersection=function(e,t,i){let n=e.east,r=e.west,a=t.east,o=t.west;n<r&&0<a?n+=CesiumMath.TWO_PI:a<o&&0<n&&(a+=CesiumMat
|
||
|
(${this[1]}, ${this[3]})`};const AttributeType$1={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",getMathType:function(e){switch(e){case AttributeType$1.SCALAR:return Number;case AttributeType$1.VEC2:return Cartesian2;case AttributeType$1.VEC3:return Cartesian3;case AttributeType$1.VEC4:return Cartesian4;case AttributeType$1.MAT2:return Matrix2;case AttributeType$1.MAT3:return Matrix3;case AttributeType$1.MAT4:return Matrix4}},getNumberOfComponents:function(e){switch(e){case AttributeType$1.SCALAR:return 1;case AttributeType$1.VEC2:return 2;case AttributeType$1.VEC3:return 3;case AttributeType$1.VEC4:case AttributeType$1.MAT2:return 4;case AttributeType$1.MAT3:return 9;case AttributeType$1.MAT4:return 16}},getGlslType:function(e){switch(e){case AttributeType$1.SCALAR:return"float";case AttributeType$1.VEC2:return"vec2";case AttributeType$1.VEC3:return"vec3";case AttributeType$1.VEC4:return"vec4";case AttributeType$1.MAT2:return"mat2";case AttributeType$1.MAT3:return"mat3";case AttributeType$1.MAT4:return"mat4"}}};var AttributeType$2=Object.freeze(AttributeType$1);const RIGHT_SHIFT=1/256,LEFT_SHIFT=256,AttributeCompression={octEncodeInRange:function(e,t,i){if(i.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),i.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){const e=i.x,t=i.y;i.x=(1-Math.abs(t))*CesiumMath.signNotZero(e),i.y=(1-Math.abs(e))*CesiumMath.signNotZero(t)}return i.x=CesiumMath.toSNorm(i.x,t),i.y=CesiumMath.toSNorm(i.y,t),i},octEncode:function(e,t){return AttributeCompression.octEncodeInRange(e,255,t)}},octEncodeScratch=new Cartesian2,uint8ForceArray=new Uint8Array(1);function forceUint8(e){return uint8ForceArray[0]=e,uint8ForceArray[0]}AttributeCompression.octEncodeToCartesian4=function(e,t){return AttributeCompression.octEncodeInRange(e,65535,octEncodeScratch),t.x=forceUint8(octEncodeScratch.x*RIGHT_SHIFT),t.y=forceUint8(octEncodeScratch.x),t.z=forceUint8(octEncodeScratch.y*RIGHT_SHIFT),t.w=forceUint8(octEncodeScratch.y),t},AttributeCompression.octDecodeInRange=function(e,t,i,n){if(n.x=CesiumMath.fromSNorm(e,i),n.y=CesiumMath.fromSNorm(t,i),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){const e=n.x;n.x=(1-Math.abs(n.y))*CesiumMath.signNotZero(e),n.y=(1-Math.abs(e))*CesiumMath.signNotZero(n.y)}return Cartesian3.normalize(n,n)},AttributeCompression.octDecode=function(e,t,i){return AttributeCompression.octDecodeInRange(e,t,255,i)},AttributeCompression.octDecodeFromCartesian4=function(e,t){var i=e.x,n=e.y,r=e.z,e=e.w,n=i*LEFT_SHIFT+n,e=r*LEFT_SHIFT+e;return AttributeCompression.octDecodeInRange(n,e,65535,t)},AttributeCompression.octPackFloat=function(e){return 256*e.x+e.y};const scratchEncodeCart2=new Cartesian2;function zigZagDecode(e){return e>>1^-(1&e)}AttributeCompression.octEncodeFloat=function(e){return AttributeCompression.octEncode(e,scratchEncodeCart2),AttributeCompression.octPackFloat(scratchEncodeCart2)},AttributeCompression.octDecodeFloat=function(e,t){var i=e/256,e=Math.floor(i),i=256*(i-e);return AttributeCompression.octDecode(e,i,t)},AttributeCompression.octPack=function(e,t,i,n){e=AttributeCompression.octEncodeFloat(e),t=AttributeCompression.octEncodeFloat(t),i=AttributeCompression.octEncode(i,scratchEncodeCart2);return n.x=65536*i.x+e,n.y=65536*i.y+t,n},AttributeCompression.octUnpack=function(e,t,i,n){var r=e.x/65536,a=Math.floor(r),o=65536*(r-a),r=e.y/65536,e=Math.floor(r),r=65536*(r-e);AttributeCompression.octDecodeFloat(o,t),AttributeCompression.octDecodeFloat(r,i),AttributeCompression.octDecode(a,e,n)},AttributeCompression.compressTextureCoordinates=function(e){return 4096*(4095*e.x|0)+(4095*e.y|0)},AttributeCompression.decompressTextureCoordinates=function(e,t){var i=Math.floor(e/4096);return t.x=i/4095,t.y=(e-4096*i)/4095,t},AttributeCompression.zigZagDeltaDecode=function(t,i,n){var r=t.length;let a=0,o=0,s=0;for(let e=0;e<r;++e)a+=zigZagDecode(t[e]),o+=zigZagDecode(i[e]),t[e]=a,i[e]=o,defined(n)&&(s+=zigZagDecode(n[e]),n[e]=s)},AttributeCompression.dequantize=function(i,e,t,n){var r=AttributeType$2.getNumberOfComponents(t);let a;switch(e){case
|
||
|
`+e),t}function TileProviderError(e,t,i,n,r,a,o){this.provider=e,this.message=t,this.x=i,this.y=n,this.level=r,this.timesRetried=defaultValue(a,0),this.retry=!1,this.error=o}function WebMercatorTilingScheme(e){if(e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.WGS84),this._numberOfLevelZeroTilesX=defaultValue(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=defaultValue(e.numberOfLevelZeroTilesY,1),this._projection=new WebMercatorProjection(this._ellipsoid),defined(e.rectangleSouthwestInMeters)&&defined(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{const i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new Cartesian2(-i,-i),this._rectangleNortheastInMeters=new Cartesian2(i,i)}var t=this._projection.unproject(this._rectangleSouthwestInMeters),e=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new Rectangle(t.longitude,t.latitude,e.longitude,e.latitude)}TileAvailability.prototype.isTileAvailable=function(e,t,i){i=this._tilingScheme.tileXYToRectangle(t,i,e,rectangleScratch$6);return Rectangle.center(i,cartographicScratch$4),this.computeMaximumLevelAtPosition(cartographicScratch$4)>=e},TileAvailability.prototype.computeChildMaskForTile=function(e,t,i){var n=e+1;if(n>=this._maximumLevel)return 0;e=0;return e|=this.isTileAvailable(n,2*t,2*i+1)?1:0,e|=this.isTileAvailable(n,2*t+1,2*i+1)?2:0,e|=this.isTileAvailable(n,2*t,2*i)?4:0,e|=this.isTileAvailable(n,2*t+1,2*i)?8:0},Object.defineProperties(QuadtreeNode.prototype,{nw:{get:function(){return this._nw||(this._nw=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x,2*this.y)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x,2*this.y+1)),this._sw}},se:{get:function(){return this._se||(this._se=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y+1)),this._se}}}),TileProviderError.handleError=function(e,t,i,n,r,a,o,s,l){let c=e;return defined(e)?(c.provider=t,c.message=n,c.x=r,c.y=a,c.level=o,c.retry=!1,c.error=l,++c.timesRetried):c=new TileProviderError(t,n,r,a,o,0,l),0<i.numberOfListeners?i.raiseEvent(c):console.log(`An error occurred in "${t.constructor.name}": `+formatError(n)),c.retry&&defined(s)&&s(),c},TileProviderError.handleSuccess=function(e){defined(e)&&(e.timesRetried=-1)},Object.defineProperties(WebMercatorTilingScheme.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),WebMercatorTilingScheme.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},WebMercatorTilingScheme.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},WebMercatorTilingScheme.prototype.rectangleToNativeRectangle=function(e,t){const i=this._projection,n=i.project(Rectangle.southwest(e)),r=i.project(Rectangle.northeast(e));return defined(t)?(t.west=n.x,t.south=n.y,t.east=r.x,t.north=r.y,t):new Rectangle(n.x,n.y,r.x,r.y)},WebMercatorTilingScheme.prototype.tileXYToNativeRectangle=function(e,t,i,n){var r=this.getNumberOfXTilesAtLevel(i),a=this.getNumberOfYTilesAtLevel(i),i=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/r,r=this._rectangleSouthwestInMeters.x+e*i,e=this._rectangleSouthwestInMeters.x+(e+1)*i,i=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/a,a=this._rectangleNortheastInMeters.y-t*i,i=this._rectangleNortheastInMeters.y-(t+1)*i;return defined(n)?(n.west=r,n.south=i,n.east=e,n.north=a,n):new Rectangle(r,i,e,a)},WebMercatorTilingScheme.prototype.tileXYToRectangle=function(e,t,i,n){const r=this.tileXYToNativeRectangle(e,t,i,n),a=this._projection,o=a.unproject(new Cartesian2(r.west,r.south)),s=a.unproject(new Cartesian2
|
||
|
`+e):console.error(consolePrefix+"Fragment shader translation failed.")}throw e.deleteProgram(o),new RuntimeError("Fragment shader failed to compile. Compile log: "+l)}if(e.getShaderParameter(r,e.COMPILE_STATUS))throw l=e.getProgramInfoLog(o),console.error(consolePrefix+"Shader program link log: "+l),defined(i)&&(console.error(consolePrefix+`Translated vertex shader source:
|
||
|
`+i.getTranslatedShaderSource(r)),console.error(consolePrefix+`Translated fragment shader source:
|
||
|
`+i.getTranslatedShaderSource(a))),e.deleteProgram(o),new RuntimeError("Program failed to link. Link log: "+l);if(l=e.getShaderInfoLog(r),console.error(consolePrefix+"Vertex shader compile log: "+l),defined(i)){const e=i.getTranslatedShaderSource(r);""!==e?console.error(consolePrefix+`Translated vertex shader source:
|
||
|
`+e):console.error(consolePrefix+"Vertex shader translation failed.")}throw e.deleteProgram(o),new RuntimeError("Vertex shader failed to compile. Compile log: "+l)}t=t._logShaderCompilation;return t&&(l=e.getShaderInfoLog(r),defined(l)&&0<l.length&&console.log(consolePrefix+"Vertex shader compile log: "+l)),t&&(l=e.getShaderInfoLog(a),defined(l)&&0<l.length&&console.log(consolePrefix+"Fragment shader compile log: "+l)),t&&(l=e.getProgramInfoLog(o),defined(l)&&0<l.length&&console.log(consolePrefix+"Shader program link log: "+l)),o}function findVertexAttributes(t,i,n){const r={};for(let e=0;e<n;++e){const n=t.getActiveAttrib(i,e),a=t.getAttribLocation(i,n.name);r[n.name]={name:n.name,type:n.type,index:a}}return r}function findUniforms(r,a){const o={},s=[],l=[],c=r.getProgramParameter(a,r.ACTIVE_UNIFORMS);for(let e=0;e<c;++e){const c=r.getActiveUniform(a,e),d=-1!==c.name.indexOf("[0]",c.name.length-"[0]".length)?c.name.slice(0,c.name.length-3):c.name;if(0!==d.indexOf("gl_"))if(c.name.indexOf("[")<0){var u=r.getUniformLocation(a,d);if(null!==u){const a=createUniform(r,c,d,u);o[d]=a,s.push(a),a._setSampler&&l.push(a)}}else{let e,t,i,n;u=d.indexOf("[");if(0<=u)e=o[d.slice(0,u)],defined(e)&&(t=e._locations,t.length<=1&&(i=e.value,n=r.getUniformLocation(a,d),null!==n&&(t.push(n),i.push(r.getUniform(a,n)))));else{t=[];for(let e=0;e<c.size;++e)n=r.getUniformLocation(a,`${d}[${e}]`),null!==n&&t.push(n);e=createUniformArray(r,c,d,t),o[d]=e,s.push(e),e._setSampler&&l.push(e)}}}return{uniformsByName:o,uniforms:s,samplerUniforms:l}}function partitionUniforms(t,i){const n=[],r=[];for(const o in i)if(i.hasOwnProperty(o)){const s=i[o];let e=o;var a=t._duplicateUniformNames[e];defined(a)&&(s.name=a,e=a);a=AutomaticUniforms[e];defined(a)?n.push({uniform:s,automaticUniform:a}):r.push(s)}return{automaticUniforms:n,manualUniforms:r}}function setSamplerUniforms(e,t,i){e.useProgram(t);let n=0;var r=i.length;for(let e=0;e<r;++e)n=i[e]._setSampler(n);return e.useProgram(null),n}function initialize$d(e){defined(e._program)||reinitialize(e)}function reinitialize(s){const e=s._program,t=s._gl,i=createAndLinkProgram(t,s,s._debugShaders),n=t.getProgramParameter(i,t.ACTIVE_ATTRIBUTES),r=findUniforms(t,i),a=partitionUniforms(s,r.uniformsByName);s._program=i,s._numberOfVertexAttributes=n,s._vertexAttributes=findVertexAttributes(t,i,n),s._uniformsByName=r.uniformsByName,s._uniforms=r.uniforms,s._automaticUniforms=a.automaticUniforms,s._manualUniforms=a.manualUniforms,s.maximumTextureUnitIndex=setSamplerUniforms(t,i,r.samplerUniforms),e&&s._gl.deleteProgram(e),"undefined"!=typeof spector&&(s._program.__SPECTOR_rebuildProgram=function(e,t,i,n){var r=s._vertexShaderText,a=s._fragmentShaderText,o=/ ! = /g;s._vertexShaderText=e.replace(o," != "),s._fragmentShaderText=t.replace(o," != ");try{reinitialize(s),i(s._program)}catch(e){s._vertexShaderText=r,s._fragmentShaderText=a;const t=/(?:Compile|Link) error: ([^]*)/.exec(e.message);n(t?t[1]:e.message)}})}function modernizeShader(e,i){const t=/#define OUTPUT_DECLARATION/,n=e.split("\n");if(/#version 300 es/g.test(e))return e;let r,a,o=-1;for(r=0;r<n.length;++r)if(a=n[r],t.test(a)){o=r;break}if(-1===o)throw new DeveloperError("Could not find a #define OUTPUT_DECLARATION!");var s=[];for(r=0;r<10;r++){const i=`gl_FragData\\[${r}\\]`,t="czm_out"+r;new RegExp(i,"g").test(e)&&(setAdd(t,s),replaceInSourceString(i,t,n),n.splice(o,0,`layout(location = ${r}) out vec4 ${t};`),o+=1)}var l="czm_fragColor";findInSource("gl_FragColor",n)&&(setAdd(l,s),replaceInSourceString("gl_FragColor",l,n),n.splice(o,0,"layout(location = 0) out vec4 czm_fragColor;"),o+=1);const c=getVariablePreprocessorBranch(s,n),u={};for(r=0;r<n.length;r++){a=n[r];for(const e in c)c.hasOwnProperty(e)&&new RegExp(`(layout)[^]+(out)[^]+(${e})[^]+`,"g").test(a)&&(u[a]=e)}for(const e in u)if(u.hasOwnProperty(e)){const i=u[e];let t=n.indexOf(e);const r=c[i],a=r.length;for(let e=0;e<a;e++)n.splice(t,0,r[e]);t+=a+1;for(let e=a-1;0<=e;e--)n.splice(t,0,"#endif //"+r[e])}var l="WEBGL_2",d="#version 300 es";let h=!1;for(r=0;r<n.length;r++)if(/#version/.test(n[r])){n
|
||
|
`;return i}function setAdd(e,t){-1===t.indexOf(e)&&t.push(e)}function getVariablePreprocessorBranch(t,i){const n={},r=t.length,a=[];for(let e=0;e<i.length;++e){const o=i[e],s=/(#ifdef|#if)/g.test(o),l=/#else/g.test(o),c=/#endif/g.test(o);if(s)a.push(o);else if(l){let e=a[a.length-1].replace("ifdef","ifndef");/if/g.test(e)&&(e=e.replace(/(#if\s+)(\S*)([^]*)/,"$1!($2)$3")),a.pop(),a.push(e)}else if(c)a.pop();else if(!/layout/g.test(o))for(let e=0;e<r;++e){const r=t[e];-1!==o.indexOf(r)&&(defined(n[r])?n[r]=n[r].filter(function(e){return 0<=a.indexOf(e)}):n[r]=a.slice())}}return n}function removeExtension(e,t,i){replaceInSourceRegex(new RegExp(`#extension\\s+GL_${e}\\s+:\\s+[a-zA-Z0-9]+\\s*$`,"g"),"",i),replaceInSourceString("GL_"+e,t,i)}ShaderProgram.prototype._bind=function(){initialize$d(this),this._gl.useProgram(this._program)},ShaderProgram.prototype._setUniforms=function(e,t,i){let n,r;if(defined(e)){const t=this._manualUniforms;for(n=t.length,r=0;r<n;++r){const i=t[r];i.value=e[i.name]()}}var a=this._automaticUniforms;for(n=a.length,r=0;r<n;++r){const e=a[r];e.uniform.value=e.automaticUniform.getValue(t)}const o=this._uniforms;for(n=o.length,r=0;r<n;++r)o[r].set();if(i){const e=this._gl,t=this._program;e.validateProgram(t)}},ShaderProgram.prototype.isDestroyed=function(){return!1},ShaderProgram.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},ShaderProgram.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),destroyObject(this)};var czm_degreesPerRadian="const float czm_degreesPerRadian = 57.29577951308232;\n",czm_depthRange="const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\n",czm_epsilon1="const float czm_epsilon1 = 0.1;\n",czm_epsilon2="const float czm_epsilon2 = 0.01;\n",czm_epsilon3="const float czm_epsilon3 = 0.001;\n",czm_epsilon4="const float czm_epsilon4 = 0.0001;\n",czm_epsilon5="const float czm_epsilon5 = 0.00001;\n",czm_epsilon6="const float czm_epsilon6 = 0.000001;\n",czm_epsilon7="const float czm_epsilon7 = 0.0000001;\n",czm_infinity="const float czm_infinity = 5906376272000.0;\n",czm_oneOverPi="const float czm_oneOverPi = 0.3183098861837907;\n",czm_oneOverTwoPi="const float czm_oneOverTwoPi = 0.15915494309189535;\n",czm_passCesium3DTile="const float czm_passCesium3DTile = 4.0;\n",czm_passCesium3DTileClassification="const float czm_passCesium3DTileClassification = 5.0;\n",czm_passCesium3DTileClassificationIgnoreShow="const float czm_passCesium3DTileClassificationIgnoreShow = 6.0;\n",czm_passClassification="const float czm_passClassification = 7.0;\n",czm_passCompute="const float czm_passCompute = 1.0;\n",czm_passEnvironment="const float czm_passEnvironment = 0.0;\n",czm_passGlobe="const float czm_passGlobe = 2.0;\n",czm_passOpaque="const float czm_passOpaque = 7.0;\n",czm_passOverlay="const float czm_passOverlay = 9.0;\n",czm_passTerrainClassification="const float czm_passTerrainClassification = 3.0;\n",czm_passTranslucent="const float czm_passTranslucent = 8.0;\n",czm_pi="const float czm_pi = 3.141592653589793;\n",czm_piOverFour="const float czm_piOverFour = 0.7853981633974483;\n",czm_piOverSix="const float czm_piOverSix = 0.5235987755982988;\n",czm_piOverThree="const float czm_piOverThree = 1.0471975511965976;\n",czm_piOverTwo="const float czm_piOverTwo = 1.5707963267948966;\n",czm_radiansPerDegree="const float czm_radiansPerDegree = 0.017453292519943295;\n",czm_sceneMode2D="const float czm_sceneMode2D = 2.0;\n",czm_sceneMode3D="const float czm_sceneMode3D = 3.0;\n",czm_sceneModeColumbusView="const float czm_sceneModeColumbusView = 1.0;\n",czm_sceneModeMorphing="const float czm_sceneModeMorphing = 0.0;\n",czm_solarRadius="const float czm_solarRadius = 695500000.0;\n",czm_threePiOver2="const float czm_threePiOver2 = 4.71238898038469;\n",czm_twoPi="const float czm_twoPi = 6.283185307179586;\n",czm_webMercatorMaxLatitude="const float czm_webMercatorMaxLatitude = 1.4844222297453324;\n",czm_depthRangeStruct="struct czm_depthRangeStruct\n{\nfloat near;\nfloat far;\n};\n",czm_material="struct czm_material\n{\nvec3 diffuse;\
|
||
|
`;return i.replace(e.glslSource,"")}function combineShader(e,t,i){let n,r,a="";var o=e.sources;if(defined(o))for(n=0,r=o.length;n<r;++n)a+=`
|
||
|
#line 0
|
||
|
`+o[n];let s;a=removeComments(a),a=a.replace(/#version\s+(.*?)\n/gm,function(e,t){return s=t,"\n"});const l=[];a=a.replace(/#extension.*\n/gm,function(e){return l.push(e),"\n"}),a=a.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");var c=e.pickColorQualifier;defined(c)&&(a=ShaderSource.createPickFragmentShaderSource(a,c));let u="";defined(s)&&(u=`#version ${s}
|
||
|
`);var d=l.length;for(n=0;n<d;n++)u+=l[n];t&&(u+="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n #define highp mediump\n#endif\n\n");var h=e.defines;if(defined(h))for(n=0,r=h.length;n<r;++n){const e=h[n];0!==e.length&&(u+=`#define ${e}
|
||
|
`)}return i.webgl2&&(u+="#define OUTPUT_DECLARATION\n\n"),i.textureFloatLinear&&(u+="#define OES_texture_float_linear\n\n"),i.floatingPointTexture&&(u+="#define OES_texture_float\n\n"),e.includeBuiltIns&&(u+=getBuiltinsAndAutomaticUniforms(a)),u+="\n#line 0\n",u+=a,i.webgl2&&(u=modernizeShader(u,t)),u}function ShaderSource(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).pickColorQualifier;this.defines=defined(e.defines)?e.defines.slice(0):[],this.sources=defined(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=defaultValue(e.includeBuiltIns,!0)}ShaderSource.prototype.clone=function(){return new ShaderSource({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})},ShaderSource.replaceMain=function(e,t){return e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t=`void ${t}()`)},ShaderSource.prototype.createCombinedVertexShader=function(e){return combineShader(this,!1,e)},ShaderSource.prototype.createCombinedFragmentShader=function(e){return combineShader(this,!0,e)},ShaderSource._czmBuiltinsAndUniforms={};for(const e in CzmBuiltins)CzmBuiltins.hasOwnProperty(e)&&(ShaderSource._czmBuiltinsAndUniforms[e]=CzmBuiltins[e]);for(const e in AutomaticUniforms)if(AutomaticUniforms.hasOwnProperty(e)){const t=AutomaticUniforms[e];"function"==typeof t.getDeclaration&&(ShaderSource._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}function containsString(e,t){const i=e.sources,n=i.length;for(let e=0;e<n;++e)if(-1!==i[e].indexOf(t))return 1}function findFirstString(t,i){const n=i.length;for(let e=0;e<n;++e){const n=i[e];if(containsString(t,n))return n}}ShaderSource.createPickVertexShaderSource=function(e){return ShaderSource.replaceMain(e,"czm_old_main")+`
|
||
|
attribute vec4 pickColor;
|
||
|
varying vec4 czm_pickColor;
|
||
|
void main()
|
||
|
{
|
||
|
czm_old_main();
|
||
|
czm_pickColor = pickColor;
|
||
|
}`},ShaderSource.createPickFragmentShaderSource=function(e,t){return ShaderSource.replaceMain(e,"czm_old_main")+`
|
||
|
`+t+` vec4 czm_pickColor;
|
||
|
void main()
|
||
|
{
|
||
|
czm_old_main();
|
||
|
if (gl_FragColor.a == 0.0) {
|
||
|
discard;
|
||
|
}
|
||
|
gl_FragColor = czm_pickColor;
|
||
|
}`};const normalVaryingNames=["v_normalEC","v_normal"];ShaderSource.findNormalVarying=function(e){return containsString(e,"#ifdef HAS_NORMALS")?containsString(e,"#define HAS_NORMALS")?"v_normalEC":void 0:findFirstString(e,normalVaryingNames)};const positionVaryingNames=["v_positionEC"];ShaderSource.findPositionVarying=function(e){return findFirstString(e,positionVaryingNames)};var ShadowVolumeAppearanceVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n#ifdef EXTRUDED_GEOMETRY\nattribute vec3 extrudeDirection;\nuniform float u_globeMinimumAltitude;\n#endif // EXTRUDED_GEOMETRY\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif // PER_INSTANCE_COLOR\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nvarying vec4 v_sphericalExtents;\n#else // SPHERICAL\nvarying vec2 v_inversePlaneExtents;\nvarying vec4 v_westPlane;\nvarying vec4 v_southPlane;\n#endif // SPHERICAL\nvarying vec3 v_uvMinAndSphericalLongitudeRotation;\nvarying vec3 v_uMaxAndInverseDistance;\nvarying vec3 v_vMaxAndInverseDistance;\n#endif // TEXTURE_COORDINATES\nvoid main()\n{\nvec4 position = czm_computePosition();\n#ifdef EXTRUDED_GEOMETRY\nfloat delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));\ndelta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;\nposition = position + vec4(extrudeDirection * delta, 0.0);\n#endif\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nv_sphericalExtents = czm_batchTable_sphericalExtents(batchId);\nv_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);\n#else // SPHERICAL\n#ifdef COLUMBUS_VIEW_2D\nvec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);\nvec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);\nvec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w));\nbool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;\nplanes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);\nplanes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);\nidlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;\nidlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));\nplanes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);\nplanes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);\nvec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;\nvec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz;\nvec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz;\n#else // COLUMBUS_VIEW_2D\nvec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;\nvec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;\nvec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;\n#endif // COLUMBUS_VIEW_2D\nvec3 eastWard = southEastCorner - southWestCorner;\nfloat eastExtent = length(eastWard);\neastWard /= eastExtent;\nvec3 northWard = northWestCorner - southWestCorner;\nfloat northExtent = length(northWard);\nnorthWard /= northExtent;\nv_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));\nv_southPlane = vec4(northWard, -dot(northWard, southWestCorner));\nv_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);\n#endif // SPHERICAL\nvec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);\nvec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);\nv_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);\nv_vMa
|
||
|
`+i.fragmentShaderSource;n.normalEC=-1!==e.indexOf("materialInput.normalEC")||-1!==e.indexOf("czm_getDefaultMaterial"),n.positionToEyeEC=-1!==e.indexOf("materialInput.positionToEyeEC"),n.tangentToEyeMatrix=-1!==e.indexOf("materialInput.tangentToEyeMatrix"),n.st=-1!==e.indexOf("materialInput.st")}this._colorShaderDependencies=n,this._pickShaderDependencies=r,this._appearance=i,this._extentsCulling=e,this._planarExtents=t}ShadowVolumeAppearance.prototype.createFragmentShader=function(e){const t=this._appearance,i=this._colorShaderDependencies,n=[];e||this._planarExtents||n.push("SPHERICAL"),i.requiresEC&&n.push("REQUIRES_EC"),i.requiresWC&&n.push("REQUIRES_WC"),i.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),i.requiresNormalEC&&n.push("NORMAL_EC"),t instanceof PerInstanceColorAppearance&&n.push("PER_INSTANCE_COLOR"),i.normalEC&&n.push("USES_NORMAL_EC"),i.positionToEyeEC&&n.push("USES_POSITION_TO_EYE_EC"),i.tangentToEyeMatrix&&n.push("USES_TANGENT_TO_EYE"),i.st&&n.push("USES_ST"),t.flat&&n.push("FLAT");let r="";return t instanceof PerInstanceColorAppearance||(r=t.material.shaderSource),new ShaderSource({defines:n,sources:[r,ShadowVolumeAppearanceFS]})},ShadowVolumeAppearance.prototype.createPickFragmentShader=function(e){const t=this._pickShaderDependencies,i=["PICK"];return e||this._planarExtents||i.push("SPHERICAL"),t.requiresEC&&i.push("REQUIRES_EC"),t.requiresWC&&i.push("REQUIRES_WC"),t.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),new ShaderSource({defines:i,sources:[ShadowVolumeAppearanceFS],pickColorQualifier:"varying"})},ShadowVolumeAppearance.prototype.createVertexShader=function(e,t,i,n){return createShadowVolumeAppearanceVS(this._colorShaderDependencies,this._planarExtents,i,e,t,this._appearance,n,this._projectionExtentDefines)},ShadowVolumeAppearance.prototype.createPickVertexShader=function(e,t,i,n){return createShadowVolumeAppearanceVS(this._pickShaderDependencies,this._planarExtents,i,e,t,void 0,n,this._projectionExtentDefines)};const longitudeExtentsCartesianScratch=new Cartesian3,longitudeExtentsCartographicScratch=new Cartographic,longitudeExtentsEncodeScratch={high:0,low:0};function createShadowVolumeAppearanceVS(t,i,e,n,r,a,o,s){const l=n.slice();if(""===s.eastMostYhighDefine){const t=longitudeExtentsCartographicScratch;t.longitude=CesiumMath.PI,t.latitude=0,t.height=0;const i=o.project(t,longitudeExtentsCartesianScratch);let e=EncodedCartesian3.encode(i.x,longitudeExtentsEncodeScratch);s.eastMostYhighDefine="EAST_MOST_X_HIGH "+e.high.toFixed((""+e.high).length+1),s.eastMostYlowDefine="EAST_MOST_X_LOW "+e.low.toFixed((""+e.low).length+1);const n=longitudeExtentsCartographicScratch;n.longitude=-CesiumMath.PI,n.latitude=0,n.height=0;const r=o.project(n,longitudeExtentsCartesianScratch);e=EncodedCartesian3.encode(r.x,longitudeExtentsEncodeScratch),s.westMostYhighDefine="WEST_MOST_X_HIGH "+e.high.toFixed((""+e.high).length+1),s.westMostYlowDefine="WEST_MOST_X_LOW "+e.low.toFixed((""+e.low).length+1)}return e&&(l.push(s.eastMostYhighDefine),l.push(s.eastMostYlowDefine),l.push(s.westMostYhighDefine),l.push(s.westMostYlowDefine)),defined(a)&&a instanceof PerInstanceColorAppearance&&l.push("PER_INSTANCE_COLOR"),t.requiresTextureCoordinates&&(l.push("TEXTURE_COORDINATES"),i||e||l.push("SPHERICAL"),e&&l.push("COLUMBUS_VIEW_2D")),new ShaderSource({defines:l,sources:[r]})}function ShaderDependencies(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}function pointLineDistance(e,t,i){return Math.abs((t.y-e.y)*i.x-(t.x-e.x)*i.y+t.x*e.y-t.y*e.x)/Cartesian2.distance(t,e)}Object.defineProperties(ShaderDependencies.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._req
|
||
|
{
|
||
|
extrudeDirection = czm_octDecode(compressedAttributes, 65535.0);
|
||
|
czm_non_compressed_main();
|
||
|
}`].join("\n")}}function createShaderProgram$2(t,i){const n=i.context,e=t._primitive;let r=ShadowVolumeAppearanceVS;r=t._primitive._batchTable.getVertexShaderCallback()(r),r=Primitive$3._appendDistanceDisplayConditionToShader(e,r),r=Primitive$3._modifyShaderPosition(t,r,i.scene3DOnly),r=Primitive$3._updateColorAttribute(e,r);const a=t._hasPlanarExtentsAttributes,o=a||t._hasSphericalExtentsAttribute;t._extruded&&(r=modifyForEncodedNormals(e,r));var s=t._extruded?"EXTRUDED_GEOMETRY":"";let l=new ShaderSource({defines:[s],sources:[r]});const c=new ShaderSource({sources:[ShadowVolumeFS]}),u=t._primitive._attributeLocations,d=new ShadowVolumeAppearance(o,a,t.appearance);if(t._spStencil=ShaderProgram.replaceCache({context:n,shaderProgram:t._spStencil,vertexShaderSource:l,fragmentShaderSource:c,attributeLocations:u}),t._primitive.allowPicking){var h=ShaderSource.createPickVertexShaderSource(r),h=Primitive$3._appendShowToShader(e,h);h=Primitive$3._updatePickColorAttribute(h);const l=d.createPickFragmentShader(!1),c=d.createPickVertexShader([s],h,!1,i.mapProjection);if(t._spPick=ShaderProgram.replaceCache({context:n,shaderProgram:t._spPick,vertexShaderSource:c,fragmentShaderSource:l,attributeLocations:u}),o){let e=n.shaderCache.getDerivedShaderProgram(t._spPick,"2dPick");if(!defined(e)){const r=d.createPickFragmentShader(!0),o=d.createPickVertexShader([s],h,!0,i.mapProjection);e=n.shaderCache.createDerivedShaderProgram(t._spPick,"2dPick",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:u})}t._spPick2D=e}}else t._spPick=ShaderProgram.fromCache({context:n,vertexShaderSource:l,fragmentShaderSource:c,attributeLocations:u});r=Primitive$3._appendShowToShader(e,r),l=new ShaderSource({defines:[s],sources:[r]}),t._sp=ShaderProgram.replaceCache({context:n,shaderProgram:t._sp,vertexShaderSource:l,fragmentShaderSource:c,attributeLocations:u});var p=d.createFragmentShader(!1),h=d.createVertexShader([s],r,!1,i.mapProjection);if(t._spColor=ShaderProgram.replaceCache({context:n,shaderProgram:t._spColor,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:u}),o){let e=n.shaderCache.getDerivedShaderProgram(t._spColor,"2dColor");if(!defined(e)){const a=d.createFragmentShader(!0),o=d.createVertexShader([s],r,!0,i.mapProjection);e=n.shaderCache.createDerivedShaderProgram(t._spColor,"2dColor",{vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:u})}t._spColor2D=e}}function createColorCommands$1(t,i){const n=t._primitive;let e,r,a,o=2*n._va.length;i.length=o;let s=0,l=n._batchTable.getUniformMapCallback()(t._uniformMap);var c=t._needs2DShader;for(e=0;e<o;e+=2){const o=n._va[s++];r=i[e],defined(r)||(r=i[e]=new DrawCommand({owner:t,primitiveType:n._primitiveType})),r.vertexArray=o,r.renderState=t._rsStencilDepthPass,r.shaderProgram=t._sp,r.uniformMap=l,r.pass=Pass$1.TERRAIN_CLASSIFICATION,a=DrawCommand.shallowClone(r,r.derivedCommands.tileset),a.renderState=t._rsStencilDepthPass3DTiles,a.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=a,r=i[e+1],defined(r)||(r=i[e+1]=new DrawCommand({owner:t,primitiveType:n._primitiveType})),r.vertexArray=o,r.renderState=t._rsColorPass,r.shaderProgram=t._spColor,r.pass=Pass$1.TERRAIN_CLASSIFICATION;const u=t.appearance.material;if(defined(u)&&(l=combine$2(l,u._uniforms)),r.uniformMap=l,a=DrawCommand.shallowClone(r,r.derivedCommands.tileset),a.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=a,c){let e=DrawCommand.shallowClone(r,r.derivedCommands.appearance2D);e.shaderProgram=t._spColor2D,r.derivedCommands.appearance2D=e,e=DrawCommand.shallowClone(a,a.derivedCommands.appearance2D),e.shaderProgram=t._spColor2D,a.derivedCommands.appearance2D=e}}const u=t._commandsIgnoreShow,d=t._spStencil;let h=0;o=u.length=o/2;for(let e=0;e<o;++e){const n=u[e]=DrawCommand.shallowClone(i[h],u[e]);n.shaderProgram=d,n.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,h+=2}}function createPickCommands$1(t,i){const n=t._usePickOffsets,r=t._primitive;let a,o,s,l,c,e=2*r._va.length,u=0;n&&(a=r._pickOffsets,e=2*a.length),i.length=e;let d=0;var h=r._batchTable.getUnifor
|
||
|
`+PolylineColorAppearanceVS;const defaultFragmentShaderSource$1=PerInstanceFlatColorAppearanceFS;function PolylineColorAppearance(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=defaultValue(e.translucent,!0),i=PolylineColorAppearance.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=defaultValue(e.vertexShaderSource,defaultVertexShaderSource$1),this._fragmentShaderSource=defaultValue(e.fragmentShaderSource,defaultFragmentShaderSource$1),this._renderState=Appearance.getDefaultRenderState(t,!1,e.renderState),this._closed=!1,this._vertexFormat=i}FeatureDetection.isInternetExplorer()||(defaultVertexShaderSource$1=`#define CLIP_POLYLINE
|
||
|
`+defaultVertexShaderSource$1),Object.defineProperties(PolylineColorAppearance.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),PolylineColorAppearance.VERTEX_FORMAT=VertexFormat.POSITION_ONLY,PolylineColorAppearance.prototype.getFragmentShaderSource=Appearance.prototype.getFragmentShaderSource,PolylineColorAppearance.prototype.isTranslucent=Appearance.prototype.isTranslucent,PolylineColorAppearance.prototype.getRenderState=Appearance.prototype.getRenderState;var PolylineMaterialAppearanceVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec2 st;\nattribute float batchId;\nvarying float v_width;\nvarying vec2 v_st;\nvarying float v_polylineAngle;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nfloat angle;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\ngl_Position = czm_viewportOrthographic * positionWC;\nv_width = width;\nv_st.s = st.s;\nv_st.t = czm_writeNonPerspective(st.t, gl_Position.w);\nv_polylineAngle = angle;\n}\n",PolylineFS$1="#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\nvarying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nvec2 st = v_st;\nst.t = czm_readNonPerspective(st.t, gl_FragCoord.w);\nmaterialInput.s = st.s;\nmaterialInput.st = st;\nmaterialInput.str = vec3(st, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#ifdef VECTOR_TILE\ngl_FragColor *= u_highlightColor;\n#endif\nczm_writeLogDepth();\n}\n";let defaultVertexShaderSource=PolylineCommon+`
|
||
|
`+PolylineMaterialAppearanceVS;const defaultFragmentShaderSource=PolylineFS$1;function PolylineMaterialAppearance(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=defaultValue(e.translucent,!0),i=PolylineMaterialAppearance.VERTEX_FORMAT;this.material=defined(e.material)?e.material:Material$4.fromType(Material$4.ColorType),this.translucent=t,this._vertexShaderSource=defaultValue(e.vertexShaderSource,defaultVertexShaderSource),this._fragmentShaderSource=defaultValue(e.fragmentShaderSource,defaultFragmentShaderSource),this._renderState=Appearance.getDefaultRenderState(t,!1,e.renderState),this._closed=!1,this._vertexFormat=i}function GroundPolylinePrimitive(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;var t=e.appearance;defined(t)||(t=new PolylineMaterialAppearance),this.appearance=t,this.show=defaultValue(e.show,!0),this.classificationType=defaultValue(e.classificationType,ClassificationType$1.BOTH),this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=defaultValue(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:defaultValue(e.interleave,!1),releaseGeometryInstances:defaultValue(e.releaseGeometryInstances,!0),allowPicking:defaultValue(e.allowPicking,!0),asynchronous:defaultValue(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._readyPromise=when.defer(),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=getRenderState$1(!1),this._renderState3DTiles=getRenderState$1(!0),this._renderStateMorph=RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.FRONT},depthTest:{enabled:!0},blending:BlendingState$1.ALPHA_BLEND,depthMask:!1})}function createShaderProgram$1(e,t,i){var n=t.context,r=e._primitive,a=r._attributeLocations,o=r._batchTable.getVertexShaderCallback()(PolylineShadowVolumeVS),o=Primitive$3._appendShowToShader(r,o);o=Primitive$3._appendDistanceDisplayConditionToShader(r,o),o=Primitive$3._modifyShaderPosition(e,o,t.scene3DOnly);var s=r._batchTable.getVertexShaderCallback()(PolylineShadowVolumeMorphVS),s=Primitive$3._appendShowToShader(r,s);s=Primitive$3._appendDistanceDisplayConditionToShader(r,s),s=Primitive$3._modifyShaderPosition(e,s,t.scene3DOnly);var l=r._batchTable.getVertexShaderCallback()(PolylineShadowVolumeFS),c=["GLOBE_MINIMUM_ALTITUDE "+t.mapProjection.ellipsoid.minimumRadius.toFixed(1)],u="",t="";defined(i.material)?(-1!==(t=defined(i.material)?i.material.shaderSource:"").search(/varying\s+float\s+v_polylineAngle;/g)&&c.push("ANGLE_VARYING"),-1!==t.search(/varying\s+float\s+v_width;/g)&&c.push("WIDTH_VARYING")):u="PER_INSTANCE_COLOR",c.push(u);var i=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",u]:[u],u=new ShaderSource({defines:c,sources:[o]}),l=new ShaderSource({defines:i,sources:[t=r._batchTable.setFSAttributesHeader(t),r.primitivePlugin.addFSPart(l)]});e._sp=ShaderProgram.replaceCache({context:n,shaderProgram:r._sp,vertexShaderSource:u,fragmentShaderSource:l,attributeLocations:a});u=n.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");defined(u)||(o=new ShaderSource({defines:c.concat(["COLUMBUS_VIEW_2D"]),sources:[o]}),u=n.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:n,shaderProgram:e._sp2D,vertexShaderSource:o,fragmentShaderSource:l,attributeLocations:a})),e._sp2D=u;u=n.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");defined(u)||(s=new ShaderSource({defines:c.concat(["MAX_TERRAIN_HEIGHT "+ApproximateTerrainHeights._defaultMaxTerrainHeight.toFixed(1)]),sources:[s]}),r=new ShaderSource({defines:i,sources:[t,r._batchTable.getVertexShaderCallback()(PolylineShadowVolumeMorphFS)]}),u=n.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:n,shaderProgram:e._spMorph,vertexShaderSource:s,fragmentShaderSource:r,attributeLocations:a})),e._spMorph=u}function getRenderState$1(e){return Rende
|
||
|
`+defaultVertexShaderSource),Object.defineProperties(PolylineMaterialAppearance.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return-1!==this.material.shaderSource.search(/varying\s+float\s+v_polylineAngle;/g)&&(e=`#define POLYLINE_DASH
|
||
|
`+e),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),PolylineMaterialAppearance.VERTEX_FORMAT=VertexFormat.POSITION_AND_ST,PolylineMaterialAppearance.prototype.getFragmentShaderSource=Appearance.prototype.getFragmentShaderSource,PolylineMaterialAppearance.prototype.isTranslucent=Appearance.prototype.isTranslucent,PolylineMaterialAppearance.prototype.getRenderState=Appearance.prototype.getRenderState,Object.defineProperties(GroundPolylinePrimitive.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),GroundPolylinePrimitive.initializeTerrainHeights=function(){return ApproximateTerrainHeights.initialize()},GroundPolylinePrimitive.prototype.update=function(e){if(defined(this._primitive)||defined(this.geometryInstances))if(ApproximateTerrainHeights.initialized){var l=this,t=this._primitiveOptions;if(!defined(this._primitive)){for(var i=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],n=i.length,r=new Array(n),a=0;a<n;++a)if(!defined(c=i[a].attributes)||!defined(c.color)){this._hasPerInstanceColors=!1;break}for(a=0;a<n;++a){var o,s=i[a],c={},u=s.attributes;for(o in u)u.hasOwnProperty(o)&&(c[o]=u[o]);defined(c.width)||(c.width=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,value:[s.geometry.width]})),s.geometry._scene3DOnly=e.scene3DOnly,GroundPolylineGeometry.setProjectionAndEllipsoid(s.geometry,e.mapProjection),r[a]=new GeometryInstance({geometry:s.geometry,attributes:c,id:s.id,pickPrimitive:l})}t.geometryInstances=r,t.appearance=this.appearance,t._createShaderProgramFunction=function(e,t,i){createShaderProgram$1(l,t,i)},t._createCommandsFunction=function(e,t,i,n,r,a,o){createCommands$3(l,t,i,n,a,o)},t._updateAndQueueCommandsFunction=function(e,t,i,n,r,a,o,s){updateAndQueueCommands(l,t,i,n,r,a,o)},this._primitive=new Primitive$3(t),this._primitive.readyPromise.then(function(e){l._ready=!0,l.releaseGeometryInstances&&(l.geometryInstances=void 0);e=e._error;defined(e)?l._readyPromise.reject(e):l._readyPromise.resolve(l)})}if(this.appearance instanceof PolylineColorAppearance&&!this._hasPerInstanceColors)throw new DeveloperError("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e)}else GroundPolylinePrimitive.initializeTerrainHeights()},GroundPolylinePrimitive.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)},GroundPolylinePrimitive.isSupported=function(e){return e.frameState.context.depthTexture},GroundPolylinePrimitive.prototype.isDestroyed=function(){return!1},GroundPolylinePrimitive.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,destroyObject(this)};const defaultRepeat$2=new Cartesian2(1,1),defaultTransparent=!1,defaultColor$7=Color.WHITE;function ImageMaterialProperty(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat
|
||
|
void tile_color(vec4 tile_featureColor)
|
||
|
{
|
||
|
tile_main();
|
||
|
tile_featureColor = czm_gammaCorrect(tile_featureColor);
|
||
|
gl_FragColor.a *= tile_featureColor.a;
|
||
|
float highlight = ceil(tile_colorBlend);
|
||
|
gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight);
|
||
|
}
|
||
|
`:e+`void tile_color(vec4 tile_featureColor)
|
||
|
{
|
||
|
tile_main();
|
||
|
}
|
||
|
`}function replaceDiffuseTextureCalls(i,e){var n="texture2D("+e;let r,a=0,o=i.indexOf(n,a);for(;-1<o;){let t=0;for(let e=o;e<i.length;++e){const a=i.charAt(e);if("("===a)++t;else if(")"===a&&(--t,0===t)){r=e+1;break}}var s=`tile_diffuse_final(${i.slice(o,r)}, tile_diffuse)`;i=i.slice(0,o)+s+i.slice(r),a=o+s.length,o=i.indexOf(n,a)}return i}function modifyDiffuse(e,t,i){if(!defined(t))return getDefaultShader(e,i);var n=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`);const r=e.match(n);if(!defined(r))return getDefaultShader(e,i);var a=r[0],o=r[2];e=(e=ShaderSource.replaceMain(e,"tile_main")).replace(a,"");let s;if("vec3"===o||"vec4"===o){const i="vec3"===o?`vec4(${t}, 1.0)`:t,r="vec3"===o?"tile_diffuse.xyz":"tile_diffuse";n=new RegExp(t,"g"),e=e.replace(n,r),s=` vec4 source = ${i};
|
||
|
tile_diffuse = tile_diffuse_final(source, tile_featureColor);
|
||
|
tile_main();
|
||
|
`}else"sampler2D"===o&&(e=replaceDiffuseTextureCalls(e,t),s=" tile_diffuse = tile_featureColor; \n tile_main(); \n");return e=`uniform float tile_colorBlend;
|
||
|
vec4 tile_diffuse = vec4(1.0);
|
||
|
bool isWhite(vec3 color)
|
||
|
{
|
||
|
return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
|
||
|
}
|
||
|
vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse)
|
||
|
{
|
||
|
vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend);
|
||
|
vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse;
|
||
|
return vec4(diffuse.rgb, sourceDiffuse.a);
|
||
|
}
|
||
|
${a}
|
||
|
${e}
|
||
|
void tile_color(vec4 tile_featureColor)
|
||
|
{
|
||
|
`+s,i&&(e+=" tile_featureColor = czm_gammaCorrect(tile_featureColor); \n gl_FragColor.a *= tile_featureColor.a; \n float highlight = ceil(tile_colorBlend); \n gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \n"),e+"} \n"}function getColorBlend(e){var t=e._content.tileset,e=t.colorBlendMode,t=t.colorBlendAmount;return e===Cesium3DTileColorBlendMode$1.HIGHLIGHT?0:e===Cesium3DTileColorBlendMode$1.REPLACE?1:e===Cesium3DTileColorBlendMode$1.MIX?CesiumMath.clamp(t,CesiumMath.EPSILON4,1):void 0}Cesium3DTileBatchTable.prototype.applyStyle=function(t){if(!defined(t))return this.setAllColor(DEFAULT_COLOR_VALUE$3),void this.setAllShow(DEFAULT_SHOW_VALUE$3);const i=this._content,n=this.featuresLength;for(let e=0;e<n;++e){const n=i.getFeature(e),r=defined(t.color)?defaultValue(t.color.evaluateColor(n,scratchColor$n),DEFAULT_COLOR_VALUE$3):DEFAULT_COLOR_VALUE$3,a=defined(t.show)?defaultValue(t.show.evaluate(n),DEFAULT_SHOW_VALUE$3):DEFAULT_SHOW_VALUE$3;this.setColor(e,r),this.setShow(e,a)}},Cesium3DTileBatchTable.prototype.isClass=function(e,t){const i=this._batchTableHierarchy;return!!defined(i)&&i.isClass(e,t)},Cesium3DTileBatchTable.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t},Cesium3DTileBatchTable.prototype.getExactClassName=function(e){const t=this._batchTableHierarchy;if(defined(t))return t.getClassName(e)},Cesium3DTileBatchTable.prototype.hasProperty=function(e,t){return defined(this._properties[t])||defined(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)},Cesium3DTileBatchTable.prototype.getPropertyNames=function(e,t){(t=defined(t)?t:[]).length=0;var i=Object.keys(this._properties);return t.push.apply(t,i),defined(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,i)),t},Cesium3DTileBatchTable.prototype.getPropertyBySemantic=function(e,t){},Cesium3DTileBatchTable.prototype.getProperty=function(e,t){if(defined(this._batchTableBinaryProperties)){const i=this._batchTableBinaryProperties[t];if(defined(i))return getBinaryProperty(i,e)}const i=this._properties[t];if(defined(i))return clone$1(i[e],!0);if(defined(this._batchTableHierarchy)){const i=this._batchTableHierarchy.getProperty(e,t);if(defined(i))return i}},Cesium3DTileBatchTable.prototype.setProperty=function(t,i,n){const r=this.featuresLength;if(defined(this._batchTableBinaryProperties)){const r=this._batchTableBinaryProperties[i];if(defined(r))return void setBinaryProperty(r,t,n)}if(!defined(this._batchTableHierarchy)||!this._batchTableHierarchy.setProperty(t,i,n)){let e=this._properties[i];defined(e)||(this._properties[i]=new Array(r),e=this._properties[i]),e[t]=clone$1(n,!0)}},Cesium3DTileBatchTable.prototype.getVertexShaderCallback=function(i,n,r){if(0!==this.featuresLength){const a=this;return function(e){e=modifyDiffuse(e,r,!1);let t;return 0<ContextLimits.maximumVertexTextureImageUnits?(t="",i&&(t+="uniform bool tile_translucentCommand; \n"),t+=`uniform sampler2D tile_batchTexture;
|
||
|
varying vec4 tile_featureColor;
|
||
|
varying vec2 tile_featureSt;
|
||
|
void main()
|
||
|
{
|
||
|
vec2 st = computeSt(${n});
|
||
|
vec4 featureProperties = texture2D(tile_batchTexture, st);
|
||
|
tile_color(featureProperties);
|
||
|
float show = ceil(featureProperties.a);
|
||
|
gl_Position *= show;
|
||
|
`,i&&(t+=" bool isStyleTranslucent = (featureProperties.a != 1.0); \n if (czm_pass == czm_passTranslucent) \n { \n if (!isStyleTranslucent && !tile_translucentCommand) \n { \n gl_Position *= 0.0; \n } \n } \n else \n { \n if (isStyleTranslucent) \n { \n gl_Position *= 0.0; \n } \n } \n"),t+=" tile_featureColor = featureProperties; \n tile_featureSt = st; \n}"):t=`varying vec2 tile_featureSt;
|
||
|
void main()
|
||
|
{
|
||
|
tile_color(vec4(1.0));
|
||
|
tile_featureSt = computeSt(${n});
|
||
|
}`,e+`
|
||
|
`+getGlslComputeSt(a)+t}}},Cesium3DTileBatchTable.prototype.getFragmentShaderCallback=function(t,i,n){if(0!==this.featuresLength)return function(e){return e=modifyDiffuse(e,i,!0),0<ContextLimits.maximumVertexTextureImageUnits?(e+="uniform sampler2D tile_pickTexture; \nvarying vec2 tile_featureSt; \nvarying vec4 tile_featureColor; \nvoid main() \n{ \n tile_color(tile_featureColor); \n",n&&(e+=" gl_FragColor.rgb *= gl_FragColor.a; \n"),e+="}"):(t&&(e+="uniform bool tile_translucentCommand; \n"),e+="uniform sampler2D tile_pickTexture; \nuniform sampler2D tile_batchTexture; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n if (featureProperties.a == 0.0) { \n discard; \n } \n",t&&(e+=" bool isStyleTranslucent = (featureProperties.a != 1.0); \n if (czm_pass == czm_passTranslucent) \n { \n if (!isStyleTranslucent && !tile_translucentCommand) \n { \n discard; \n } \n } \n else \n { \n if (isStyleTranslucent) \n { \n discard; \n } \n } \n"),e+=" tile_color(featureProperties); \n",n&&(e+=" gl_FragColor.rgb *= gl_FragColor.a; \n"),e+="} \n"),e}},Cesium3DTileBatchTable.prototype.getClassificationFragmentShaderCallback=function(){if(0!==this.featuresLength)return function(e){return e=ShaderSource.replaceMain(e,"tile_main"),0<ContextLimits.maximumVertexTextureImageUnits?e+="uniform sampler2D tile_pickTexture;\nvarying vec2 tile_featureSt; \nvarying vec4 tile_featureColor; \nvoid main() \n{ \n tile_main(); \n gl_FragColor = tile_featureColor; \n gl_FragColor.rgb *= gl_FragColor.a; \n}":e+="uniform sampler2D tile_batchTexture; \nuniform sampler2D tile_pickTexture;\nvarying vec2 tile_featureSt; \nvoid main() \n{ \n tile_main(); \n vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n if (featureProperties.a == 0.0) { \n discard; \n } \n gl_FragColor = featureProperties; \n gl_FragColor.rgb *= gl_FragColor.a; \n} \n",e}},Cesium3DTileBatchTable.prototype.getUniformMapCallback=function(){if(0!==this.featuresLength){const t=this;return function(e){return combine$2(e,{tile_batchTexture:function(){return defaultValue(t._batchTexture.batchTexture,t._batchTexture.defaultTexture)},tile_textureDimensions:function(){return t._batchTexture.textureDimensions},tile_textureStep:function(){return t._batchTexture.textureStep},tile_colorBlend:function(){return getColorBlend(t)},tile_pickTexture:function(){return t._batchTexture.pickTexture}})}}},Cesium3DTileBatchTable.prototype.getPickId=function(){return"texture2D(tile_pickTexture, tile_featureSt)"};const StyleCommandsNeeded$2={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};function getStyleCommandsNeeded(e){var t=e._batchTexture.translucentFeaturesLength;return 0===t?StyleCommandsNeeded$2.ALL_OPAQUE:t===e.featuresLength?StyleCommandsNeeded$2.ALL_TRANSLUCENT:StyleCommandsNeeded$2.OPAQUE_AND_TRANSLUCENT}function deriveCommand(e){const t=DrawCommand.shallowClone(e),i=t.pass===Pass$1.TRANSLUCENT;return t.uniformMap=defined(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return i},t}function deriveTranslucentCommand$2(e){const t=DrawCommand.shallowClone(e);return t.pass=Pass$1.TRANSLUCENT,t.renderState=getTranslucentRenderState$2(e.renderState),t}function deriveOpaqueCommand(e){const t=DrawCommand.shallowClone(e);return t.renderState=getOpaqueRenderState(e.renderState),t}function getLogDepthPolygonOffsetFragmentShaderProgram(e,t){let i=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!defined(i)){const n=t.fragmentShaderSource.clone();n.defines=defined(n.defines)?n.defines.slice(0):[],n.defines.push("POLYGON_OFFSET"),n.sources.unshift("#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n"),i=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:n,attributeLocations:t._attributeLocations})}return i}functi
|
||
|
`+e.message),i._readyPromise.reject(new RuntimeError(t))}},parseBuffers:function(n,r){const a=n._loadResources;ForEach.buffer(n.gltf,function(e,t){if(defined(e.extras._pipeline.source))a.buffers[t]=e.extras._pipeline.source;else if(defined(r)){const i=n._resource.getDerivedResource({url:e.uri});++a.pendingBufferLoads,i.fetchArrayBuffer().then(r(n,t)).otherwise(ModelUtility.getFailedLoadFunction(n,"buffer",i.url))}})}},aMinScratch=new Cartesian3,aMaxScratch=new Cartesian3;function techniqueAttributeForSemantic(e,i){return ForEach.techniqueAttribute(e,function(e,t){if(e.semantic===i)return t})}function ensureSemanticExistenceForPrimitive(t,i){const n=t.accessors,e=t.materials,r=t.extensions.KHR_techniques_webgl,a=r.techniques,o=r.programs,s=r.shaders,l=i.targets,c=i.attributes;for(const t in l)if(l.hasOwnProperty(t)){const i=l[t];for(const n in i)"extras"!==n&&(c[n+"_"+t]=i[n])}const u=a[e[i.material].extensions.KHR_techniques_webgl.technique],d=s[o[u.program].vertexShader];for(const t in c)if(c.hasOwnProperty(t)&&!defined(techniqueAttributeForSemantic(u,t))){const i=n[c[t]];let e=t.toLowerCase();"_"===e.charAt(0)&&(e=e.slice(1));const r="a_"+e;u.attributes[r]={semantic:t,type:i.componentType};const a=d.extras._pipeline;var h=a.source,h=`attribute ${ModelUtility.getShaderVariable(i.type)} ${r};
|
||
|
`+h;a.source=h}}function getTechniqueAttributeOrUniformFunction(e,i,n,r){return usesExtension(e,"KHR_techniques_webgl")?function(e,t){if(!(e.semantic!==n||r&&defined(e.node)))return t}:function(e,t){e=i.parameters[e];if(!(e.semantic!==n||r&&defined(e.node)))return t}}ModelUtility.computeBoundingSphere=function(i){const n=i.gltf,r=n.nodes,a=n.meshes,o=n.scenes[n.scene].nodes,s=o.length,l=[],c=new Cartesian3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=new Cartesian3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let t=0;t<s;++t){let e=r[o[t]];for(e._transformToRoot=ModelUtility.getTransform(e),l.push(e);0<l.length;){e=l.pop();const i=e._transformToRoot,o=e.mesh;if(defined(o)){const r=a[o].primitives,s=r.length;for(let e=0;e<s;++e){const o=r[e].attributes.POSITION;if(defined(o)){const r=ModelUtility.getAccessorMinMax(n,o);if(defined(r.min)&&defined(r.max)){const n=Cartesian3.fromArray(r.min,0,aMinScratch),a=Cartesian3.fromArray(r.max,0,aMaxScratch);Matrix4.multiplyByPoint(i,n,n),Matrix4.multiplyByPoint(i,a,a),Cartesian3.minimumByComponent(c,n,c),Cartesian3.maximumByComponent(u,a,u)}}}}const d=e.children;if(defined(d)){const n=d.length;for(let e=0;e<n;++e){const n=r[d[e]];n._transformToRoot=ModelUtility.getTransform(n),Matrix4.multiplyTransformation(i,n._transformToRoot,n._transformToRoot),l.push(n)}}delete e._transformToRoot}}const d=BoundingSphere.fromCornerPoints(c,u);return i._forwardAxis===Axis$1.Z&&BoundingSphere.transformWithoutScale(d,Axis$1.Z_UP_TO_X_UP,d),i._upAxis===Axis$1.Y?BoundingSphere.transformWithoutScale(d,Axis$1.Y_UP_TO_Z_UP,d):i._upAxis===Axis$1.X&&BoundingSphere.transformWithoutScale(d,Axis$1.X_UP_TO_Z_UP,d),d},ModelUtility.ensureSemanticExistence=function(t){return ForEach.mesh(t,function(e){ForEach.meshPrimitive(e,function(e){ensureSemanticExistenceForPrimitive(t,e)})}),t},ModelUtility.createAttributeLocations=function(e,t){const i={};let n=!1,r=1;if(ForEach.techniqueAttribute(e,function(e,t){/pos/i.test(t)&&!n?(i[t]=0,n=!0):i[t]=r++}),defined(t))for(const e in t)t.hasOwnProperty(e)&&(i[e]=r++);return i},ModelUtility.getAccessorMinMax=function(e,t){e=e.accessors[t],t=e.extensions;let i=e.min,n=e.max;if(defined(t)){const r=t.WEB3D_quantized_attributes;defined(r)&&(i=r.decodedMin,n=r.decodedMax)}return{min:i,max:n}},ModelUtility.getAttributeOrUniformBySemantic=function(i,n,r,a){return ForEach.technique(i,function(e){if(!defined(r)||e.program===r){var t=ForEach.techniqueAttribute(e,getTechniqueAttributeOrUniformFunction(i,e,n,a));return defined(t)?t:ForEach.techniqueUniform(e,getTechniqueAttributeOrUniformFunction(i,e,n,a))}})},ModelUtility.getDiffuseAttributeOrUniform=function(e,t){let i=ModelUtility.getAttributeOrUniformBySemantic(e,"COLOR_0",t);return defined(i)||(i=ModelUtility.getAttributeOrUniformBySemantic(e,"_3DTILESDIFFUSE",t)),i};const nodeTranslationScratch=new Cartesian3,nodeQuaternionScratch=new Quaternion,nodeScaleScratch=new Cartesian3;function replaceAllButFirstInString(e,t,i){t+="(?!\\w)",t=new RegExp(t,"g");const n=e.search(t);return e.replace(t,function(e,t){return n===t?e:i})}function getQuantizedAttributes(e,t){t=e.accessors[t].extensions;if(defined(t))return t.WEB3D_quantized_attributes}function getAttributeVariableName(e,t,i){t=t.material,t=e.materials[t];if(usesExtension(e,"KHR_techniques_webgl")&&defined(t.extensions)&&defined(t.extensions.KHR_techniques_webgl)){t=t.extensions.KHR_techniques_webgl.technique,t=e.extensions.KHR_techniques_webgl.techniques[t];return ForEach.techniqueAttribute(t,function(e,t){if(e.semantic===i)return t})}}function getScalarUniformFunction(e){const t={value:e,clone:function(e,t){return e},func:function(){return t.value}};return t}function getVec2UniformFunction(e){const t={value:Cartesian2.fromArray(e),clone:Cartesian2.clone,func:function(){return t.value}};return t}function getVec3UniformFunction(e){const t={value:Cartesian3.fromArray(e),clone:Cartesian3.clone,func:function(){return t.value}};return t}function getVec4UniformFunction(e){const t={value:Cartesian4.fromArray(e),clone:Cartesian4.clone,func:function(){return t.value}}
|
||
|
`+n;o=3===r&&"COLOR_0"===a;o&&(n=replaceAllButFirstInString(n,i,`vec4(${i}, 1.0)`));let e="";if(s.octEncoded){const r=c+"_rangeConstant";n=`uniform float ${r};
|
||
|
`+n,e=`
|
||
|
void main() {
|
||
|
${i} = czm_octDecode(${u}.xy, ${r}).zxy;
|
||
|
${t}();
|
||
|
}
|
||
|
`}else{const r=c+"_normConstant",d=c+"_min";n=`uniform float ${r};
|
||
|
uniform ${l} ${d};
|
||
|
`+n,e=`
|
||
|
void main() {
|
||
|
${i} = ${d} + ${u}${o?".xyz":""} * ${r};
|
||
|
${t}();
|
||
|
}
|
||
|
`}n=ShaderSource.replaceMain(n,t),n+=e}}return{shader:n}},ModelUtility.modifyShaderForQuantizedAttributes=function(t,i,n){const r={},a=i.attributes;for(var o in a)if(a.hasOwnProperty(o)){const a=getAttributeVariableName(t,i,o),e=i.attributes[o];"_"===o.charAt(0)&&(o=o.substring(1));var s="gltf_u_dec_"+o.toLowerCase(),l=s+"_scale",c=s+"_translate";if(!defined(r[s])&&!defined(r[l])){const i=getQuantizedAttributes(t,e);if(defined(i)){const t=i.decodeMatrix,u="gltf_decoded_"+o,d=a.replace("a_","gltf_a_dec_"),h=Math.floor(Math.sqrt(t.length));n=(o=2<h?"vec"+(h-1):"float")+` ${d};
|
||
|
`+(n=replaceAllButFirstInString(n,a,d));let e="";5===h?(n=`uniform vec4 ${c};
|
||
|
`+(n=`uniform mat4 ${l};
|
||
|
`+n),e=`
|
||
|
void main() {
|
||
|
${d} = ${l} * ${a} + ${c};
|
||
|
${u}();
|
||
|
}
|
||
|
`,r[l]={mat:4},r[c]={vec:4}):(n=`uniform mat${h} ${s};
|
||
|
`+n,e=`
|
||
|
void main() {
|
||
|
${d} = ${o}(${s} * vec${h}(${a},1.0));
|
||
|
${u}();
|
||
|
}
|
||
|
`,r[s]={mat:h}),n=ShaderSource.replaceMain(n,u),n+=e}}}return{shader:n,uniforms:r}},Object.defineProperties(DelayLoadedTextureUniform.prototype,{value:{get:function(){if(!defined(this._value)){var e=this._textures[this._textureId];if(!defined(e))return this._defaultTexture;this._value=e}return this._value},set:function(e){this._value=e}}}),DelayLoadedTextureUniform.prototype.clone=function(e){return e},DelayLoadedTextureUniform.prototype.func=void 0;const gltfUniformFunctions={};function scaleFromMatrix5Array(e){return[e[0],e[1],e[2],e[3],e[5],e[6],e[7],e[8],e[10],e[11],e[12],e[13],e[15],e[16],e[17],e[18]]}function translateFromMatrix5Array(e){return[e[20],e[21],e[22],e[23]]}gltfUniformFunctions[WebGLConstants$1.FLOAT]=getScalarUniformFunction,gltfUniformFunctions[WebGLConstants$1.FLOAT_VEC2]=getVec2UniformFunction,gltfUniformFunctions[WebGLConstants$1.FLOAT_VEC3]=getVec3UniformFunction,gltfUniformFunctions[WebGLConstants$1.FLOAT_VEC4]=getVec4UniformFunction,gltfUniformFunctions[WebGLConstants$1.INT]=getScalarUniformFunction,gltfUniformFunctions[WebGLConstants$1.INT_VEC2]=getVec2UniformFunction,gltfUniformFunctions[WebGLConstants$1.INT_VEC3]=getVec3UniformFunction,gltfUniformFunctions[WebGLConstants$1.INT_VEC4]=getVec4UniformFunction,gltfUniformFunctions[WebGLConstants$1.BOOL]=getScalarUniformFunction,gltfUniformFunctions[WebGLConstants$1.BOOL_VEC2]=getVec2UniformFunction,gltfUniformFunctions[WebGLConstants$1.BOOL_VEC3]=getVec3UniformFunction,gltfUniformFunctions[WebGLConstants$1.BOOL_VEC4]=getVec4UniformFunction,gltfUniformFunctions[WebGLConstants$1.FLOAT_MAT2]=getMat2UniformFunction,gltfUniformFunctions[WebGLConstants$1.FLOAT_MAT3]=getMat3UniformFunction,gltfUniformFunctions[WebGLConstants$1.FLOAT_MAT4]=getMat4UniformFunction,gltfUniformFunctions[WebGLConstants$1.SAMPLER_2D]=getTextureUniformFunction,ModelUtility.createUniformFunction=function(e,t,i,n){return gltfUniformFunctions[e](t,i,n)},ModelUtility.createUniformsForDracoQuantizedAttributes=function(e){const t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i],r=n.quantization;if(!defined(r))continue;"_"===i.charAt(0)&&(i=i.substring(1));var a="gltf_u_dec_"+i.toLowerCase();if(r.octEncoded){const e=a+"_rangeConstant",s=(1<<r.quantizationBits)-1;t[e]=getScalarUniformFunction(s).func;continue}i=r.range/(1<<r.quantizationBits);t[a+"_normConstant"]=getScalarUniformFunction(i).func;var o=a+"_min";switch(n.componentsPerAttribute){case 1:t[o]=getScalarUniformFunction(r.minValues).func;break;case 2:t[o]=getVec2UniformFunction(r.minValues).func;break;case 3:t[o]=getVec3UniformFunction(r.minValues).func;break;case 4:t[o]=getVec4UniformFunction(r.minValues).func}}return t},ModelUtility.createUniformsForQuantizedAttributes=function(e,t,i){const n=e.accessors,r={},a={},o=t.attributes;for(var s in o)if(o.hasOwnProperty(s)){const t=n[o[s]],i=t.extensions;if("_"===s.charAt(0)&&(s=s.substring(1)),defined(i)){const n=i.WEB3D_quantized_attributes;if(defined(n)){const i=n.decodeMatrix,o="gltf_u_dec_"+s.toLowerCase();var l,c;switch(t.type){case AttributeType$2.SCALAR:a[o]=getMat2UniformFunction(i).func,r[o]=!0;break;case AttributeType$2.VEC2:a[o]=getMat3UniformFunction(i).func,r[o]=!0;break;case AttributeType$2.VEC3:a[o]=getMat4UniformFunction(i).func,r[o]=!0;break;case AttributeType$2.VEC4:l=o+"_scale",c=o+"_translate",a[l]=getMat4UniformFunction(scaleFromMatrix5Array(i)).func,a[c]=getVec4UniformFunction(translateFromMatrix5Array(i)).func,r[l]=!0,r[c]=!0}}}}for(const e in i)if(i.hasOwnProperty(e)&&!r[e]){const t=i[e];defined(t.mat)&&(2===t.mat?a[e]=getMat2UniformFunction(Matrix2.IDENTITY).func:3===t.mat?a[e]=getMat3UniformFunction(Matrix3.IDENTITY).func:4===t.mat&&(a[e]=getMat4UniformFunction(Matrix4.IDENTITY).func)),defined(t.vec)&&4===t.vec&&(a[e]=getVec4UniformFunction([0,0,0,0]).func)}return a};const scratchTranslationRtc=new Cartesian3,gltfSemanticUniforms$1={MODEL:function(e,t){return function(){return e.model}},VIEW:function(e,t){return function(){return e.view}},PROJECTION:function(e,t){return function(){return e.projection}},MODELVIEW:function(e,t){return function(){return
|
||
|
`,delete e.useInFragment):m+=`uniform ${webGLConstantToGlslType(e.type)} ${C}${M};
|
||
|
`}let S="";p&&(S+=" mat4 skinMatrix =\n a_weight.x * u_jointMatrix[int(a_joint.x)] +\n a_weight.y * u_jointMatrix[int(a_joint.y)] +\n a_weight.z * u_jointMatrix[int(a_joint.z)] +\n a_weight.w * u_jointMatrix[int(a_joint.w)];\n");const T={a_position:{semantic:"POSITION"}};let A;m+="attribute vec3 a_position;\n",m+="varying vec3 v_positionEC;\n",S+=p?" vec4 pos = u_modelViewMatrix * skinMatrix * vec4(a_position,1.0);\n":" vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);\n",S+=" v_positionEC = pos.xyz;\n",S+=" gl_Position = u_projectionMatrix * pos;\n",g+="varying vec3 v_positionEC;\n",_&&(T.a_normal={semantic:"NORMAL"},m+="attribute vec3 a_normal;\n",m+="varying vec3 v_normal;\n",S+=p?" v_normal = u_normalMatrix * mat3(skinMatrix) * a_normal;\n":" v_normal = u_normalMatrix * a_normal;\n",g+="varying vec3 v_normal;\n"),v&&(T.a_texcoord_0={semantic:"TEXCOORD_0"},A="v_texcoord_0",m+="attribute vec2 a_texcoord_0;\n",m+=`varying vec2 ${A};
|
||
|
`,S+=` ${A} = a_texcoord_0;
|
||
|
`,g+=`varying vec2 ${A};
|
||
|
`),p&&(T.a_joint={semantic:"JOINTS_0"},T.a_weight={semantic:"WEIGHTS_0"},m+="attribute vec4 a_joint;\n",m+="attribute vec4 a_weight;\n"),f&&(T.a_vertexColor={semantic:"COLOR_0"},m+="attribute vec4 a_vertexColor;\n",m+="varying vec4 v_vertexColor;\n",S+=" v_vertexColor = a_vertexColor;\n",g+="varying vec4 v_vertexColor;\n"),a&&(T.a_batchId={semantic:"_BATCHID"},m+="attribute float a_batchId;\n");var x=_&&("BLINN"===l||"PHONG"===l)&&defined(y.u_specular)&&defined(y.u_shininess)&&0<y.u_shininess;let E=!1,b=!1,P="";for(const e in c)if(c.hasOwnProperty(e)){const M=c[e],i=M.type.toLowerCase(),I=M.baseName;P+=" {\n";const r=`u_${I}Color`;if("ambient"===i)b=!0,P+=` ambientLight += ${r};
|
||
|
`;else if(_){E=!0;const e=`v_${I}Direction`,M=`v_${I}Position`;"point"!==i&&(m+=`varying vec3 ${e};
|
||
|
`,g+=`varying vec3 ${e};
|
||
|
`,S+=` ${e} = mat3(u_${I}Transform) * vec3(0.,0.,1.);
|
||
|
`,"directional"===i&&(P+=` vec3 l = normalize(${e});
|
||
|
`)),"directional"!==i?(m+=`varying vec3 ${M};
|
||
|
`,g+=`varying vec3 ${M};
|
||
|
`,S+=` ${M} = u_${I}Transform[3].xyz;
|
||
|
`,P+=` vec3 VP = ${M} - v_positionEC;
|
||
|
`,P+=" vec3 l = normalize(VP);\n",P+=" float range = length(VP);\n",P+=` float attenuation = 1.0 / (u_${I}Attenuation.x + `,P+=`(u_${I}Attenuation.y * range) + `,P+=`(u_${I}Attenuation.z * range * range));
|
||
|
`):P+=" float attenuation = 1.0;\n","spot"===i&&(P+=` float spotDot = dot(l, normalize(${e}));
|
||
|
`,P+=` if (spotDot < cos(u_${I}FallOff.x * 0.5))
|
||
|
`,P+=" {\n",P+=" attenuation = 0.0;\n",P+=" }\n",P+=" else\n",P+=" {\n",P+=` attenuation *= max(0.0, pow(spotDot, u_${I}FallOff.y));
|
||
|
`,P+=" }\n"),P+=` diffuseLight += ${r}* max(dot(normal,l), 0.) * attenuation;
|
||
|
`,x&&("BLINN"===l?(P+=" vec3 h = normalize(l + viewDir);\n",P+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation;\n"):(P+=" vec3 reflectDir = reflect(-l, normal);\n",P+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;\n"),P+=` specularLight += ${r} * specularIntensity;
|
||
|
`)}P+=" }\n"}b||(P+=" ambientLight += vec3(0.2, 0.2, 0.2);\n"),E||"CONSTANT"===l||(g+="#ifdef USE_CUSTOM_LIGHT_COLOR \n",g+="uniform vec3 gltf_lightColor; \n",g+="#endif \n",P+="#ifndef USE_CUSTOM_LIGHT_COLOR \n",P+=" vec3 lightColor = czm_lightColor;\n",P+="#else \n",P+=" vec3 lightColor = gltf_lightColor;\n",P+="#endif \n",P+=" vec3 l = normalize(czm_lightDirectionEC);\n",P+=` diffuseLight += lightColor * max(dot(normal,l), 0.2);
|
||
|
`,x&&("BLINN"===l?(P+=" vec3 h = normalize(l + viewDir);\n",P+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess));\n"):(P+=" vec3 reflectDir = reflect(-l, normal);\n",P+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess));\n"),P+=" specularLight += lightColor * specularIntensity;\n")),m+="void main(void) {\n",m+=S,m+="}\n",g+="void main(void) {\n";let D,w=" vec3 color = vec3(0.0, 0.0, 0.0);\n";_&&(g+=" vec3 normal = normalize(v_normal);\n",n.doubleSided&&(g+=" if (czm_backFacing())\n",g+=" {\n",g+=" normal = -normal;\n",g+=" }\n")),D="CONSTANT"!==l?(defined(y.u_diffuse)&&(y.u_diffuse.type===WebGLConstants$1.SAMPLER_2D?g+=` vec4 diffuse = texture2D(u_diffuse, ${A});
|
||
|
`:g+=" vec4 diffuse = u_diffuse;\n",g+=" vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n",w+=" color += diffuse.rgb * diffuseLight;\n"),x&&(y.u_specular.type===WebGLConstants$1.SAMPLER_2D?g+=` vec3 specular = texture2D(u_specular, ${A}).rgb;
|
||
|
`:g+=" vec3 specular = u_specular.rgb;\n",g+=" vec3 specularLight = vec3(0.0, 0.0, 0.0);\n",w+=" color += specular * specularLight;\n"),defined(y.u_transparency)?" gl_FragColor = vec4(color * diffuse.a * u_transparency, diffuse.a * u_transparency);\n":" gl_FragColor = vec4(color * diffuse.a, diffuse.a);\n"):defined(y.u_transparency)?" gl_FragColor = vec4(color * u_transparency, u_transparency);\n":" gl_FragColor = vec4(color, 1.0);\n",f&&(w+=" color *= v_vertexColor.rgb;\n"),defined(y.u_emission)&&(y.u_emission.type===WebGLConstants$1.SAMPLER_2D?g+=` vec3 emission = texture2D(u_emission, ${A}).rgb;
|
||
|
`:g+=" vec3 emission = u_emission.rgb;\n",w+=" color += emission;\n"),!defined(y.u_ambient)&&"CONSTANT"===l||(defined(y.u_ambient)?y.u_ambient.type===WebGLConstants$1.SAMPLER_2D?g+=` vec3 ambient = texture2D(u_ambient, ${A}).rgb;
|
||
|
`:g+=" vec3 ambient = u_ambient.rgb;\n":g+=" vec3 ambient = diffuse.rgb;\n",w+=" color += ambient * ambientLight;\n"),g+=" vec3 viewDir = -normalize(v_positionEC);\n",g+=" vec3 ambientLight = vec3(0.0, 0.0, 0.0);\n",g+=P,g+=w,g+=D,g+="}\n";n=addToArray(s,{type:WebGLConstants$1.VERTEX_SHADER,extras:{_pipeline:{source:m,extension:".glsl"}}}),s=addToArray(s,{type:WebGLConstants$1.FRAGMENT_SHADER,extras:{_pipeline:{source:g,extension:".glsl"}}}),n=addToArray(t,{fragmentShader:s,vertexShader:n});return addToArray(o,{attributes:T,program:n,uniforms:y})}function getKHRMaterialsCommonValueType(e,t){var i=defined(t.value)?t.value:defined(t.index)?[t.index]:t;switch(e){case"ambient":case"diffuse":case"emission":case"specular":return 1===i.length?WebGLConstants$1.SAMPLER_2D:WebGLConstants$1.FLOAT_VEC4;case"shininess":case"transparency":return WebGLConstants$1.FLOAT;case"transparent":case"doubleSided":return WebGLConstants$1.BOOL}}function getTechniqueKey(e,t){let i="";i+=`technique:${e.technique};`;const n=e.values,r=Object.keys(n).sort(),a=r.length;for(let e=0;e<a;++e){const t=r[e];n.hasOwnProperty(t)&&(i+=t+":"+getKHRMaterialsCommonValueType(t,n[t]),i+=";")}const o=defaultValue(e.jointCount,0);if(i+=o.toString()+";",defined(t)){const e=t.skinning;0<o&&(i+=e.type+";"),i+=t.hasVertexColors}return i}function lightDefaults(t){const i=t.extensions.KHR_materials_common;if(defined(i)&&defined(i.lights)){var n=i.lights,r=n.length;for(let e=0;e<r;e++){const i=n[e];if("ambient"===i.type){defined(i.ambient)||(i.ambient={});const t=i.ambient;defined(t.color)||(t.color=[1,1,1])}else if("directional"===i.type){defined(i.directional)||(i.directional={});const t=i.directional;defined(t.color)||(t.color=[1,1,1])}else if("point"===i.type){defined(i.point)||(i.point={});const t=i.point;defined(t.color)||(t.color=[1,1,1]),t.constantAttenuation=defaultValue(t.constantAttenuation,1),t.linearAttenuation=defaultValue(t.linearAttenuation,0),t.quadraticAttenuation=defaultValue(t.quadraticAttenuation,0)}else if("spot"===i.type){defined(i.spot)||(i.spot={});const t=i.spot;defined(t.color)||(t.color=[1,1,1]),t.constantAttenuation=defaultValue(t.constantAttenuation,1),t.fallOffAngle=defaultValue(t.fallOffAngle,3.14159265),t.fallOffExponent=defaultValue(t.fallOffExponent,0),t.linearAttenuation=defaultValue(t.linearAttenuation,0),t.quadraticAttenuation=defaultValue(t.quadraticAttenuation,0)}}}}function processPbrMaterials(n,r){if(r=defaultValue(r,defaultValue.EMPTY_OBJECT),usesExtension(n,"KHR_techniques_webgl"))return n;if(!defined(n.materials)||0===n.materials.length)return n;defined(n.extensions)||(n.extensions={}),defined(n.extensionsUsed)||(n.extensionsUsed=[]),defined(n.extensionsRequired)||(n.extensionsRequired=[]),n.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},n.extensionsUsed.push("KHR_techniques_webgl"),n.extensionsRequired.push("KHR_techniques_webgl");var a=ModelUtility.splitIncompatibleMaterials(n);return ForEach.material(n,function(e,t){var i={},t=generateTechnique(n,e,t,i,a,r);defined(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl={values:i,technique:t}}),ModelUtility.ensureSemanticExistence(n),n}function isSpecularGlossinessMaterial(e){return defined(e.extensions)&&defined(e.extensions.KHR_materials_pbrSpecularGlossiness)}function addTextureCoordinates(e,t,i,n,r){var a,o=i[t];return defined(o)&&defined(o.texCoord)&&1===o.texCoord&&(n=n.replace("0","1")),defined(i[t+"Offset"])?r.fragmentShaderMain+=" vec2 "+(a=t+"Coord")+" = computeTexCoord("+n+", "+t+"Offset, "+t+"Rotation, "+t+"Scale);\n":a=n,a}ModelUtility.getGltfSemanticUniforms=function(){return gltfSemanticUniforms$1};var DEFAULT_TEXTURE_OFFSET=[0,0],DEFAULT_TEXTURE_ROTATION=[0],DEFAULT_TEXTURE_SCALE=[1,1];function handleKHRTextureTransform(e,t,i){var n;-1!==e.indexOf("Texture")&&defined(t.extensions)&&defined(t.extensions.KHR_texture_transform)&&(n=t.extensions.KHR_texture_transform,i[(e="u_"+e)+"Offset"]=defaultValue(n.offset,DEFAULT_TEXTURE_OFFSET),i[e+"Rotation"]=defaultValue(n.rotation,DEFAULT_TEXTURE_ROTATION),i[e+"Scale"]=defaultV
|
||
|
{
|
||
|
return ${this.getShaderExpression(t,i)};
|
||
|
}
|
||
|
`},Expression.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)},Expression.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(e,t,i){return i.indexOf(e)===t}),e};const unaryOperators=["!","-","+"],binaryOperators=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],variableRegex=/\${(.*?)}/g,backslashRegex=/\\/g,backslashReplacement="@#%",replacementRegex=/@#%/g,scratchColor$m=new Color,unaryFunctions={abs:getEvaluateUnaryComponentwise(Math.abs),sqrt:getEvaluateUnaryComponentwise(Math.sqrt),cos:getEvaluateUnaryComponentwise(Math.cos),sin:getEvaluateUnaryComponentwise(Math.sin),tan:getEvaluateUnaryComponentwise(Math.tan),acos:getEvaluateUnaryComponentwise(Math.acos),asin:getEvaluateUnaryComponentwise(Math.asin),atan:getEvaluateUnaryComponentwise(Math.atan),radians:getEvaluateUnaryComponentwise(CesiumMath.toRadians),degrees:getEvaluateUnaryComponentwise(CesiumMath.toDegrees),sign:getEvaluateUnaryComponentwise(CesiumMath.sign),floor:getEvaluateUnaryComponentwise(Math.floor),ceil:getEvaluateUnaryComponentwise(Math.ceil),round:getEvaluateUnaryComponentwise(Math.round),exp:getEvaluateUnaryComponentwise(Math.exp),exp2:getEvaluateUnaryComponentwise(exp2),log:getEvaluateUnaryComponentwise(Math.log),log2:getEvaluateUnaryComponentwise(log2),fract:getEvaluateUnaryComponentwise(fract),length:length$1,normalize:normalize$1},binaryFunctions={atan2:getEvaluateBinaryComponentwise(Math.atan2,!1),pow:getEvaluateBinaryComponentwise(Math.pow,!1),min:getEvaluateBinaryComponentwise(Math.min,!0),max:getEvaluateBinaryComponentwise(Math.max,!0),distance:distance,dot:dot,cross:cross},ternaryFunctions={clamp:getEvaluateTernaryComponentwise(CesiumMath.clamp,!0),mix:getEvaluateTernaryComponentwise(CesiumMath.lerp,!0)};function fract(e){return e-Math.floor(e)}function exp2(e){return Math.pow(2,e)}function log2(e){return CesiumMath.log2(e)}function getEvaluateUnaryComponentwise(i){return function(e,t){if("number"==typeof t)return i(t);if(t instanceof Cartesian2)return Cartesian2.fromElements(i(t.x),i(t.y),scratchStorage.getCartesian2());if(t instanceof Cartesian3)return Cartesian3.fromElements(i(t.x),i(t.y),i(t.z),scratchStorage.getCartesian3());if(t instanceof Cartesian4)return Cartesian4.fromElements(i(t.x),i(t.y),i(t.z),i(t.w),scratchStorage.getCartesian4());throw new RuntimeError(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}}function getEvaluateBinaryComponentwise(n,r){return function(e,t,i){if(r&&"number"==typeof i){if("number"==typeof t)return n(t,i);if(t instanceof Cartesian2)return Cartesian2.fromElements(n(t.x,i),n(t.y,i),scratchStorage.getCartesian2());if(t instanceof Cartesian3)return Cartesian3.fromElements(n(t.x,i),n(t.y,i),n(t.z,i),scratchStorage.getCartesian3());if(t instanceof Cartesian4)return Cartesian4.fromElements(n(t.x,i),n(t.y,i),n(t.z,i),n(t.w,i),scratchStorage.getCartesian4())}if("number"==typeof t&&"number"==typeof i)return n(t,i);if(t instanceof Cartesian2&&i instanceof Cartesian2)return Cartesian2.fromElements(n(t.x,i.x),n(t.y,i.y),scratchStorage.getCartesian2());if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.fromElements(n(t.x,i.x),n(t.y,i.y),n(t.z,i.z),scratchStorage.getCartesian3());if(t instanceof Cartesian4&&i instanceof Cartesian4)return Cartesian4.fromElements(n(t.x,i.x),n(t.y,i.y),n(t.z,i.z),n(t.w,i.w),scratchStorage.getCartesian4());throw new RuntimeError(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${i}.`)}}function getEvaluateTernaryComponentwise(r,a){return function(e,t,i,n){if(a&&"number"==typeof n){if("number"==typeof t&&"number"==typeof i)return r(t,i,n);if(t instanceof Cartesian2&&i instanceof Cartesian2)return Cartesian2.fromElements(r(t.x,i.x,n),r(t.y,i.y,n),scratchStorage.getCartesian2());if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.fromElements(r(t.x,i.x,n),r(t.y,i.y,n),r(t.z,i.z,n),scratchStorage.getCartesian3());if(t instanceof Cartesian4&&i instanceof Cartesian4)r
|
||
|
{
|
||
|
czm_non_pick_main();
|
||
|
gl_FragColor = ${e};
|
||
|
}
|
||
|
`,t._spPick=ShaderProgram.fromCache({context:i,vertexShaderSource:n,fragmentShaderSource:r,attributeLocations:l}),0;var a=s.getVertexShaderCallback(!1,"a_batchId",void 0)(VectorTileVS),o=s.getFragmentShaderCallback(!1,void 0,!0)(ShadowVolumeFS);e=s.getPickId();n=new ShaderSource({sources:[a]}),r=new ShaderSource({defines:["VECTOR_TILE"],sources:[o]});t._sp=ShaderProgram.fromCache({context:i,vertexShaderSource:n,fragmentShaderSource:r,attributeLocations:l}),n=new ShaderSource({sources:[VectorTileVS]}),r=new ShaderSource({defines:["VECTOR_TILE"],sources:[ShadowVolumeFS]}),t._spStencil=ShaderProgram.fromCache({context:i,vertexShaderSource:n,fragmentShaderSource:r,attributeLocations:l});o=""+ShaderSource.replaceMain(o,"czm_non_pick_main")+`
|
||
|
void main()
|
||
|
{
|
||
|
czm_non_pick_main();
|
||
|
gl_FragColor = ${e};
|
||
|
}
|
||
|
`,a=new ShaderSource({sources:[a]}),o=new ShaderSource({defines:["VECTOR_TILE"],sources:[o]});t._spPick=ShaderProgram.fromCache({context:i,vertexShaderSource:a,fragmentShaderSource:o,attributeLocations:l})}}function getStencilDepthRenderState(e){e=e?StencilFunction$1.EQUAL:StencilFunction$1.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.DECREMENT_WRAP,zPass:StencilOperation$1.KEEP},backFunction:e,backOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.INCREMENT_WRAP,zPass:StencilOperation$1.KEEP},reference:StencilConstants$1.CESIUM_3D_TILE_MASK,mask:StencilConstants$1.CESIUM_3D_TILE_MASK},stencilMask:StencilConstants$1.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:DepthFunction$1.LESS_OR_EQUAL},depthMask:!1}}const colorRenderState={stencilTest:{enabled:!0,frontFunction:StencilFunction$1.NOT_EQUAL,frontOperation:{fail:StencilOperation$1.ZERO,zFail:StencilOperation$1.ZERO,zPass:StencilOperation$1.ZERO},backFunction:StencilFunction$1.NOT_EQUAL,backOperation:{fail:StencilOperation$1.ZERO,zFail:StencilOperation$1.ZERO,zPass:StencilOperation$1.ZERO},reference:0,mask:StencilConstants$1.CLASSIFICATION_MASK},stencilMask:StencilConstants$1.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:BlendingState$1.PRE_MULTIPLIED_ALPHA_BLEND},pickRenderState={stencilTest:{enabled:!0,frontFunction:StencilFunction$1.NOT_EQUAL,frontOperation:{fail:StencilOperation$1.ZERO,zFail:StencilOperation$1.ZERO,zPass:StencilOperation$1.ZERO},backFunction:StencilFunction$1.NOT_EQUAL,backOperation:{fail:StencilOperation$1.ZERO,zFail:StencilOperation$1.ZERO,zPass:StencilOperation$1.ZERO},reference:0,mask:StencilConstants$1.CLASSIFICATION_MASK},stencilMask:StencilConstants$1.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function createRenderStates$4(e){defined(e._rsStencilDepthPass)||(e._rsStencilDepthPass=RenderState.fromCache(getStencilDepthRenderState(!1)),e._rsStencilDepthPass3DTiles=RenderState.fromCache(getStencilDepthRenderState(!0)),e._rsColorPass=RenderState.fromCache(colorRenderState),e._rsPickPass=RenderState.fromCache(pickRenderState))}const modifiedModelViewScratch$3=new Matrix4,rtcScratch$3=new Cartesian3;function createUniformMap$6(i,n){var e;defined(i._uniformMap)||(e={u_modifiedModelViewProjection:function(){var e=n.uniformState.view,t=n.uniformState.projection;return Matrix4.clone(e,modifiedModelViewScratch$3),Matrix4.multiplyByPoint(modifiedModelViewScratch$3,i._center,rtcScratch$3),Matrix4.setTranslation(modifiedModelViewScratch$3,rtcScratch$3,modifiedModelViewScratch$3),Matrix4.multiply(t,modifiedModelViewScratch$3,modifiedModelViewScratch$3),modifiedModelViewScratch$3},u_highlightColor:function(){return i._highlightColor}},i._uniformMap=i._batchTable.getUniformMapCallback()(e))}function copyIndicesCPU(t,i,n,r,a,o,s){const l=t.constructor.BYTES_PER_ELEMENT,c=o.length;for(let e=0;e<c;++e){const c=s[o[e]],u=r[c],d=a[c],h=new t.constructor(t.buffer,l*u,d);i.set(h,n),r[c]=n,n+=d}return n}function rebatchCPU(e,t){const i=e._indices,n=e._indexOffsets,r=e._indexCounts,a=e._batchIdLookUp,o=new i.constructor(i.length);let s=t.pop();const l=[s];let c=copyIndicesCPU(i,o,0,n,r,s.batchIds,a);for(s.offset=0,s.count=c;0<t.length;){const e=t.pop();if(Color.equals(e.color,s.color))c=copyIndicesCPU(i,o,c,n,r,e.batchIds,a),s.batchIds=s.batchIds.concat(e.batchIds),s.count=c-s.offset;else{const t=c;c=copyIndicesCPU(i,o,c,n,r,e.batchIds,a),e.offset=t,e.count=c-t,l.push(e),s=e}}e._va.indexBuffer.copyFromArrayView(o),e._indices=o,e._batchedIndices=l}function copyIndicesGPU(t,i,n,r,a,o,s){const l=t.bytesPerIndex,c=o.length;for(let e=0;e<c;++e){const c=s[o[e]],u=r[c],d=a[c];i.copyFromBuffer(t,u*l,n*l,d*l),r[c]=n,n+=d}return n}function rebatchGPU(e,t){var i=e._indexOffsets,n=e._indexCounts,r=e._batchIdLookUp;let a=t.pop();const o=[a],s=e._va.indexBuffer,l=e._vaSwap.indexBuffer;let c=copyIndicesGPU(s,l,0,i,n,a.batchIds,r);for(a.offset=0,a.count=c;0<t.length;){const e=t.pop();if(Color.equals(e.color,a.color
|
||
|
`,s=a+` * vec4(${n}, 1.0)`;else{const t=ModelUtility.getAttributeOrUniformBySemantic(i,"PROJECTION");let e=ModelUtility.getAttributeOrUniformBySemantic(i,"MODELVIEW");defined(e)||(e=ModelUtility.getAttributeOrUniformBySemantic(i,"CESIUM_RTC_MODELVIEW")),o=`uniform mat4 ${e};
|
||
|
uniform mat4 ${t};
|
||
|
`,s=`${t} * ${e} * vec4(${n}, 1.0)`}let l=`attribute vec3 ${n};
|
||
|
attribute float ${e};
|
||
|
${o}void main() {
|
||
|
${` vec4 positionInClipCoords = ${s};
|
||
|
`} gl_Position = czm_depthClamp(positionInClipCoords);
|
||
|
}
|
||
|
`;t.extensionsUsed.WEB3D_quantized_attributes&&(l=modifyShaderForQuantizedAttributes$1(l,t));var c=modifyShader$1(l,t._vertexShaderLoaded),a=modifyShader$1("#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\nvoid main() \n{ \n gl_FragColor = vec4(1.0); \n czm_writeDepthClamp();\n}\n",t._classificationShaderLoaded);t._shaderProgram={vertexShaderSource:c,fragmentShaderSource:a,attributeLocations:r}}function getAttributeLocations$2(){return{POSITION:0,_BATCHID:1}}function createVertexArray$4(t){if(t._loadResources.finishedBuffersCreation()&&!defined(t._vertexArray)){const n=t._buffers,r=t.gltf,a=r.accessors,i=r.meshes[0].primitives[0],o=getAttributeLocations$2(),s={};let e;if(ForEach.meshPrimitiveAttribute(i,function(e,t){var i=o[t];if(defined(i)){const o=a[e];s[t]={index:i,vertexBuffer:n[o.bufferView],componentsPerAttribute:numberOfComponentsForType(o.type),componentDatatype:o.componentType,offsetInBytes:o.byteOffset,strideInBytes:getAccessorByteStride(r,o)}}}),defined(i.indices)){const t=a[i.indices];e=n[t.bufferView]}t._vertexArray={attributes:s,indexBuffer:e}}}Object.defineProperties(ClassificationModel.prototype,{gltf:{get:function(){return this._gltf}},boundingSphere:{get:function(){const e=this.modelMatrix,t=Matrix4.getScale(e,boundingSphereCartesian3Scratch$1),i=this._scaledBoundingSphere;return i.center=Cartesian3.multiplyComponents(this._boundingSphere.center,t,i.center),i.radius=Cartesian3.maximumComponent(t)*this._initialRadius,defined(this._rtcCenter)&&Cartesian3.add(this._rtcCenter,i.center,i.center),i}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},dirty:{get:function(){return this._dirty}},extensionsUsed:{get:function(){return defined(this._extensionsUsed)||(this._extensionsUsed=ModelUtility.getUsedExtensions(this.gltf)),this._extensionsUsed}},extensionsRequired:{get:function(){return defined(this._extensionsRequired)||(this._extensionsRequired=ModelUtility.getRequiredExtensions(this.gltf)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return 0}},classificationType:{get:function(){return this._classificationType}}});const gltfSemanticUniforms={PROJECTION:function(e,t){return ModelUtility.getGltfSemanticUniforms().PROJECTION(e,t)},MODELVIEW:function(e,t){return ModelUtility.getGltfSemanticUniforms().MODELVIEW(e,t)},CESIUM_RTC_MODELVIEW:function(e,t){return ModelUtility.getGltfSemanticUniforms().CESIUM_RTC_MODELVIEW(e,t)},MODELVIEWPROJECTION:function(e,t){return ModelUtility.getGltfSemanticUniforms().MODELVIEWPROJECTION(e,t)}};function createUniformMap$5(i,n){if(!defined(i._uniformMap)){const r={};ForEach.technique(i.gltf,function(e){ForEach.techniqueUniform(e,function(e,t){defined(e.semantic)&&defined(gltfSemanticUniforms[e.semantic])&&(r[t]=gltfSemanticUniforms[e.semantic](n.uniformState,i))})}),i._uniformMap=r}}function createUniformsForQuantizedAttributes$1(e,t){return ModelUtility.createUniformsForQuantizedAttributes(e.gltf,t,e._quantizedUniforms)}function triangleCountFromPrimitiveIndices$1(e,t){switch(e.mode){case PrimitiveType$1.TRIANGLES:return t/3;case PrimitiveType$1.TRIANGLE_STRIP:case PrimitiveType$1.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function createPrimitive$2(e){var t=e._batchTable;let i=e._uniformMap;var n=e._vertexArray,r=e.gltf,a=r.accessors,o=r.meshes[0].primitives[0],s=a[o.indices],l=o.attributes.POSITION,c=ModelUtility.getAccessorMinMax(r,l),u=BoundingSphere.fromCornerPoints(Cartesian3.fromArray(c.min),Cartesian3.fromArray(c.max));let d,h;d=defined(s)?(h=s.count,s.byteOffset/IndexDatatype$1.getSizeInBytes(s.componentType)):(h=a[o.attributes.POSITION].count,0),e._trianglesLength+=triangleCountFromPrimitiveIndices$1(o,h),defined(e._uniformMapLoaded)&&(i=e._uniformMapLoaded(i)),e.extensionsUsed.WEB3D_quantized_attributes&&(i=combine$2(i,createUniformsForQuantizedAttributes$1(e,o)));var r=n.attri
|
||
|
vec4 clippingPlanesEdgeColor = vec4(1.0);
|
||
|
clippingPlanesEdgeColor.rgb = ${i}.rgb;
|
||
|
float clippingPlanesEdgeWidth = ${i}.a;
|
||
|
if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth)
|
||
|
{
|
||
|
gl_FragColor = clippingPlanesEdgeColor;
|
||
|
}
|
||
|
`}DracoLoader._maxDecodingConcurrency=Math.max(FeatureDetection.hardwareConcurrency-1,1),DracoLoader._decoderTaskProcessor=void 0,DracoLoader._taskProcessorReady=!1,DracoLoader._getDecoderTaskProcessor=function(){if(!defined(DracoLoader._decoderTaskProcessor)){const e=new TaskProcessor("decodeDraco",DracoLoader._maxDecodingConcurrency);e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(){DracoLoader._taskProcessorReady=!0}),DracoLoader._decoderTaskProcessor=e}return DracoLoader._decoderTaskProcessor},DracoLoader.hasExtension=function(e){return defined(e.extensionsRequired.KHR_draco_mesh_compression)||defined(e.extensionsUsed.KHR_draco_mesh_compression)},DracoLoader._decodedModelResourceCache=void 0,DracoLoader.parse=function(e,t){if(DracoLoader.hasExtension(e)){const a=e._loadResources,i=e.cacheKey;if(defined(i)){defined(DracoLoader._decodedModelResourceCache)||(defined(t.cache.modelDecodingCache)||(t.cache.modelDecodingCache={}),DracoLoader._decodedModelResourceCache=t.cache.modelDecodingCache);const e=DracoLoader._decodedModelResourceCache[i];if(defined(e))return e.count++,void(a.pendingDecodingCache=!0)}const o=e._dequantizeInShader,s=e.gltf;ForEach.mesh(s,function(e,r){ForEach.meshPrimitive(e,function(e,t){var i,n;!defined(e.extensions)||defined(i=e.extensions.KHR_draco_mesh_compression)&&(n=s.bufferViews[i.bufferView],e=arraySlice(s.buffers[n.buffer].extras._pipeline.source,n.byteOffset,n.byteOffset+n.byteLength),a.primitivesToDecode.enqueue({mesh:r,primitive:t,array:e,bufferView:n,compressedAttributes:i.attributes,dequantizeInShader:o}))})})}},DracoLoader.decodeModel=function(e,t){if(!DracoLoader.hasExtension(e))return when.resolve();const i=e._loadResources,n=e.cacheKey;if(defined(n)&&defined(DracoLoader._decodedModelResourceCache)){const t=DracoLoader._decodedModelResourceCache[n];if(defined(t)&&i.pendingDecodingCache)return when(t.ready,function(){e._decodedData=t.data,i.pendingDecodingCache=!1});DracoLoader._decodedModelResourceCache[n]={ready:!1,count:1,data:void 0}}if(0===i.primitivesToDecode.length)return when.resolve();const r=DracoLoader._getDecoderTaskProcessor(),a=[];let o=scheduleDecodingTask(r,e,i);for(;defined(o);)a.push(o),o=scheduleDecodingTask(r,e,i);return when.all(a)},DracoLoader.decodePointCloud=function(e){const t=DracoLoader._getDecoderTaskProcessor();if(DracoLoader._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])},DracoLoader.decodeBufferView=function(e){const t=DracoLoader._getDecoderTaskProcessor();if(DracoLoader._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])},DracoLoader.cacheDataForModel=function(e){var t=e.cacheKey;if(defined(t)&&defined(DracoLoader._decodedModelResourceCache)){const i=DracoLoader._decodedModelResourceCache[t];defined(i)&&(i.ready=!0,i.data=e._decodedData)}},DracoLoader.destroyCachedDataForModel=function(e){e=e.cacheKey;if(defined(e)&&defined(DracoLoader._decodedModelResourceCache)){const t=DracoLoader._decodedModelResourceCache[e];defined(t)&&0==--t.count&&delete DracoLoader._decodedModelResourceCache[e]}};const textureResolutionScratch=new Cartesian2;function getClippingFunction(e,t){var i=e.unionClippingRegions,n=e.length,r=ClippingPlaneCollection.useFloatTexture(t),e=ClippingPlaneCollection.getTextureResolution(e,t,textureResolutionScratch),t=e.x,e=e.y,e=(r?getClippingPlaneFloat:getClippingPlaneUint8)(t,e);return e+="\n",e+=(i?clippingFunctionUnion:clippingFunctionIntersect)(n)}function clippingFunctionUnion(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
|
||
|
{
|
||
|
vec4 position = czm_windowToEyeCoordinates(fragCoord);
|
||
|
vec3 clipNormal = vec3(0.0);
|
||
|
vec3 clipPosition = vec3(0.0);
|
||
|
float clipAmount;
|
||
|
float pixelWidth = czm_metersPerPixel(position);
|
||
|
bool breakAndDiscard = false;
|
||
|
for (int i = 0; i < ${e}; ++i)
|
||
|
{
|
||
|
vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
|
||
|
clipNormal = clippingPlane.xyz;
|
||
|
clipPosition = -clippingPlane.w * clipNormal;
|
||
|
float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
|
||
|
clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
|
||
|
if (amount <= 0.0)
|
||
|
{
|
||
|
breakAndDiscard = true;
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
if (breakAndDiscard) {
|
||
|
discard;
|
||
|
}
|
||
|
return clipAmount;
|
||
|
}
|
||
|
`}function clippingFunctionIntersect(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
|
||
|
{
|
||
|
bool clipped = true;
|
||
|
vec4 position = czm_windowToEyeCoordinates(fragCoord);
|
||
|
vec3 clipNormal = vec3(0.0);
|
||
|
vec3 clipPosition = vec3(0.0);
|
||
|
float clipAmount = 0.0;
|
||
|
float pixelWidth = czm_metersPerPixel(position);
|
||
|
for (int i = 0; i < ${e}; ++i)
|
||
|
{
|
||
|
vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
|
||
|
clipNormal = clippingPlane.xyz;
|
||
|
clipPosition = -clippingPlane.w * clipNormal;
|
||
|
float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
|
||
|
clipAmount = max(amount, clipAmount);
|
||
|
clipped = clipped && (amount <= 0.0);
|
||
|
}
|
||
|
if (clipped)
|
||
|
{
|
||
|
discard;
|
||
|
}
|
||
|
return clipAmount;
|
||
|
}
|
||
|
`}function getClippingPlaneFloat(e,t){t=1/t;let i=""+1/e;-1===i.indexOf(".")&&(i+=".0");let n=""+t;return-1===n.indexOf(".")&&(n+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
|
||
|
{
|
||
|
int pixY = clippingPlaneNumber / ${e};
|
||
|
int pixX = clippingPlaneNumber - (pixY * ${e});
|
||
|
float u = (float(pixX) + 0.5) * ${i};
|
||
|
float v = (float(pixY) + 0.5) * ${n};
|
||
|
vec4 plane = texture2D(packedClippingPlanes, vec2(u, v));
|
||
|
return czm_transformPlane(plane, transform);
|
||
|
}
|
||
|
`}function getClippingPlaneUint8(e,t){t=1/t;let i=""+1/e;-1===i.indexOf(".")&&(i+=".0");let n=""+t;return-1===n.indexOf(".")&&(n+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
|
||
|
{
|
||
|
int clippingPlaneStartIndex = clippingPlaneNumber * 2;
|
||
|
int pixY = clippingPlaneStartIndex / ${e};
|
||
|
int pixX = clippingPlaneStartIndex - (pixY * ${e});
|
||
|
float u = (float(pixX) + 0.5) * ${i};
|
||
|
float v = (float(pixY) + 0.5) * ${n};
|
||
|
vec4 oct32 = texture2D(packedClippingPlanes, vec2(u, v)) * 255.0;
|
||
|
vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
|
||
|
vec4 plane;
|
||
|
plane.xyz = czm_octDecode(oct, 65535.0);
|
||
|
plane.w = czm_unpackFloat(texture2D(packedClippingPlanes, vec2(u + ${i}, v)));
|
||
|
return czm_transformPlane(plane, transform);
|
||
|
}
|
||
|
`}const JobType={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};var JobType$1=Object.freeze(JobType);function ModelAnimationCache(){}const dataUriRegex=/^data\:/i;function getAccessorKey(e,t){var i=e.gltf,n=i.buffers,i=i.bufferViews[t.bufferView],n=n[i.buffer],i=i.byteOffset+t.byteOffset,t=t.count*numberOfComponentsForType(t.type),n=dataUriRegex.test(n.uri)?"":n.uri;return e.cacheKey+`//${n}/${i}/`+t}const cachedAnimationParameters={};ModelAnimationCache.getAnimationParameterValues=function(e,i){var n=getAccessorKey(e,i);let r=cachedAnimationParameters[n];if(!defined(r)){var a=e.gltf,o=a.buffers,s=a.bufferViews[i.bufferView],l=o[s.buffer].extras._pipeline.source,c=i.componentType,u=i.type,d=numberOfComponentsForType(u),h=i.count,p=getAccessorByteStride(a,i);r=new Array(h);i=defaultValue(i.byteOffset,0);let t=s.byteOffset+i;for(let e=0;e<h;e++){const f=ComponentDatatype$1.createArrayBufferView(c,l.buffer,l.byteOffset+t,d);"SCALAR"===u?r[e]=f[0]:"VEC3"===u?r[e]=Cartesian3.fromArray(f):"VEC4"===u&&(r[e]=Quaternion.unpack(f)),t+=p}defined(e.cacheKey)&&(cachedAnimationParameters[n]=r)}return r};const cachedAnimationSplines={};function getAnimationSplineKey(e,t,i){return e.cacheKey+`//${t}/`+i}function ConstantSpline(e){this._value=e}function SteppedSpline(e){this._spline=e,this._lastTimeIndex=0}ConstantSpline.prototype.evaluate=function(e,t){return this._value},ConstantSpline.prototype.wrapTime=function(e){return 0},ConstantSpline.prototype.clampTime=function(e){return 0},SteppedSpline.prototype.findTimeInterval=Spline.prototype.findTimeInterval,SteppedSpline.prototype.evaluate=function(e,t){var i=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),n=this._spline.times,i=e>=n[i+1]?n[i+1]:n[i];return this._spline.evaluate(i,t)},Object.defineProperties(SteppedSpline.prototype,{times:{get:function(){return this._spline.times}}}),SteppedSpline.prototype.wrapTime=function(e){return this._spline.wrapTime(e)},SteppedSpline.prototype.clampTime=function(e){return this._spline.clampTime(e)},ModelAnimationCache.getAnimationSpline=function(e,t,i,n,r,a,o,s){n=getAnimationSplineKey(e,t,n);let l=cachedAnimationSplines[n];if(!defined(l)){const t=a,i=s;1===t.length&&1===i.length?l=new ConstantSpline(i[0]):"LINEAR"!==r.interpolation&&"STEP"!==r.interpolation||("translation"===o||"scale"===o?l=new LinearSpline({times:t,points:i}):"rotation"===o?l=new QuaternionSpline({times:t,points:i}):"weights"===o&&(l=new WeightSpline({times:t,weights:i})),defined(l)&&"STEP"===r.interpolation&&(l=new SteppedSpline(l))),defined(e.cacheKey)&&(cachedAnimationSplines[n]=l)}return l};const cachedSkinInverseBindMatrices={};ModelAnimationCache.getSkinInverseBindMatrices=function(e,i){var n=getAccessorKey(e,i);let r=cachedSkinInverseBindMatrices[n];if(!defined(r)){var a=e.gltf,o=a.buffers,e=a.bufferViews[i.bufferView],s=o[e.buffer].extras._pipeline.source,l=i.componentType,o=i.type,c=i.count,u=getAccessorByteStride(a,i);let t=e.byteOffset+i.byteOffset;var d=numberOfComponentsForType(o);if(r=new Array(c),l===WebGLConstants$1.FLOAT&&o===AttributeType$2.MAT4)for(let e=0;e<c;++e){const i=ComponentDatatype$1.createArrayBufferView(l,s.buffer,s.byteOffset+t,d);r[e]=Matrix4.fromArray(i),t+=u}cachedSkinInverseBindMatrices[n]=r}return r};const ModelAnimationLoop={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};var ModelAnimationLoop$1=Object.freeze(ModelAnimationLoop),ModelAnimationState=Object.freeze({STOPPED:0,ANIMATING:1});function ModelAnimation(e,t,i){this._name=i.name,this._startTime=JulianDate.clone(e.startTime),this._delay=defaultValue(e.delay,0),this._stopTime=e.stopTime,this.removeOnStop=defaultValue(e.removeOnStop,!1),this._multiplier=defaultValue(e.multiplier,1),this._reverse=defaultValue(e.reverse,!1),this._loop=defaultValue(e.loop,ModelAnimationLoop$1.NONE),this.start=new Event,this.update=new Event,this.stop=new Event,this._state=ModelAnimationState.STOPPED,this._runtimeAnimation=i,this._computedStartTime=void 0,this._duration=void 0;const n=this;this._raiseStartEvent=function(){n.start.raiseEvent(t,n)},this._updateEventTime=0,this._raiseUpdateEvent=funct
|
||
|
`+t.message),new RuntimeError(e)},ResourceLoader.prototype.isDestroyed=function(){return!1},ResourceLoader.prototype.destroy=function(){return this.unload(),destroyObject(this)};const ResourceLoaderState={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4};var ResourceLoaderState$1=Object.freeze(ResourceLoaderState);function BufferLoader(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).typedArray,i=e.resource,e=e.cacheKey;this._typedArray=t,this._resource=i,this._cacheKey=e,this._state=ResourceLoaderState$1.UNLOADED,this._promise=when.defer()}function loadExternalBuffer(i){const n=i._resource;i._state=ResourceLoaderState$1.LOADING,BufferLoader._fetchArrayBuffer(n).then(function(e){i.isDestroyed()||(i._typedArray=new Uint8Array(e),i._state=ResourceLoaderState$1.READY,i._promise.resolve(i))}).otherwise(function(e){var t;i.isDestroyed()||(i._state=ResourceLoaderState$1.FAILED,t="Failed to load external buffer: "+n.url,i._promise.reject(i.getError(t,e)))})}defined(Object.create)&&(BufferLoader.prototype=Object.create(ResourceLoader.prototype),BufferLoader.prototype.constructor=BufferLoader),Object.defineProperties(BufferLoader.prototype,{promise:{get:function(){return this._promise.promise}},cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}}),BufferLoader.prototype.load=function(){defined(this._typedArray)?this._promise.resolve(this):loadExternalBuffer(this)},BufferLoader._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()},BufferLoader.prototype.unload=function(){this._typedArray=void 0},function(){var t,a=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if("object"!=typeof WebAssembly)return;WebAssembly.instantiate(function(e){for(var t=new Uint8Array(e.length),i=0;i<e.length;++i){var n=e.charCodeAt(i);t[i]=96<n?n-71:64<n?n-65:47<n?n+4:46<n?63:62}for(var r=0,i=0;i<e.length;++i)t[r++]=t[i]<60?a[t[i]]:64*(t[i]-60)+t[++i];return t.buffer.slice(0,r)}("B9h79tEBBBENQ9gEUEU9gEUB9gBB9gVUUUUUEU9gDUUEU9gLUUUUEU9gIUUUEU9gVUUUUUB9gLUUUUB9gD99UE99Ie8aDILEVOLEVLRRRRRWWVBOOBEdddLVE9wEIIVIEBEOWEUEC+Q/KEKR/QIhO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9fw9u9j9v9kw9WwvTw949C919m9mwvBE8f9tw79o9v9wT9fw9u9j9v9kw9WwvTw949C919m9mwv9C9v919u9kBDe9tw79o9v9wT9fw9u9j9v9kw9WwvTw949Wwv79p9v9uBIy9tw79o9v9wT9fw9u9j9v9kw69u9kw949C919m9mwvBL8e9tw79o9v9wT9fw9u9j9v9kw69u9kw949C919m9mwv9C9v919u9kBO8a9tw79o9v9wT9fw9u9j9v9kw69u9kw949Wwv79p9v9uBRe9tw79o9v9wT9fw9u9j9v9kw69u9kw949Twg91w9u9jwBWA9tw79o9v9wT9fw9u9j9v9kw69u9kw949Twg91w9u9jw9C9v919u9kBdl9tw79o9v9wT9fw9u9j9v9kws9p2Twv9P9jTBQk9tw79o9v9wT9fw9u9j9v9kws9p2Twv9R919hTBKl9tw79o9v9wT9fw9u9j9v9kws9p2Twvt949wBXe9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94j9h9j9owBSA9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94j9h9j9ow9TTv9p9wBZA9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94swT9j9o9Sw9t9h9wBhL79iv9rBodWEBCEKDqxQ+f9Q8aDBK/EpE8jU8jJJJJBCJO9rGV8kJJJJBCBHODNALCEFAE0MBABCBrBJ+KJJBC+gEv86BBAVCJDFCBCJDZnJJJB8aDNAItMBAVCJDFADALZ+TJJJB8aKABAEFHRABCEFHEAVALFCBCBCJDAL9rALCfE0eZnJJJB8aAVAVCJDFALZ+TJJJBHWCJ/ABAL9uHODNAItMBAOC/wfBgGOCJDAOCJD6eHdCBHQINAWCJLFCBCJDZnJJJB8aAdAIAQ9rAQAdFAI6eHKADAQAL2FHXDNALtMBAKCSFGOC9wgHMAOCL4CIFCD4HpCBHSAXHZAEHhINDNAKtMBAWASFrBBHoCBHEAZHOINAWCJLFAEFAOrBBGaAo9rGoCETAoCkTCk91CR4786BBAOALFHOAaHoAECEFGEAK9HMBKKDNARAh9rAp6MBAhCBApZnJJJBGcApFHEDNAMtMBCBHxAWCJLFHqINARAE9rCk6MDAWCJLFAxFGlrBDHoCUHODNAlrBEGaAlrBBGkvCfEgMBCBHaAoCfEgMBCBHoDNAlrBIMBAlrBLMBAlrBVMBAlrBOMBAlrBRMBAlrBWMBAlrBdMBAlrBQMBAlrBKMBAlrBXMBAlrBMMBCBHaAlrBpMECBHoCUCBAlrBSeHOKCBHaKDNDNDNDNCLCDCECWAOCZ6GheAkCfEgGkCD0CLvAaCfEgGaCD0FAoCfEgGoCD0FAlrBIGyCD0FAlrBLG8aCD0FAlrBVGeCD0FAlrBOG3CD0FAlrBRG5CD0FAlrBWG8eCD0FAlrBdG8fCD0FAlrBQGACD0FAlrBKGHCD0FAlrBXGGCD0FAlrBMG8jCD0FAlrBpG8kCD0FAlrBSG8lCD0FG8mAOCZAheG8n6GOeAkCp0CWvAaCp0FAoCp0FAyCp0FA8aCp0FAeCp0FA3Cp0FA5Cp0FA8eCp0FA8fCp0FAACp0FAHCp0FAGCp0FA8jCp0FA8kCp0FA8lCp0FA8mA8nAOe6GoeGyCUFpDIEBKAcAxCO4FGaAarBBCDCIAoeAxCI4COgTv86BBAyCW9HMEAEAl8pBB83BBAECWFAlCWF8pBB83BBAECZFHEXDKAcAxCO4FGaAarBBCEAxCI4COgTv86B
|
||
|
`,B[G]=a.location}createUniformMap$4(e,t);let $="attribute vec3 a_position; \nvarying vec4 v_color; \nuniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; \nuniform vec4 u_constantColor; \nuniform vec4 u_highlightColor; \n";$+="float u_pointSize; \nfloat u_time; \n",S&&($+="float u_geometricError; \nfloat u_depthMultiplier; \n"),$+=F,s&&($+=p?"attribute vec4 a_color; \n":h?"attribute float a_color; \nconst float SHIFT_RIGHT_11 = 1.0 / 2048.0; \nconst float SHIFT_RIGHT_5 = 1.0 / 32.0; \nconst float SHIFT_LEFT_11 = 2048.0; \nconst float SHIFT_LEFT_5 = 32.0; \nconst float NORMALIZE_6 = 1.0 / 64.0; \nconst float NORMALIZE_5 = 1.0 / 32.0; \n":"attribute vec3 a_color; \n"),i&&($+=u||d?"attribute vec2 a_normal; \n":"attribute vec3 a_normal; \n"),g&&($+="attribute float a_batchId; \n"),(l||c||d)&&($+="uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; \n"),w&&($+=T),M&&($+=A),I&&($+=x),$+="void main() \n{ \n u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; \n u_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; \n",S&&($+=" u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; \n u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; \n"),$+=s?p?" vec4 color = a_color; \n":h?" float compressed = a_color; \n float r = floor(compressed * SHIFT_RIGHT_11); \n compressed -= r * SHIFT_LEFT_11; \n float g = floor(compressed * SHIFT_RIGHT_5); \n compressed -= g * SHIFT_LEFT_5; \n float b = compressed; \n vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); \n vec4 color = vec4(rgb, 1.0); \n":" vec4 color = vec4(a_color, 1.0); \n":" vec4 color = u_constantColor; \n",$+=l||c?" vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; \n":" vec3 position = a_position; \n",$+=" vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); \n",i?($+=u?" vec3 normal = czm_octDecode(a_normal); \n":d?" vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; \n":" vec3 normal = a_normal; \n",$+=" vec3 normalEC = czm_normal * normal; \n"):$+=" vec3 normal = vec3(1.0); \n",w&&($+=" color = getColorFromStyle(position, position_absolute, color, normal); \n"),M&&($+=" float show = float(getShowFromStyle(position, position_absolute, color, normal)); \n"),$+=I?" gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; \n":S?" vec4 positionEC = czm_modelView * vec4(position, 1.0); \n float depth = -positionEC.z; \n gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); \n":" gl_PointSize = u_pointSize; \n",$+=" color = color * u_highlightColor; \n",i&&y&&($+=" float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); \n diffuseStrength = max(diffuseStrength, 0.4); \n color.xyz *= diffuseStrength * czm_lightColor; \n"),$+=" v_color = color; \n gl_Position = czm_modelViewProjection * vec4(position, 1.0); \n",i&&_&&($+=" float visible = step(-normalEC.z, 0.0); \n gl_Position *= visible; \n gl_PointSize *= visible; \n"),M&&($+=" gl_Position.w *= float(show); \n gl_PointSize *= float(show); \n"),$+="} \n";let k="varying vec4 v_color; \n";R&&(k+="uniform highp sampler2D u_clippingPlanes; \nuniform mat4 u_clippingPlanesMatrix; \nuniform vec4 u_clippingPlanesEdgeStyle; \n",k+="\n",k+=getClippingFunction(v,o),k+="\n"),k+="void main() \n{ \n gl_FragColor = czm_gammaCorrect(v_color); \n",R&&(k+=getClipAndStyleCode("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),k+="} \n",defined(e._vertexShaderLoaded)&&($=e._vertexShaderLoaded($)),defined(e._fragmentShaderLoaded)&&(k=e._fragmentShaderLoaded(k));const U=e._drawCommand;defined(U.shaderProgram)&&U.shaderProgram.destroy(),U.shaderProgram=ShaderProgram.fromCache({context:o,vertexShaderSource:$,fragmentShaderSource:k,attributeLocations:B});try{U.shaderProgram._bind()}catch(e){throw new RuntimeError("Error generating style
|
||
|
`+e}}function getUniformMapLoaded$1(t){return function(e){return defined(t._batchTable)?t._batchTable.getUniformMapCallback()(e):combine$2(e,{czm_pickColor:function(){return t._pickId.color}})}}function getBatchTableLoaded(n){return function(e,t,i){n._batchTable=new Cesium3DTileBatchTable(n,e,t,i)}}function getPickIdLoaded$1(e){return function(){return defined(e._batchTable)?e._batchTable.getPickId():"czm_pickColor"}}function getGeometricError$2(e){var t=e._tileset.pointCloudShading,i=e._tile.contentBoundingVolume.boundingSphere.volume(),i=CesiumMath.cbrt(i/e.pointsLength);let n=e._tile.geometricError;return 0===n&&(n=defined(t)&&defined(t.baseResolution)?t.baseResolution:i),n}function createFeatures$1(t){var i=t.featuresLength;if(!defined(t._features)&&0<i){const n=new Array(i);for(let e=0;e<i;++e)n[e]=new Cesium3DTileFeature(t,e);t._features=n}}PointCloudEyeDomeLighting.isSupported=isSupported,PointCloudEyeDomeLighting.prototype.update=function(r,a,e,t){if(isSupported(r.context)){let n;this._strength=e.eyeDomeLightingStrength,this._radius=e.eyeDomeLightingRadius*r.pixelRatio,createResources$2(this,r.context);const o=r.commandList,i=o.length;for(n=a;n<i;++n){const a=o[n];if(a.primitiveType===PrimitiveType$1.POINTS&&a.pass!==Pass$1.TRANSLUCENT){let e,t,i=a.derivedCommands.pointCloudProcessor;defined(i)&&(e=i.command,t=i.originalShaderProgram),defined(e)&&!a.dirty&&t===a.shaderProgram&&e.framebuffer===this.framebuffer||(e=DrawCommand.shallowClone(a,e),e.framebuffer=this.framebuffer,e.shaderProgram=getECShaderProgram(r.context,a.shaderProgram),e.castShadows=!1,e.receiveShadows=!1,defined(i)||(i={command:e,originalShaderProgram:a.shaderProgram},a.derivedCommands.pointCloudProcessor=i),i.originalShaderProgram=a.shaderProgram),o[n]=e}}const s=this._clearCommand,l=this._drawCommand;l.boundingVolume=t,o.push(l),o.push(s)}},PointCloudEyeDomeLighting.prototype.isDestroyed=function(){return!1},PointCloudEyeDomeLighting.prototype.destroy=function(){return destroyFramebuffer$1(this),destroyObject(this)},PointCloudShading.isSupported=function(e){return PointCloudEyeDomeLighting.isSupported(e.context)},Object.defineProperties(PointCloud3DTileContent.prototype,{featuresLength:{get:function(){return defined(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return this._pointCloud.pointsLength}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return this._pointCloud.geometryByteLength}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return defined(this._batchTable)?this._batchTable.memorySizeInBytes:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._pointCloud.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}},groupMetadata:{get:function(){return this._groupMetadata},set:function(e){this._groupMetadata=e}}}),PointCloud3DTileContent.prototype.hasProperty=function(e,t){return!!defined(this._batchTable)&&this._batchTable.hasProperty(e,t)},PointCloud3DTileContent.prototype.getFeature=function(e){if(defined(this._batchTable))return this.featuresLength,createFeatures$1(this),this._features[e]},PointCloud3DTileContent.prototype.applyDebugSettings=function(e,t){this._pointCloud.color=e?t:Color.WHITE},PointCloud3DTileContent.prototype.applyStyle=function(e){defined(this._batchTable)?this._batchTable.applyStyle(e):this._styleDirty=!0};const defaultShading$1=new PointCloudShading;function Tileset3DTileContent(e,t,i,n){this._tileset=e,this._tile=t,this._resource=i,this._readyPromise=when.defer(),this.featurePropertiesDirty=!1,this._groupMetadata=void 0,initialize$4(this,n)}function initialize$4(e,t){e._tileset.loadTileset(e._resource,t,e._tile),e._readyPromise.resolve(e)}function VertexArrayFacade(e,t,i,n){var r=VertexArrayFacade._verifyAttributes(t);i=defaultValue(i,0);const a=[],o={};let s,l;var c=r.length;for(let e=0;e<c;++e){const t=r[e];t.vertexBuffer?a
|
||
|
`+e.message),i._readyPromise.reject(new RuntimeError(t))}},ModelExperimentalUtility.getNodeTransform=function(e){return defined(e.matrix)?e.matrix:Matrix4.fromTranslationQuaternionRotationScale(defined(e.translation)?e.translation:Cartesian3.ZERO,defined(e.rotation)?e.rotation:Quaternion.IDENTITY,defined(e.scale)?e.scale:Cartesian3.ONE)},ModelExperimentalUtility.getAttributeBySemantic=function(e,t,i){const n=e.attributes,r=n.length;for(let e=0;e<r;++e){const r=n[e],a=!defined(i)||r.setIndex===i;if(r.semantic===t&&a)return r}},ModelExperimentalUtility.hasQuantizedAttributes=function(t){if(!defined(t))return!1;for(let e=0;e<t.length;e++)if(defined(t[e].quantization))return!0;return!1},ModelExperimentalUtility.getAttributeInfo=function(e){var t=e.semantic,i=e.setIndex;let n,r=!1;defined(t)?(n=VertexAttributeSemantic$1.getVariableName(t,i),r=!0):(n=e.name,n=n.replace(/^_/,""),n=n.toLowerCase());t=/^color_\d+$/.test(n),i=e.type;let a=AttributeType$2.getGlslType(i);t&&(a="vec4");i=defined(e.quantization);let o;return i&&(o=t?"vec4":AttributeType$2.getGlslType(e.quantization.type)),{attribute:e,isQuantized:i,variableName:n,hasSemantic:r,glslType:a,quantizedGlslType:o}};const cartesianMaxScratch=new Cartesian3,cartesianMinScratch=new Cartesian3;ModelExperimentalUtility.createBoundingSphere=function(e,t,i,n){var r=ModelExperimentalUtility.getAttributeBySemantic(e,"POSITION"),e=r.max,r=r.min;let a;if(defined(i)&&defined(n)){const o=Cartesian3.add(r,n,cartesianMinScratch),t=Cartesian3.add(e,i,cartesianMaxScratch);a=BoundingSphere.fromCornerPoints(o,t)}else a=BoundingSphere.fromCornerPoints(r,e);return BoundingSphere.transform(a,t,a),a},ModelExperimentalUtility.correctModelMatrix=function(e,t,i){t===Axis$1.Y?Matrix4.multiplyTransformation(e,Axis$1.Y_UP_TO_Z_UP,e):t===Axis$1.X&&Matrix4.multiplyTransformation(e,Axis$1.X_UP_TO_Z_UP,e),i===Axis$1.Z&&Matrix4.multiplyTransformation(e,Axis$1.Z_UP_TO_X_UP,e)};var FeatureIdStageFS="void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {\ninitializeFeatureIds(featureIds, attributes);\n}\n",FeatureIdStageVS="void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes)\n{\ninitializeFeatureIds(featureIds, attributes);\nsetFeatureIdVaryings();\n}\n";const FeatureIdPipelineStage={};function declareStructsAndFunctions(e){e.addStruct(FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS,FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS,ShaderDestination$1.VERTEX),e.addStruct(FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS,ShaderDestination$1.FRAGMENT),e.addFunction(FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,ShaderDestination$1.VERTEX),e.addFunction(FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,ShaderDestination$1.FRAGMENT),e.addFunction(FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,FeatureIdPipelineStage.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,ShaderDestination$1.VERTEX)}function processInstanceFeatureIds(t,e,i){var n=e.featureIds,r=e.attributes[0].count;for(let e=0;e<n.length;e++){var a=n[e],o="instanceFeatureId_"+e;a instanceof ModelComponents.FeatureIdAttribute?processInstanceAttribute(t,a,o):processImplicitRange(t,a,o,r,1,i)}}function processPrimitiveFeatureIds(t,e,i){var n=e.featureIds,r=ModelExperimentalUtility.getAttributeBySemantic(e,VertexAttributeSemantic$1.POSITION).count;for(let e=0;e<n.length;e++){var a=n[e],o="featureId_"+e;a instanceof ModelComponents.FeatureIdAttribute?processAttribute$1(t,a,o):a instanceof ModelComponents.FeatureIdImplicitRange?processImplicitRange(t,a,o,r,void 0,i):processTexture$1(t,a,o,e,i)}}function processInstanceAttribute(e,t,i){const n=e.shaderBuilder;n.addStructField(FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS,"float",i),n.addStructField(FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,"float",i);var r=t.setIndex,e=i.replace(/_\d+$/,"_"),t="a_"+e+r,e="v_"+e+r,r=`featureIds.${i} = ${t};`,i=`featureI
|
||
|
Geometric error: `+e.geometricError,r++),t.debugShowRenderingStatistics&&(n+=`
|
||
|
Commands: `+e.commandsLength,r++,0<e.content.pointsLength&&(n+=`
|
||
|
Points: `+e.content.pointsLength,r++),0<e.content.trianglesLength&&(n+=`
|
||
|
Triangles: `+e.content.trianglesLength,r++),n+=`
|
||
|
Features: `+e.content.featuresLength,r++),t.debugShowMemoryUsage&&(n+=`
|
||
|
Texture Memory: `+formatMemoryString$1(e.content.texturesByteLength),n+=`
|
||
|
Geometry Memory: `+formatMemoryString$1(e.content.geometryByteLength),r+=2),t.debugShowUrl)if(e.hasMultipleContents){n+="\nUrls:";const t=e.content.innerContentUrls;for(let e=0;e<t.length;e++)n+=`
|
||
|
- `+t[e];r+=t.length}else n+=`
|
||
|
Url: `+e._header.content.uri,r++;i={text:n.substring(1),position:i,font:19-r+"px sans-serif",showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(i)}function updateTileDebugLabels(e,t){let i,n;var r=e._selectedTiles,a=r.length,o=e._emptyTiles,s=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(defined(e.debugPickedTile)){const t=defined(e.debugPickPosition)?e.debugPickPosition:computeTileLabelPosition(e.debugPickedTile);addTileDebugLabel(e.debugPickedTile,e,t).pixelOffset=new Cartesian2(15,-15)}}else{for(i=0;i<a;++i)n=r[i],addTileDebugLabel(n,e,computeTileLabelPosition(n));for(i=0;i<s;++i)n=o[i],(n.hasTilesetContent||n.hasImplicitContent)&&addTileDebugLabel(n,e,computeTileLabelPosition(n))}e._tileDebugLabels.update(t)}function updateTiles(e,t,i){e._styleEngine.applyStyle(e);const n=i.isRender,r=e._statistics,a=t.commandList,o=a.length,s=e._selectedTiles,l=s.length,c=e._emptyTiles,u=c.length,d=e.tileVisible;let h,p;var f=e._skipLevelOfDetail&&e._hasMixedContent&&t.context.stencilBuffer&&0<l;e._backfaceCommands.length=0,f&&(defined(e._stencilClearCommand)||(e._stencilClearCommand=new ClearCommand({stencil:0,pass:Pass$1.CESIUM_3D_TILE,renderState:RenderState.fromCache({stencilMask:StencilConstants$1.SKIP_LOD_MASK})})),a.push(e._stencilClearCommand));var m=a.length;for(h=0;h<l;++h)p=s[h],n&&d.raiseEvent(p),p.update(e,t,i),r.incrementSelectionCounts(p.content),++r.selected;for(h=0;h<u;++h)p=c[h],p.update(e,t,i);let g=a.length-m;if(e._backfaceCommands.trim(),f){const t=e._backfaceCommands.values,i=t.length;for(a.length+=i,h=g-1;0<=h;--h)a[m+i+h]=a[m+h];for(h=0;h<i;++h)a[m+h]=t[h]}g=a.length-o,r.numberOfCommands=g,n&&e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&0<g&&e._pointCloudEyeDomeLighting.update(t,o,e.pointCloudShading,e.boundingSphere),n&&(e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(defined(e._tileDebugLabels)||(e._tileDebugLabels=new LabelCollection),updateTileDebugLabels(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}const scratchStack=[];function destroySubtree(e,t){const i=t,n=scratchStack;for(n.push(t);0<n.length;){var r=(t=n.pop()).children,a=r.length;for(let e=0;e<a;++e)n.push(r[e]);t!==i&&(destroyTile(e,t),--e._statistics.numberOfTilesTotal)}i.children=[]}function unloadTile(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function destroyTile(e,t){e._cache.unloadTile(e,t,unloadTile),t.destroy()}function raiseLoadProgressEvent(e,t){const i=e._statistics,n=e._statisticsLast,r=i.numberOfPendingRequests,a=i.numberOfTilesProcessing,o=n.numberOfPendingRequests,s=n.numberOfTilesProcessing;Cesium3DTilesetStatistics.clone(i,n);var l=r!==o||a!==s;l&&t.afterRender.push(function(){e.loadProgress.raiseEvent(r,a)}),e._tilesLoaded=0===i.numberOfPendingRequests&&0===i.numberOfTilesProcessing&&0===i.numberOfAttemptedRequests,l&&e._tilesLoaded&&(t.afterRender.push(function(){e.allTilesLoaded.raiseEvent()}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){e.initialTilesLoaded.raiseEvent()})))}function resetMinimumMaximum(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function detectModelMatrixChanged(e,t){t.frameNumber===e._updatedModelMatrixFrame&&defined(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!Matrix4.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=Matrix4.clone(e.modelMatrix,e._previousModelMatrix)))}function update$1(t,i,n,r){if(i.mode===SceneMode$1.MORPHING
|
||
|
{
|
||
|
return ${r.expression.getShaderExpression(i,n)};
|
||
|
}
|
||
|
`}return t=""+r+` ${e}
|
||
|
{
|
||
|
${t} return ${r}(1.0);
|
||
|
}
|
||
|
`,t}},ConditionsExpression.prototype.getVariables=function(){let t=[];var i=this._runtimeConditions;if(!defined(i)||0===i.length)return t;const n=i.length;for(let e=0;e<n;++e){const n=i[e];t.push.apply(t,n.condition.getVariables()),t.push.apply(t,n.expression.getVariables())}return t=t.filter(function(e,t,i){return i.indexOf(e)===t}),t},Object.defineProperties(Cesium3DTileStyle.prototype,{style:{get:function(){return this._style}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},show:{get:function(){return this._show},set:function(e){this._show=getExpression(this,e),this._style.show=getJsonFromExpression(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=getExpression(this,e),this._style.color=getJsonFromExpression(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=getExpression(this,e),this._style.pointSize=getJsonFromExpression(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=getExpression(this,e),this._style.pointOutlineColor=getJsonFromExpression(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=getExpression(this,e),this._style.pointOutlineWidth=getJsonFromExpression(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=getExpression(this,e),this._style.labelColor=getJsonFromExpression(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=getExpression(this,e),this._style.labelOutlineColor=getJsonFromExpression(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=getExpression(this,e),this._style.labelOutlineWidth=getJsonFromExpression(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=getExpression(this,e),this._style.font=getJsonFromExpression(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=getExpression(this,e),this._style.labelStyle=getJsonFromExpression(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=getExpression(this,e),this._style.labelText=getJsonFromExpression(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=getExpression(this,e),this._style.backgroundColor=getJsonFromExpression(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=getExpression(this,e),this._style.backgroundPadding=getJsonFromExpression(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=getExpression(this,e),this._style.backgroundEnabled=getJsonFromExpression(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=getExpression(this,e),this._style.scaleByDistance=getJsonFromExpression(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=getExpression(this,e),this._style.translucencyByDistance=getJsonFromExpression(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=getExpression(this,e),this._style.distanceDisplayCondition=getJsonFromExpression(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=getExpression(this,e),this._style.heightOffset=getJsonFromExpression(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorL
|
||
|
`;else switch("st"===t&&(n="vec2"),n){case"float":a=`vec4 getColor() { return vec4(vec3(${r}), 1.0); }
|
||
|
`;break;case"vec2":a=`vec4 getColor() { return vec4(${r}, 0.0, 1.0); }
|
||
|
`;break;case"vec3":a=`vec4 getColor() { return vec4(${r}, 1.0); }
|
||
|
`;break;case"vec4":a=`vec4 getColor() { return ${r}; }
|
||
|
`}var o=`attribute vec3 position3DHigh;
|
||
|
attribute vec3 position3DLow;
|
||
|
attribute float batchId;
|
||
|
${i?"":`attribute ${n} ${t};
|
||
|
`}varying ${n} ${r};
|
||
|
void main()
|
||
|
{
|
||
|
vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);
|
||
|
${i?r+` = czm_batchTable_${t}(batchId);
|
||
|
`:r+` = ${t};
|
||
|
`}gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
||
|
}`,s=`varying ${n} ${r};
|
||
|
${a}
|
||
|
void main()
|
||
|
{
|
||
|
gl_FragColor = getColor();
|
||
|
}`;this.material=void 0,this.translucent=defaultValue(e.translucent,!1),this._vertexShaderSource=defaultValue(e.vertexShaderSource,o),this._fragmentShaderSource=defaultValue(e.fragmentShaderSource,s),this._renderState=Appearance.getDefaultRenderState(!1,!1,e.renderState),this._closed=defaultValue(e.closed,!1),this._attributeName=t,this._glslDatatype=n}function DebugCameraPrimitive(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=defaultValue(e.color,Color.CYAN),this._updateOnChange=defaultValue(e.updateOnChange,!0),this.show=defaultValue(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}CreditDisplay.prototype.addCredit=function(e){if(e._isIon)return defined(this._defaultCredit)||(this._defaultCredit=Credit.clone(getDefaultCredit())),void(this._currentCesiumCredit=this._defaultCredit);setCredit(this,e.showOnScreen?this._currentFrameCredits.screenCredits:this._currentFrameCredits.lightboxCredits,e)},CreditDisplay.prototype.addDefaultCredit=function(e){const t=this._defaultCredits;contains(t,e)||t.push(e)},CreditDisplay.prototype.removeDefaultCredit=function(e){const t=this._defaultCredits,i=t.indexOf(e);-1!==i&&t.splice(i,1)},CreditDisplay.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0},CreditDisplay.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1},CreditDisplay.prototype.update=function(){this._expanded&&styleLightboxContainer(this)},CreditDisplay.prototype.beginFrame=function(){const e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;const t=e.screenCredits;t.removeAll();var i=this._defaultCredits;for(let e=0;e<i.length;++e)setCredit(this,t,i[e],Number.MAX_VALUE);e.lightboxCredits.removeAll(),Credit.equals(CreditDisplay.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Credit.clone(CreditDisplay.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit},CreditDisplay.prototype.endFrame=function(){var e=this._currentFrameCredits.screenCredits.values;displayCredits(this._screenContainer,e,this._delimiter,void 0);e=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=0<e.length?"inline":"none",displayCredits(this._creditList,e,void 0,"li"),swapCesiumCredit(this)},CreditDisplay.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),destroyObject(this)},CreditDisplay.prototype.isDestroyed=function(){return!1},CreditDisplay._cesiumCredit=void 0,CreditDisplay._cesiumCreditInitialized=!1,Object.defineProperties(CreditDisplay,{cesiumCredit:{get:function(){return getDefaultCredit(),CreditDisplay._cesiumCredit},set:function(e){CreditDisplay._cesiumCredit=e,CreditDisplay._cesiumCreditInitialized=!0}}}),CreditDisplay.CreditDisplayElement=CreditDisplayElement,Object.defineProperties(DebugAppearance.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}}),DebugAppearance.prototype.getFragmentShaderSource=Appearance.prototype.getFragmentShaderSource,DebugAppearance.prototype.isTranslucent=Appearance.prototype.isTranslucent,DebugAppearance.prototype.getRenderState=Appearance.prototype.getRenderState;const scratchRight$2=new Cartesian3,scratchRotation=new Matrix3,scratchOrientation=new Quaternion,scratchPerspective=new PerspectiveFrustum,scratchPerspectiveOffCenter=new PerspectiveOffCenterFrustum,scratchOrthographic=new OrthographicFrustum,scratchOrthographicOffCenter=new OrthographicOffCenterFrustum,scratchColor$1=new Color,scratchSplits$1=[1,1e5];function
|
||
|
`,l+=` gl_FragData[${a[s]}].rgb *= debugShowFrustumsColor;
|
||
|
`;else l+=" gl_FragColor.rgb *= debugShowCommandsColor;\n",l+=" gl_FragColor.rgb *= debugShowFrustumsColor;\n";l+="}",r.sources.push(l);t=getAttributeLocations(n);return ShaderProgram.fromCache({context:i,vertexShaderSource:n.vertexShaderSource,fragmentShaderSource:r,attributeLocations:t})}DebugCameraPrimitive.prototype.update=function(a){if(this.show){const h=this._planesPrimitives,p=this._outlinePrimitives;let r,e;if(this._updateOnChange){for(e=h.length,r=0;r<e;++r)p[r]=p[r]&&p[r].destroy(),h[r]=h[r]&&h[r].destroy();h.length=0,p.length=0}if(0===h.length){const a=this._camera,e=a.frustum;let t,i;t=e instanceof PerspectiveFrustum?scratchPerspective:e instanceof PerspectiveOffCenterFrustum?scratchPerspectiveOffCenter:e instanceof OrthographicFrustum?scratchOrthographic:scratchOrthographicOffCenter,t=e.clone(t);let n=this._frustumSplits;i=!defined(n)||n.length<=1?(n=scratchSplits$1,n[0]=this._camera.frustum.near,n[1]=this._camera.frustum.far,1):n.length-1;var o=a.positionWC,s=a.directionWC,l=a.upWC,c=a.rightWC,c=Cartesian3.negate(c,scratchRight$2),u=scratchRotation;Matrix3.setColumn(u,0,c,u),Matrix3.setColumn(u,1,l,u),Matrix3.setColumn(u,2,s,u);var d=Quaternion.fromRotationMatrix(u,scratchOrientation);for(h.length=p.length=i,r=0;r<i;++r)t.near=n[r],t.far=n[r+1],h[r]=new Primitive$3({geometryInstances:new GeometryInstance({geometry:new FrustumGeometry({origin:o,orientation:d,frustum:t,_drawNearPlane:0===r}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(Color.fromAlpha(this._color,.1,scratchColor$1))},id:this.id,pickPrimitive:this}),appearance:new PerInstanceColorAppearance({translucent:!0,flat:!0}),asynchronous:!1}),p[r]=new Primitive$3({geometryInstances:new GeometryInstance({geometry:new FrustumOutlineGeometry({origin:o,orientation:d,frustum:t,_drawNearPlane:0===r}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})}for(e=h.length,r=0;r<e;++r)p[r].update(a),h[r].update(a)}},DebugCameraPrimitive.prototype.isDestroyed=function(){return!1},DebugCameraPrimitive.prototype.destroy=function(){var t=this._planesPrimitives.length;for(let e=0;e<t;++e)this._outlinePrimitives[e]=this._outlinePrimitives[e]&&this._outlinePrimitives[e].destroy(),this._planesPrimitives[e]=this._planesPrimitives[e]&&this._planesPrimitives[e].destroy();return destroyObject(this)};const scratchFrustumColor=new Color;function createDebugShowFrustumsUniformMap(e,t){let i;return i=defined(t.uniformMap)?t.uniformMap:{},defined(i.debugShowCommandsColor)||defined(i.debugShowFrustumsColor)||(i.debugShowCommandsColor=function(){return e.debugShowCommands?(defined(t._debugColor)||(t._debugColor=Color.fromRandom()),t._debugColor):Color.WHITE},i.debugShowFrustumsColor=function(){return e.debugShowFrustums?(scratchFrustumColor.red=1&t.debugOverlappingFrustums?1:0,scratchFrustumColor.green=2&t.debugOverlappingFrustums?1:0,scratchFrustumColor.blue=4&t.debugOverlappingFrustums?1:0,scratchFrustumColor.alpha=1,scratchFrustumColor):Color.WHITE}),i}const scratchShowFrustumCommand=new DrawCommand;function DebugModelMatrixPrimitive(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.length=defaultValue(e.length,1e7),this._length=void 0,this.width=defaultValue(e.width,2),this._width=void 0,this.show=defaultValue(e.show,!0),this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._modelMatrix=new Matrix4,this.id=e.id,this._id=void 0,this._primitive=void 0}DebugInspector.prototype.executeDebugShowFrustumsCommand=function(e,t,i){var n=t.shaderProgram.id;let r=this._cachedShowFrustumsShaders[n];defined(r)||(r=createDebugShowFrustumsShaderProgram(e,t.shaderProgram),this._cachedShowFrustumsShaders[n]=r);const a=DrawCommand.shallowClone(t,scratchShowFrustumCommand);a.shaderProgram=r,a.uniformMap=createDebugShowFrustumsUniformMap(e,t),a.execute(e.context,i)},DebugModelMatrixPrimitive.prototype.update=function(e){if(this.show){if(!defined(this._primitive)||!Matrix4.equals(this._modelMatrix,this.modelMatrix
|
||
|
{
|
||
|
czm_non_pick_main();
|
||
|
if (gl_FragColor.a == 0.0) {
|
||
|
discard;
|
||
|
}
|
||
|
gl_FragColor = ${i};
|
||
|
}
|
||
|
`,c=new Array(s+1);for(let e=0;e<s;++e)c[e]=ShaderSource.replaceMain(o[e],"czm_non_pick_main");c[s]=l,a=new ShaderSource({sources:c,defines:a.defines}),n=e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:r})}return n}function getPickRenderState(e,t){const i=e.picking.pickRenderStateCache;let n=i[t.id];if(!defined(n)){const e=RenderState.getState(t);e.blending.enabled=!1,e.depthMask=!0,n=RenderState.fromCache(e),i[t.id]=n}return n}function getHdrShaderProgram(e,t){let i=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(!defined(i)){const n=t._attributeLocations,r=t.vertexShaderSource.clone(),a=t.fragmentShaderSource.clone();r.defines=defined(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),a.defines=defined(a.defines)?a.defines.slice(0):[],a.defines.push("HDR"),i=e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:n})}return i}function DeviceOrientationCameraController(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;const i=this;function t(e){var t=e.alpha;if(!defined(t))return i._alpha=void 0,i._beta=void 0,void(i._gamma=void 0);i._alpha=CesiumMath.toRadians(t),i._beta=CesiumMath.toRadians(e.beta),i._gamma=CesiumMath.toRadians(e.gamma)}window.addEventListener("deviceorientation",t,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",t,!1)}}DerivedCommand.createLogDepthCommand=function(e,t,i){let n;return defined(i)||(i={}),defined(i.command)&&(n=i.command.shaderProgram),i.command=DrawCommand.shallowClone(e,i.command),defined(n)&&i.shaderProgramId===e.shaderProgram.id?i.command.shaderProgram=n:(i.command.shaderProgram=getLogDepthShaderProgram(t,e.shaderProgram),i.shaderProgramId=e.shaderProgram.id),i},DerivedCommand.createPickDerivedCommand=function(e,t,i,n){let r,a;return defined(n)||(n={}),defined(n.pickCommand)&&(r=n.pickCommand.shaderProgram,a=n.pickCommand.renderState),n.pickCommand=DrawCommand.shallowClone(t,n.pickCommand),defined(r)&&n.shaderProgramId===t.shaderProgram.id?(n.pickCommand.shaderProgram=r,n.pickCommand.renderState=a):(n.pickCommand.shaderProgram=getPickShaderProgram$1(i,t.shaderProgram,t.pickId),n.pickCommand.renderState=getPickRenderState(e,t.renderState),n.shaderProgramId=t.shaderProgram.id),n},DerivedCommand.createHdrCommand=function(e,t,i){let n;return defined(i)||(i={}),defined(i.command)&&(n=i.command.shaderProgram),i.command=DrawCommand.shallowClone(e,i.command),defined(n)&&i.shaderProgramId===e.shaderProgram.id?i.command.shaderProgram=n:(i.command.shaderProgram=getHdrShaderProgram(t,e.shaderProgram),i.shaderProgramId=e.shaderProgram.id),i};const scratchQuaternion1=new Quaternion,scratchQuaternion2=new Quaternion,scratchMatrix3=new Matrix3;function rotate(e,t,i,n){var r=e.direction,a=e.right,e=e.up,i=Quaternion.fromAxisAngle(r,i,scratchQuaternion2),n=Quaternion.fromAxisAngle(a,n,scratchQuaternion1),n=Quaternion.multiply(n,i,n),t=Quaternion.fromAxisAngle(e,t,scratchQuaternion2);Quaternion.multiply(t,n,n);n=Matrix3.fromQuaternion(n,scratchMatrix3);Matrix3.multiplyByVector(n,a,a),Matrix3.multiplyByVector(n,e,e),Matrix3.multiplyByVector(n,r,r)}function DirectionalLight(e){this.direction=Cartesian3.clone(e.direction),this.color=Color.clone(defaultValue(e.color,Color.WHITE)),this.intensity=defaultValue(e.intensity,1)}DeviceOrientationCameraController.prototype.update=function(){var e,t,i;defined(this._alpha)&&(defined(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma),e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,i=this._lastGamma-this._gamma,rotate(this._scene.camera,-e,t,i),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma)},DeviceOrientationCameraController.prototype.isDestroyed=function(){return!1},DeviceOrientationCameraController.prototype.destroy=function(){return this._removeListener(),destroyObject(this)};var EllipsoidFS="#ifdef
|
||
|
{
|
||
|
czm_translucent_main();
|
||
|
if (czm_discard)
|
||
|
{
|
||
|
discard;
|
||
|
}
|
||
|
${n}}
|
||
|
`),r=e.shaderCache.createDerivedShaderProgram(t,i,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:a})}return r}function getTranslucentMRTShaderProgram(e,t){return getTranslucentShaderProgram(e,t,"translucentMRT",mrtShaderSource)}function getTranslucentColorShaderProgram(e,t){return getTranslucentShaderProgram(e,t,"translucentMultipass",colorShaderSource)}function getTranslucentAlphaShaderProgram(e,t){return getTranslucentShaderProgram(e,t,"alphaMultipass",alphaShaderSource)}function executeTranslucentCommandsSortedMultipass(e,t,i,n,r,a){let o,s,l;var c=t.context,u=t.frameState.useLogDepth,d=t._hdr,h=n.framebuffer,p=r.length,f=t.frameState.shadowState.lightShadowsEnabled;n.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(c,n),n.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(c,n);var m=e._opaqueFBO.framebuffer;for(n.framebuffer=e._translucentFBO.framebuffer,l=0;l<p;++l)o=r[l],o=u?o.derivedCommands.logDepth.command:o,o=d?o.derivedCommands.hdr.command:o,s=(f&&o.receiveShadows?o.derivedCommands.oit.shadows:o.derivedCommands.oit).translucentCommand,i(s,t,c,n,m);for(defined(a)&&(o=a.unclassifiedCommand,s=(f&&o.receiveShadows?o.derivedCommands.oit.shadows:o.derivedCommands.oit).translucentCommand,i(s,t,c,n,m)),n.framebuffer=e._alphaFBO.framebuffer,l=0;l<p;++l)o=r[l],o=u?o.derivedCommands.logDepth.command:o,o=d?o.derivedCommands.hdr.command:o,s=(f&&o.receiveShadows?o.derivedCommands.oit.shadows:o.derivedCommands.oit).alphaCommand,i(s,t,c,n,m);defined(a)&&(o=a.unclassifiedCommand,s=(f&&o.receiveShadows?o.derivedCommands.oit.shadows:o.derivedCommands.oit).alphaCommand,i(s,t,c,n,m)),n.framebuffer=h}function executeTranslucentCommandsSortedMRT(e,t,i,n,r,a){var o=t.context,s=t.frameState.useLogDepth,l=t._hdr,c=n.framebuffer,u=r.length,d=t.frameState.shadowState.lightShadowsEnabled;n.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(o,n);var h=e._opaqueFBO.framebuffer;let p,f;n.framebuffer=e._translucentFBO.framebuffer;for(let e=0;e<u;++e)p=r[e],p=s?p.derivedCommands.logDepth.command:p,p=l?p.derivedCommands.hdr.command:p,f=(d&&p.receiveShadows?p.derivedCommands.oit.shadows:p.derivedCommands.oit).translucentCommand,i(f,t,o,n,h);defined(a)&&(p=a.unclassifiedCommand,f=(d&&p.receiveShadows?p.derivedCommands.oit.shadows:p.derivedCommands.oit).translucentCommand,i(f,t,o,n,h)),n.framebuffer=c}OIT.prototype.createDerivedCommands=function(r,a,o){if(defined(o)||(o={}),this._translucentMRTSupport){let e,t;defined(o.translucentCommand)&&(e=o.translucentCommand.shaderProgram,t=o.translucentCommand.renderState),o.translucentCommand=DrawCommand.shallowClone(r,o.translucentCommand),defined(e)&&o.shaderProgramId===r.shaderProgram.id?(o.translucentCommand.shaderProgram=e,o.translucentCommand.renderState=t):(o.translucentCommand.shaderProgram=getTranslucentMRTShaderProgram(a,r.shaderProgram),o.translucentCommand.renderState=getTranslucentMRTRenderState(this,a,r.renderState),o.shaderProgramId=r.shaderProgram.id)}else{let e,t,i,n;defined(o.translucentCommand)&&(e=o.translucentCommand.shaderProgram,t=o.translucentCommand.renderState,i=o.alphaCommand.shaderProgram,n=o.alphaCommand.renderState),o.translucentCommand=DrawCommand.shallowClone(r,o.translucentCommand),o.alphaCommand=DrawCommand.shallowClone(r,o.alphaCommand),defined(e)&&o.shaderProgramId===r.shaderProgram.id?(o.translucentCommand.shaderProgram=e,o.translucentCommand.renderState=t,o.alphaCommand.shaderProgram=i,o.alphaCommand.renderState=n):(o.translucentCommand.shaderProgram=getTranslucentColorShaderProgram(a,r.shaderProgram),o.translucentCommand.renderState=getTranslucentColorRenderState(this,a,r.renderState),o.alphaCommand.shaderProgram=getTranslucentAlphaShaderProgram(a,r.shaderProgram),o.alphaCommand.renderState=getTranslucentAlphaRenderState(this,a,r.renderState),o.shaderProgramId=r.shaderProgram.id)}return o},OIT.prototype.executeCommands=function(e,t,i,n,r){(this._translucentMRTSupport?executeTranslucentCommandsSortedMRT:executeTranslucentCommandsSortedMultipass)
|
||
|
if (distance >= shadowMap_lightPositionEC.w)
|
||
|
{
|
||
|
discard;
|
||
|
}
|
||
|
distance /= shadowMap_lightPositionEC.w; // radius
|
||
|
gl_FragColor = czm_packDepth(distance);
|
||
|
`:i?" gl_FragColor = vec4(1.0); \n":" gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",l+="} \n",a.push(l),new ShaderSource({defines:r,sources:a})},ShadowMapShader.getShadowReceiveShaderKeyword=function(e,t,i,n){return"receiveShadow "+e._usesDepthTexture+e._polygonOffsetSupported+e._isPointLight+e._isSpotLight+(1<e._numberOfCascades)+e.debugCascadeColors+e.softShadows+t+i+n},ShadowMapShader.createShadowReceiveVertexShader=function(e,t,i){const n=e.defines.slice(0),r=e.sources.slice(0);return n.push("SHADOW_MAP"),t&&(i?n.push("GENERATE_POSITION_AND_NORMAL"):n.push("GENERATE_POSITION")),new ShaderSource({defines:n,sources:r})},ShadowMapShader.createShadowReceiveFragmentShader=function(e,t,i,n,r){const a=ShaderSource.findNormalVarying(e),o=!n&&defined(a)||n&&r,s=ShaderSource.findPositionVarying(e),l=defined(s),c=t._usesDepthTexture,u=t._polygonOffsetSupported,d=t._isPointLight,h=t._isSpotLight,p=1<t._numberOfCascades,f=t.debugCascadeColors,m=t.softShadows,g=d?t._pointBias:n?t._terrainBias:t._primitiveBias,_=e.defines.slice(0),y=e.sources.slice(0),C=y.length;for(let e=0;e<C;++e)y[e]=ShaderSource.replaceMain(y[e],"czm_shadow_receive_main");d?_.push("USE_CUBE_MAP_SHADOW"):c&&_.push("USE_SHADOW_DEPTH_TEXTURE"),m&&!d&&_.push("USE_SOFT_SHADOWS"),p&&i&&n&&(o?_.push("ENABLE_VERTEX_LIGHTING"):_.push("ENABLE_DAYNIGHT_SHADING")),i&&g.normalShading&&o&&(_.push("USE_NORMAL_SHADING"),0<g.normalShadingSmooth&&_.push("USE_NORMAL_SHADING_SMOOTH"));let v="";return v+=d?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n",v+=`uniform mat4 shadowMap_matrix;
|
||
|
uniform vec3 shadowMap_lightDirectionEC;
|
||
|
uniform vec4 shadowMap_lightPositionEC;
|
||
|
uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness;
|
||
|
uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth;
|
||
|
#ifdef LOG_DEPTH
|
||
|
varying vec3 v_logPositionEC;
|
||
|
#endif
|
||
|
vec4 getPositionEC()
|
||
|
{
|
||
|
${l?` return vec4(${s}, 1.0);
|
||
|
`:"#ifndef LOG_DEPTH \n return czm_windowToEyeCoordinates(gl_FragCoord); \n#else \n return vec4(v_logPositionEC, 1.0); \n#endif \n"}}
|
||
|
vec3 getNormalEC()
|
||
|
{
|
||
|
${o?` return normalize(${a});
|
||
|
`:" return vec3(1.0); \n"}}
|
||
|
void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL)
|
||
|
{
|
||
|
${g.normalOffset&&o?" float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n float normalOffsetScale = 1.0 - nDotL; \n vec3 offset = normalOffset * normalOffsetScale * normalEC; \n positionEC.xyz += offset; \n":""}}
|
||
|
`,v+="void main() \n{ \n czm_shadow_receive_main(); \n vec4 positionEC = getPositionEC(); \n vec3 normalEC = getNormalEC(); \n float depth = -positionEC.z; \n",v+=" czm_shadowParameters shadowParameters; \n shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; \n shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; \n shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; \n shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; \n",n?v+=" shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":u||(v+=" shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),v+=d?" vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; \n float distance = length(directionEC); \n directionEC = normalize(directionEC); \n float radius = shadowMap_lightPositionEC.w; \n // Stop early if the fragment is beyond the point light radius \n if (distance > radius) \n { \n return; \n } \n vec3 directionWC = czm_inverseViewRotation * directionEC; \n shadowParameters.depth = distance / radius; \n shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n shadowParameters.texCoords = directionWC; \n float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); \n":h?" vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); \n float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Spot light uses a perspective projection, so perform the perspective divide \n shadowPosition /= shadowPosition.w; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n":p?" float maxDepth = shadowMap_cascadeSplits[1].w; \n // Stop early if the eye depth exceeds the last cascade \n if (depth > maxDepth) \n { \n return; \n } \n // Get the cascade based on the eye-space depth \n vec4 weights = czm_cascadeWeights(depth); \n // Apply normal offset \n float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n // Transform position into the cascade \n vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; \n // Get visibility \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n // Fade out shadows that are far away \n float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; \n float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); \n visibility = mix(visibility, 1.0, fade); \n"+(f?" // Draw cascade colors for debugging \n gl_FragColor *= czm_cascadeColor(weights); \n":""):" float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n",v+="
|
||
|
varying vec2 v_textureCoordinates;
|
||
|
void main()
|
||
|
{
|
||
|
${e._usesDepthTexture?" float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r; \n":" float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates)); \n"} gl_FragColor = vec4(vec3(shadow), 1.0);
|
||
|
}
|
||
|
`;const n=t.createViewportQuadCommand(i,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return n.pass=Pass$1.OVERLAY,n}function updateDebugShadowViewCommand(e,t){const i=t.context,n=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,a=.3*Math.min(n,r),o=scratchViewport;o.x=n-a,o.y=0,o.width=a,o.height=a;let s=e._debugShadowViewCommand;defined(s)||(s=createDebugShadowViewCommand(e,i),e._debugShadowViewCommand=s),defined(s.renderState)&&BoundingRectangle.equals(s.renderState.viewport,o)||(s.renderState=RenderState.fromCache({viewport:BoundingRectangle.clone(o)})),t.commandList.push(e._debugShadowViewCommand)}const frustumCornersNDC=new Array(8);frustumCornersNDC[0]=new Cartesian4(-1,-1,-1,1),frustumCornersNDC[1]=new Cartesian4(1,-1,-1,1),frustumCornersNDC[2]=new Cartesian4(1,1,-1,1),frustumCornersNDC[3]=new Cartesian4(-1,1,-1,1),frustumCornersNDC[4]=new Cartesian4(-1,-1,1,1),frustumCornersNDC[5]=new Cartesian4(1,-1,1,1),frustumCornersNDC[6]=new Cartesian4(1,1,1,1),frustumCornersNDC[7]=new Cartesian4(-1,1,1,1);const scratchMatrix=new Matrix4,scratchFrustumCorners=new Array(8);for(let e=0;e<8;++e)scratchFrustumCorners[e]=new Cartesian4;function createDebugPointLight(e,t){return new Primitive$3({geometryInstances:[new GeometryInstance({geometry:new BoxOutlineGeometry({minimum:new Cartesian3(-.5,-.5,-.5),maximum:new Cartesian3(.5,.5,.5)}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(t)}}),new GeometryInstance({geometry:new SphereOutlineGeometry({radius:.5}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(t)}})],appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}const debugOutlineColors=[Color.RED,Color.GREEN,Color.BLUE,Color.MAGENTA],scratchScale=new Cartesian3;function applyDebugSettings(t,i){updateDebugShadowViewCommand(t,i);const n=t.debugFreezeFrame&&!t._debugFreezeFrame;if(t._debugFreezeFrame=t.debugFreezeFrame,t.debugFreezeFrame&&(n&&(t._debugCameraFrustum=t._debugCameraFrustum&&t._debugCameraFrustum.destroy(),t._debugCameraFrustum=new DebugCameraPrimitive({camera:t._sceneCamera,color:Color.CYAN,updateOnChange:!1})),t._debugCameraFrustum.update(i)),t._cascadesEnabled){if(t.debugFreezeFrame){n&&(t._debugLightFrustum=t._debugLightFrustum&&t._debugLightFrustum.destroy(),t._debugLightFrustum=new DebugCameraPrimitive({camera:t._shadowMapCamera,color:Color.YELLOW,updateOnChange:!1})),t._debugLightFrustum.update(i);for(let e=0;e<t._numberOfCascades;++e)n&&(t._debugCascadeFrustums[e]=t._debugCascadeFrustums[e]&&t._debugCascadeFrustums[e].destroy(),t._debugCascadeFrustums[e]=new DebugCameraPrimitive({camera:t._passes[e].camera,color:debugOutlineColors[e],updateOnChange:!1})),t._debugCascadeFrustums[e].update(i)}}else if(t._isPointLight){if(!defined(t._debugLightFrustum)||t._needsUpdate){const i=t._shadowMapCamera.positionWC,n=Quaternion.IDENTITY,e=2*t._pointLightRadius,r=Cartesian3.fromElements(e,e,e,scratchScale),a=Matrix4.fromTranslationQuaternionRotationScale(i,n,r,scratchMatrix);t._debugLightFrustum=t._debugLightFrustum&&t._debugLightFrustum.destroy(),t._debugLightFrustum=createDebugPointLight(a,Color.YELLOW)}t._debugLightFrustum.update(i)}else defined(t._debugLightFrustum)&&!t._needsUpdate||(t._debugLightFrustum=new DebugCameraPrimitive({camera:t._shadowMapCamera,color:Color.YELLOW,updateOnChange:!1})),t._debugLightFrustum.update(i)}function ShadowMapCamera(){this.viewMatrix=new Matrix4,this.inverseViewMatrix=new Matrix4,this.frustum=void 0,this.positionCartographic=new Cartographic,this.positionWC=new Cartesian3,this.directionWC=Cartesian3.clone(Cartesian3.UNIT_Z),this.upWC=Cartesian3.clone(Cartesian3.UNIT_Y),this.rightWC=Cartesian3.clone(Cartesian3.UNIT_X),this.viewProjectionMatrix=new Matrix4}ShadowMapCamera.prototype.clone=function(e){Matrix4.clone(e.viewMatrix,this.viewMatrix),Matrix4.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),Cartographic.clone(e.positionCartographic,this.positionCartographic),Cartesia
|
||
|
`+e}function getUniformMapLoaded(t){return function(e){return combine$2(e,{czm_pickColor:function(){return t._pickId.color}})}}function getPickIdLoaded(){return"czm_pickColor"}Object.defineProperties(TimeDynamicPointCloud.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ClippingPlaneCollection.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(defined(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}},readyPromise:{get:function(){return this._readyPromise.promise}}}),TimeDynamicPointCloud.prototype.makeStyleDirty=function(){this._styleDirty=!0},TimeDynamicPointCloud.prototype._getAverageLoadTime=function(){return 0===this._runningLength?.05:this._runningAverage};const scratchDate=new JulianDate;function getClockMultiplier(e){var t=e._clock,e=t.canAnimate&&t.shouldAnimate,t=t.multiplier;return e?t:0}function getIntervalIndex(e,t){return e._intervals.indexOf(t.start)}function getNextInterval(t,i){const n=t._intervals,r=t._clock,a=getClockMultiplier(t);if(0!==a){var o=t._getAverageLoadTime(),o=JulianDate.addSeconds(r.currentTime,o*a,scratchDate);let e=n.indexOf(o);return e===getIntervalIndex(t,i)&&(0<=a?++e:--e),n.get(e)}}function getCurrentInterval(e){const t=e._intervals,i=e._clock.currentTime,n=t.indexOf(i);return t.get(n)}function reachedInterval(e,t,i){var n=getClockMultiplier(e),t=getIntervalIndex(e,t),i=getIntervalIndex(e,i);return 0<=n?i<=t:t<=i}function handleFrameFailure(t,i){return function(e){e=defined(e.message)?e.message:e.toString();0<t.frameFailed.numberOfListeners?t.frameFailed.raiseEvent({uri:i,message:e}):(console.log("A frame failed to load: "+i),console.log("Error: "+e))}}function requestFrame(t,e,i){const n=getIntervalIndex(t,e),r=t._frames;let a=r[n];var o;return defined(a)||(o=defined(o=e.data.transform)?Matrix4.fromArray(o):void 0,e=e.data.uri,a={pointCloud:void 0,transform:o,timestamp:getTimestamp$1(),sequential:!0,ready:!1,touchedFrameNumber:i.frameNumber},r[n]=a,Resource.fetchArrayBuffer({url:e}).then(function(e){return a.pointCloud=new PointCloud({arrayBuffer:e,cull:!0,fragmentShaderLoaded:getFragmentShaderLoaded,uniformMapLoaded:getUniformMapLoaded(t),pickIdLoaded:getPickIdLoaded}),a.pointCloud.readyPromise}).otherwise(handleFrameFailure(t,e))),a}function updateAverageLoadTime(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function prepareFrame(e,t,i,n){t.touchedFrameNumber<n.frameNumber-1&&(t.sequential=!1);var r=t.pointCloud;if(defined(r)&&!t.ready){const a=n.commandList,o=a.length;renderFrame(e,t,i,n),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,a.length=o,t.sequential)&&updateAverageLoadTime(e,(getTimestamp$1()-t.timestamp)/1e3)}t.touchedFrameNumber=n.frameNumber}const scratchModelMatrix=new Matrix4;function getGeometricError(e,t){e=e.shading;return defined(e)&&defined(e.baseResolution)?e.baseResolution:defined(t.boundingSphere)?CesiumMath.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function getMaximumAttenuation(e){e=e.shading;return defined(e)&&defined(e.maximumAttenuation)?e.maximumAttenuation:10}const defaultShading=new PointCloudShading;function renderFrame(e,t,i,n){const r=defaultValue(e.shading,defaultShading),a=t.pointCloud,o=defaultValue(t.transform,Matrix4.IDENTITY);a.modelMatrix=Matrix4.multiplyTransformation(e.modelMatrix,o,scratchModelMatrix),a.style=e.style,a.time=i.timeSinceLoad,a.shadows=e.shadows,a.clippingPlanes=e._clippingPlanes,a.isClipped=i.isClipped,a.attenuation=r.attenuation,a.backFaceCulling=r.backFaceCulling,a.normalShading=r.normalShading,a.geometricError=getGeometricError(e,a),a.geometricErrorScale=r.geometricErrorScale,a.maximumAttenuation=getMaximumAttenuation(e),a.update(n),t.touchedFrameNumber=n.frameNumber}function loadFra
|
||
|
`);for(let e=0;e<a.components;e++){const i="v"+n.length,o=`o${t.toFixed(0)} + `+(a.offset/t+e).toFixed(0);r+=`this.${getArrayViewName(a.type)}[${o}] = ${i};
|
||
|
`,n.push(i)}}return r+="return i;",new Function(n.toString(),r)}function createMemberComponentString(e,t){t="this._pos"+sizeOf(e.type).toFixed(0)+" + "+(e.offset/sizeOf(e.type)+t).toFixed(0);return`this._structArray.${getArrayViewName(e.type)}[${t}]`}function createGetter(e,t){return new Function(`return ${createMemberComponentString(e,t)};`)}function createSetter(e,t){return new Function("x",createMemberComponentString(e,t)+" = x;")}function createElementArrayType(e){return createStructArrayType({members:[{type:"Uint16",name:"vertices",components:e||3}]})}function createVertexArrayType(e){return createStructArrayType({members:e,alignment:4})}const UniformType={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"};var UniformType$1=Object.freeze(UniformType);function TextureManager(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}function fetchTexture2D(t,i,n){n.resource.fetchImage().then(function(e){t._loadedImages.push({id:i,image:e,textureUniform:n})}).otherwise(function(){const e=t._textures[i];defined(e)&&e!==t._defaultTexture&&e.destroy(),t._textures[i]=t._defaultTexture})}function createTexture(e,t,i){var n=t.id,r=t.textureUniform,a=r.typedArray,o=r.sampler,o=defined(a)?new Texture({context:i,pixelFormat:r.pixelFormat,pixelDatatype:r.pixelDatatype,source:{arrayBufferView:a,width:r.width,height:r.height},sampler:o,flipY:!1}):new Texture({context:i,source:t.image,sampler:o});const s=e._textures[n];defined(s)&&s!==i.defaultTexture&&s.destroy(),e._textures[n]=o}function CustomShader(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.mode=defaultValue(e.mode,CustomShaderMode$1.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=defaultValue(e.uniforms,defaultValue.EMPTY_OBJECT),this.varyings=defaultValue(e.varyings,defaultValue.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.isTranslucent=defaultValue(e.isTranslucent,!1),this._textureManager=new TextureManager,this._defaultTexture=void 0,this.uniformMap=buildUniformMap(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},materialSet:{}},findUsedVariables(this),validateBuiltinVariables(this)}function buildUniformMap(e){const t=e.uniforms,i={};for(const r in t){var n;t.hasOwnProperty(r)&&((n=t[r]).type===UniformType$1.SAMPLER_2D?(e._textureManager.loadTexture2D(r,n.value),i[r]=createUniformTexture2DFunction(e,r)):i[r]=createUniformFunction(e,r))}return i}function createUniformTexture2DFunction(e,t){return function(){return defaultValue(e._textureManager.getTexture(t),e._defaultTexture)}}function createUniformFunction(e,t){return function(){return e.uniforms[t].value}}function getVariables(e,t,i){for(var n;null!==(n=t.exec(e));)i[n[1]]=!0}function findUsedVariables(e){var t=/[vf]sInput\.attributes\.(\w+)/g,i=/[vf]sInput\.featureIds\.(\w+)/g;let n;var r=e.vertexShaderText;defined(r)&&(n=e.usedVariablesVertex.attributeSet,getVariables(r,t,n),n=e.usedVariablesVertex.featureIdSet,getVariables(r,i,n));r=e.fragmentShaderText;defined(r)&&(n=e.usedVariablesFragment.attributeSet,getVariables(r,t,n),n=e.usedVariablesFragment.featureIdSet,getVariables(r,i,n),getVariables(r,/material\.(\w+)/g,e.usedVariablesFragment.materialSet))}function expandCoordinateAbbreviations(e){return/^.*MC$/.test(e)?e+" (model coordinates)":/^.*WC$/.test(e)?e+" (Cartesian world coordinates)":/^.*EC$/.test(e)?e+" (eye coordinates)":e}function validateVariableUsage(e,t,i,n){if(e.hasOwnProperty(t))throw new DeveloperError(`${expandCoordinateAbbreviations(t)} is not available in the ${n} shader. Did you mean ${expandCoordinateAbbreviations(i)} instead?`)}function validateBuiltinVariables(e){var t=e.usedVariablesVertex.attributeSet;validateVariableUsage(t,"position","positionMC","vertex"),validateVariableUsage(t,"nor
|
||
|
`+t:defined(e)?e:t}),this.buttonImageUrl=void 0,knockout.defineProperty(this,"buttonImageUrl",function(){var e=this.selectedImagery;if(defined(e))return e.iconUrl}),this.selectedImagery=void 0;const l=knockout.observable();this._currentImageryProviders=[],knockout.defineProperty(this,"selectedImagery",{get:function(){return l()},set:function(n){if(l()!==n){let t;const r=this._currentImageryProviders,e=r.length,a=this._globe.imageryLayers;let i=!1;for(t=0;t<e;t++){const n=a.length;for(let e=0;e<n;e++){const n=a.get(e);if(n.imageryProvider===r[t]){a.remove(n),i=!0;break}}}if(defined(n)){const r=n.creationCommand();if(Array.isArray(r)){for(t=r.length-1;0<=t;t--)a.addImageryProvider(r[t],0);this._currentImageryProviders=r.slice(0)}else if(this._currentImageryProviders=[r],i)a.addImageryProvider(r,0);else{const n=a.get(0);defined(n)&&a.remove(n),a.addImageryProvider(r,0)}}l(n),this.dropDownVisible=!1}else this.dropDownVisible=!1}}),this.selectedTerrain=void 0;const c=knockout.observable();knockout.defineProperty(this,"selectedTerrain",{get:function(){return c()},set:function(t){if(c()!==t){let e;defined(t)&&(e=t.creationCommand()),this._globe.depthTestAgainstTerrain=!(e instanceof EllipsoidTerrainProvider),this._globe.terrainProvider=e,c(t),this.dropDownVisible=!1}else this.dropDownVisible=!1}});const u=this;this._toggleDropDown=createCommand(function(){u.dropDownVisible=!u.dropDownVisible}),this.selectedImagery=defaultValue(e.selectedImageryProviderViewModel,i[0]),this.selectedTerrain=defaultValue(e.selectedTerrainProviderViewModel,n[0])}function BaseLayerPicker(e,t){e=getElement(e);const i=new BaseLayerPickerViewModel(t),n=document.createElement("button");n.type="button",n.className="cesium-button cesium-toolbar-button",n.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(n);const r=document.createElement("img");r.setAttribute("draggable","false"),r.className="cesium-baseLayerPicker-selected",r.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),n.appendChild(r);const a=document.createElement("div");a.className="cesium-baseLayerPicker-dropDown",a.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(a);const o=document.createElement("div");o.className="cesium-baseLayerPicker-sectionTitle",o.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),o.innerHTML="Imagery",a.appendChild(o);const s=document.createElement("div");s.className="cesium-baseLayerPicker-section",s.setAttribute("data-bind","foreach: _imageryProviders"),a.appendChild(s);const l=document.createElement("div");l.className="cesium-baseLayerPicker-category",s.appendChild(l);const c=document.createElement("div");c.className="cesium-baseLayerPicker-categoryTitle",c.setAttribute("data-bind","text: name"),l.appendChild(c);const u=document.createElement("div");u.className="cesium-baseLayerPicker-choices",u.setAttribute("data-bind","foreach: providers"),l.appendChild(u);const d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),u.appendChild(d);const h=document.createElement("img");h.className="cesium-baseLayerPicker-itemIcon",h.setAttribute("data-bind","attr: { src: iconUrl }"),h.setAttribute("draggable","false"),d.appendChild(h);const p=document.createElement("div");p.className="cesium-baseLayerPicker-itemLabel",p.setAttribute("data-bind","text: name"),d.appendChild(p);const f=document.createElement("div");f.className="cesium-baseLayerPicker-sectionTitle",f.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),f.innerHTML="Terrain",a.appendChild(f);const m=document.createElement("div");m.className="cesium-baseLayerPicker-section",m.setAttribute("data-bind","foreach: _terrainProviders"),a.appendChild(m);const g=document.createElement("div
|
||
|
${i}
|
||
|
`+t);const r=document.createElement("div");r.className="cesium-widget-errorPanel-message-details collapsed";const o=document.createElement("span");o.className="cesium-widget-errorPanel-more-details",o.appendChild(document.createTextNode("See more...")),r.appendChild(o),r.onclick=function(e){r.removeChild(o),r.appendChild(document.createTextNode(t)),r.className="cesium-widget-errorPanel-message-details",a.className="cesium-widget-errorPanel-content expanded",r.onclick=void 0},s.appendChild(r)}t.innerHTML=`<p>${i}</p>`}const d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",a.appendChild(d);const h=document.createElement("button");h.setAttribute("type","button"),h.className="cesium-button",h.appendChild(document.createTextNode("OK")),h.onclick=function(){defined(l)&&defined(window.removeEventListener)&&window.removeEventListener("resize",l,!1),t.removeChild(r)},d.appendChild(h),t.appendChild(r)},CesiumWidget.prototype.isDestroyed=function(){return!1},CesiumWidget.prototype.destroy=function(){defined(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),destroyObject(this)},CesiumWidget.prototype.resize=function(){var e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,configureCanvasSize(this),configureCameraFrustum(this),this._scene.requestRender())},CesiumWidget.prototype.render=function(){var e;this._canRender?(this._scene.initializeFrame(),e=this._clock.tick(),this._scene.render(e)):this._clock.tick()},Object.defineProperties(FullscreenButtonViewModel.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}}),FullscreenButtonViewModel.prototype.isDestroyed=function(){return!1},FullscreenButtonViewModel.prototype.destroy=function(){document.removeEventListener(Fullscreen.changeEventName,this._callback),destroyObject(this)};const enterFullScreenPath="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",exitFullScreenPath="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function FullscreenButton(e,t){const i=new FullscreenButtonViewModel(t,e=getElement(e));i._exitFullScreenPath=exitFullScreenPath,i._enterFullScreenPath=enterFullScreenPath;const n=document.createElement("button");n.type="button",n.className="cesium-button cesium-fullscreenButton",n.setAttribute("data-bind","attr: { title: tooltip },click:
|
||
|
with responseMessage: `+JSON.stringify(n),a(n)}})}}const VERSION="1.91";exports.AlphaMode=AlphaMode$1,exports.AlphaPipelineStage=AlphaPipelineStage,exports.Animation=Animation,exports.AnimationViewModel=AnimationViewModel,exports.Appearance=Appearance,exports.ApproximateTerrainHeights=ApproximateTerrainHeights,exports.ArcGISTiledElevationTerrainProvider=ArcGISTiledElevationTerrainProvider,exports.ArcGisMapServerImageryProvider=ArcGisMapServerImageryProvider,exports.ArcType=ArcType$1,exports.AssociativeArray=AssociativeArray,exports.AttributeCompression=AttributeCompression,exports.AttributeType=AttributeType$2,exports.AutoExposure=AutoExposure,exports.Autolinker=Autolinker,exports.AutomaticUniforms=AutomaticUniforms,exports.Axis=Axis$1,exports.AxisAlignedBoundingBox=AxisAlignedBoundingBox,exports.B3dmLoader=B3dmLoader,exports.B3dmParser=B3dmParser,exports.BaseLayerPicker=BaseLayerPicker,exports.BaseLayerPickerViewModel=BaseLayerPickerViewModel,exports.BatchTable=BatchTable,exports.BatchTableHierarchy=BatchTableHierarchy,exports.BatchTexture=BatchTexture,exports.BatchTexturePipelineStage=BatchTexturePipelineStage,exports.Batched3DModel3DTileContent=Batched3DModel3DTileContent,exports.Billboard=Billboard,exports.BillboardCollection=BillboardCollection,exports.BillboardGraphics=BillboardGraphics,exports.BillboardVisualizer=BillboardVisualizer,exports.BingMapsGeocoderService=BingMapsGeocoderService,exports.BingMapsImageryProvider=BingMapsImageryProvider,exports.BingMapsStyle=BingMapsStyle$1,exports.BlendEquation=BlendEquation$1,exports.BlendFunction=BlendFunction$1,exports.BlendOption=BlendOption$1,exports.BlendingState=BlendingState$1,exports.BoundingRectangle=BoundingRectangle,exports.BoundingSphere=BoundingSphere,exports.BoundingSphereState=BoundingSphereState$1,exports.BoxEmitter=BoxEmitter,exports.BoxGeometry=BoxGeometry,exports.BoxGeometryUpdater=BoxGeometryUpdater,exports.BoxGraphics=BoxGraphics,exports.BoxOutlineGeometry=BoxOutlineGeometry,exports.BrdfLutGenerator=BrdfLutGenerator,exports.Bucket=Bucket,exports.Buffer=Buffer$1,exports.BufferLoader=BufferLoader,exports.BufferUsage=BufferUsage$1,exports.BufferUtil=BufferUtil,exports.CPUStylingPipelineStage=CPUStylingPipelineStage,exports.CallbackProperty=CallbackProperty,exports.Camera=Camera,exports.CameraEventAggregator=CameraEventAggregator,exports.CameraEventType=CameraEventType$1,exports.CameraFlightPath=CameraFlightPath,exports.Cartesian2=Cartesian2,exports.Cartesian3=Cartesian3,exports.Cartesian4=Cartesian4,exports.Cartographic=Cartographic,exports.CartographicGeocoderService=CartographicGeocoderService,exports.CatmullRomSpline=CatmullRomSpline,exports.Cesium3DTile=Cesium3DTile,exports.Cesium3DTileBatchTable=Cesium3DTileBatchTable,exports.Cesium3DTileColorBlendMode=Cesium3DTileColorBlendMode$1,exports.Cesium3DTileContent=Cesium3DTileContent,exports.Cesium3DTileContentFactory=Cesium3DTileContentFactory,exports.Cesium3DTileContentState=Cesium3DTileContentState$1,exports.Cesium3DTileContentType=Cesium3DTileContentType$1,exports.Cesium3DTileFeature=Cesium3DTileFeature,exports.Cesium3DTileFeatureTable=Cesium3DTileFeatureTable,exports.Cesium3DTileOptimizationHint=Cesium3DTileOptimizationHint$1,exports.Cesium3DTileOptimizations=Cesium3DTileOptimizations,exports.Cesium3DTilePass=Cesium3DTilePass$1,exports.Cesium3DTilePassState=Cesium3DTilePassState,exports.Cesium3DTilePointFeature=Cesium3DTilePointFeature,exports.Cesium3DTileRefine=Cesium3DTileRefine$1,exports.Cesium3DTileStyle=Cesium3DTileStyle,exports.Cesium3DTileStyleEngine=Cesium3DTileStyleEngine,exports.Cesium3DTilesInspector=Cesium3DTilesInspector,exports.Cesium3DTilesInspectorViewModel=Cesium3DTilesInspectorViewModel,exports.Cesium3DTileset=Cesium3DTileset,exports.Cesium3DTilesetCache=Cesium3DTilesetCache,exports.Cesium3DTilesetGraphics=Cesium3DTilesetGraphics,exports.Cesium3DTilesetHeatmap=Cesium3DTilesetHeatmap,exports.Cesium3DTilesetMetadata=Cesium3DTilesetMetadata,exports.Cesium3DTilesetMostDetailedTraversal=Cesium3DTilesetMostDetailedTraversal,exports.Cesium3DTilesetStatistics=Cesium3DTilesetStatistics,exp
|