62 lines
129 KiB
JavaScript
62 lines
129 KiB
JavaScript
|
/**
|
||
|
* Cesium - https://github.com/AnalyticalGraphicsInc/cesium
|
||
|
*
|
||
|
* Copyright 2011-2017 Cesium Contributors
|
||
|
*
|
||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*
|
||
|
* Columbus View (Pat. Pend.)
|
||
|
*
|
||
|
* Portions licensed separately.
|
||
|
* See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details.
|
||
|
*/
|
||
|
/**
|
||
|
@license
|
||
|
mersenne-twister.js - https://gist.github.com/banksean/300494
|
||
|
|
||
|
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
|
||
|
All rights reserved.
|
||
|
|
||
|
Redistribution and use in source and binary forms, with or without
|
||
|
modification, are permitted provided that the following conditions
|
||
|
are met:
|
||
|
|
||
|
1. Redistributions of source code must retain the above copyright
|
||
|
notice, this list of conditions and the following disclaimer.
|
||
|
|
||
|
2. Redistributions in binary form must reproduce the above copyright
|
||
|
notice, this list of conditions and the following disclaimer in the
|
||
|
documentation and/or other materials provided with the distribution.
|
||
|
|
||
|
3. The names of its contributors may not be used to endorse or promote
|
||
|
products derived from this software without specific prior written
|
||
|
permission.
|
||
|
|
||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||
|
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||
|
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||
|
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||
|
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
|
*/
|
||
|
|
||
|
!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(n,a){if(!e(a))throw new t(r(n))},a.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},a.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},a.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},a.typeOf.number.lessThan=function(e,r,n){if(a.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(e,r,n){if(a.typeOf.number(e,r),n>=r)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),n>r)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},a.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},a.typeOf.number.equals=function(e,r,n,i){if(a.typeOf.number(e,n),a.typeOf.number(r,i),n!==i)throw new t(e+" must be equal to "+r+", the actual values are "+n+" and "+i)},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e&&null!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";var a={};a.Radious=6378137,a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14
|
||
|
t.typeOf.object("result",n);var a=r.x,i=r.y,o=r.z,u=e[0]*a+e[3]*i+e[6]*o,s=e[1]*a+e[4]*i+e[7]*o,c=e[2]*a+e[5]*i+e[8]*o;return n.x=u,n.y=s,n.z=c,n},s.multiplyByScalar=function(e,r,n){return t.typeOf.object("matrix",e),t.typeOf.number("scalar",r),t.typeOf.object("result",n),n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*r,n},s.multiplyByScale=function(e,r,n){return t.typeOf.object("matrix",e),t.typeOf.object("scale",r),t.typeOf.object("result",n),n[0]=e[0]*r.x,n[1]=e[1]*r.x,n[2]=e[2]*r.x,n[3]=e[3]*r.y,n[4]=e[4]*r.y,n[5]=e[5]*r.y,n[6]=e[6]*r.z,n[7]=e[7]*r.z,n[8]=e[8]*r.z,n},s.negate=function(e,r){return t.typeOf.object("matrix",e),t.typeOf.object("result",r),r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=-e[3],r[4]=-e[4],r[5]=-e[5],r[6]=-e[6],r[7]=-e[7],r[8]=-e[8],r},s.transpose=function(e,r){t.typeOf.object("matrix",e),t.typeOf.object("result",r);var n=e[0],a=e[3],i=e[6],o=e[1],u=e[4],s=e[7],c=e[2],f=e[5],l=e[8];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=f,r[8]=l,r};var h=[1,0,0],_=[2,2,1],y=new s,d=new s;return s.computeEigenDecomposition=function(e,r){t.typeOf.object("matrix",e);var a=u.EPSILON20,i=10,o=0,E=0;n(r)||(r={});for(var p=r.unitary=s.clone(s.IDENTITY,r.unitary),h=r.diagonal=s.clone(e,r.diagonal),_=a*c(h);i>E&&f(h)>_;)l(h,y),s.transpose(y,d),s.multiply(h,y,h),s.multiply(d,h,h),s.multiply(p,y,p),++o>2&&(++E,o=0);return r},s.abs=function(e,r){return t.typeOf.object("matrix",e),t.typeOf.object("result",r),r[0]=Math.abs(e[0]),r[1]=Math.abs(e[1]),r[2]=Math.abs(e[2]),r[3]=Math.abs(e[3]),r[4]=Math.abs(e[4]),r[5]=Math.abs(e[5]),r[6]=Math.abs(e[6]),r[7]=Math.abs(e[7]),r[8]=Math.abs(e[8]),r},s.determinant=function(e){t.typeOf.object("matrix",e);var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],f=e[8];return r*(o*f-c*u)+i*(c*a-n*f)+s*(n*u-o*a)},s.inverse=function(e,r){t.typeOf.object("matrix",e),t.typeOf.object("result",r);var n=e[0],a=e[1],o=e[2],c=e[3],f=e[4],l=e[5],E=e[6],p=e[7],h=e[8],_=s.determinant(e);if(Math.abs(_)<=u.EPSILON15)throw new i("matrix is not invertible");r[0]=f*h-p*l,r[1]=p*o-a*h,r[2]=a*l-f*o,r[3]=E*l-c*h,r[4]=n*h-E*o,r[5]=c*o-n*l,r[6]=c*p-E*f,r[7]=E*a-n*p,r[8]=n*f-c*a;var y=1/_;return s.multiplyByScalar(r,y,r)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},s.equalsEpsilon=function(e,r,a){return t.typeOf.number("epsilon",a),e===r||n(e)&&n(r)&&Math.abs(e[0]-r[0])<=a&&Math.abs(e[1]-r[1])<=a&&Math.abs(e[2]-r[2])<=a&&Math.abs(e[3]-r[3])<=a&&Math.abs(e[4]-r[4])<=a&&Math.abs(e[5]-r[5])<=a&&Math.abs(e[6]-r[6])<=a&&Math.abs(e[7]-r[7])<=a&&Math.abs(e[8]-r[8])<=a},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}o.fromElements=function(e,t,n,a,i){return r(i)?(i.x=e,i.y=t,i.z=n,i.w=a,i):new o(e,t,n,a)},o.fromColor=function(t,n){return e.typeOf.object("color",t),r(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w):void 0},o.packe
|
||
|
},s.intersection=function(e,r,a){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",r);var i=e.east,o=e.west,c=r.east,f=r.west;o>i&&c>0?i+=u.TWO_PI:f>c&&i>0&&(c+=u.TWO_PI),o>i&&0>f?f+=u.TWO_PI:f>c&&0>o&&(o+=u.TWO_PI);var l=u.negativePiToPi(Math.max(o,f)),E=u.negativePiToPi(Math.min(i,c));if(!((e.west<e.east||r.west<r.east)&&l>=E)){var p=Math.max(e.south,r.south),h=Math.min(e.north,r.north);if(!(p>=h))return n(a)?(a.west=l,a.south=p,a.east=E,a.north=h,a):new s(l,p,E,h)}},s.simpleIntersection=function(e,r,a){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",r);var i=Math.max(e.west,r.west),o=Math.max(e.south,r.south),u=Math.min(e.east,r.east),c=Math.min(e.north,r.north);return o>=c||i>=u?void 0:n(a)?(a.west=i,a.south=o,a.east=u,a.north=c,a):new s(i,o,u,c)},s.union=function(e,r,a){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",r),n(a)||(a=new s);var i=e.east,o=e.west,c=r.east,f=r.west;o>i&&c>0?i+=u.TWO_PI:f>c&&i>0&&(c+=u.TWO_PI),o>i&&0>f?f+=u.TWO_PI:f>c&&0>o&&(o+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(o,f)),E=u.convertLongitudeRange(Math.max(i,c));return a.west=l,a.south=Math.min(e.south,r.south),a.east=E,a.north=Math.max(e.north,r.north),a},s.expand=function(e,r,a){return t.typeOf.object("rectangle",e),t.typeOf.object("cartographic",r),n(a)||(a=new s),a.west=Math.min(e.west,r.longitude),a.south=Math.min(e.south,r.latitude),a.east=Math.max(e.east,r.longitude),a.north=Math.max(e.north,r.latitude),a},s.contains=function(e,r){t.typeOf.object("rectangle",e),t.typeOf.object("cartographic",r);var n=r.longitude,a=r.latitude,i=e.west,o=e.east;return i>o&&(o+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(o>n||u.equalsEpsilon(n,o,u.EPSILON14))&&a>=e.south&&a<=e.north};var c=new e;return s.subsample=function(e,a,o,f){t.typeOf.object("rectangle",e),a=r(a,i.WGS84),o=r(o,0),n(f)||(f=[]);var l=0,E=e.north,p=e.south,h=e.east,_=e.west,y=c;y.height=o,y.longitude=_,y.latitude=E,f[l]=a.cartographicToCartesian(y,f[l]),l++,y.longitude=h,f[l]=a.cartographicToCartesian(y,f[l]),l++,y.latitude=p,f[l]=a.cartographicToCartesian(y,f[l]),l++,y.longitude=_,f[l]=a.cartographicToCartesian(y,f[l]),l++,0>E?y.latitude=E:p>0?y.latitude=p:y.latitude=0;for(var d=1;8>d;++d)y.longitude=-Math.PI+d*u.PI_OVER_TWO,s.contains(e,y)&&(f[l]=a.cartographicToCartesian(y,f[l]),l++);return 0===y.latitude&&(y.longitude=_,f[l]=a.cartographicToCartesian(y,f[l]),l++,y.longitude=h,f[l]=a.cartographicToCartesian(y,f[l]),l++),f.length=l,f},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,f,l){"use strict";function E(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var p=new e,h=new e,_=new e,y=new e,d=new e,O=new e,T=new e,m=new e,R=new e,A=new e,N=new e,w=new e;E.fromPoints=function(t,r){if(a(r)||(r=new E),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n,i=e.clone(t[0],T),o=e.clone(i,p),u=e.clone(i,h),s=e.clone(i,_),c=e.clone(i,y),f=e.clone(i,d),l=e.clone(i,O),I=t.length;for(n=1;I>n;n++){e.clone(t[n],i);var b=i.x,S=i.y,M=i.z;b<o.x&&e.clone(i,o),b>c.x&&e.clone(i,c),S<u.y&&e.clone(i,u),S>f.y&&e.clone(i,f),M<s.z&&e.clone(i,s),M>l.z&&e.clone(i,l)}var g=e.magnitudeSquared(e.subtract(c,o,m)),v=e.magnitudeSquared(e.subtract(f,u,m)),C=e.magnitudeSquared(e.subtract(l,s,m)),x=o,P=c,L=g;v>L&&(L=v,x=u,P=f),C>L&&(L=C,x=s,P=l);var F=R;F.x=.5*(x.x+P.x),F.y=.5*(x.y+P.y),F.z=.5*(x.z+P.z);var U=e.magnitudeSquared(e.subtract(P,F,m)),D=Math.sqrt(U),B=A;B.x=o.x,B.y=u.y,B.z=s.z;var j=N;j.x=c.x,j.y=f.y,j.z=l.z;var z=e.multiplyByScalar(e.add(B,j,m),.5,w),q=0;for(n=0;I>n;n++){e.clone(t[n],i);var G=e.magnitude(e.subtract(i,z,m));G>q&&(q=G);var V=e.magnitudeSquared(e.subtract(i,F,m));if(V>U){var X=Math.sqrt(V);D=.5*(D+X),U=D*D;var W=X-D;F.x=(D*F.x+W*i.x)/X,F.y=(D*F.y+W*i.y)/X,F.z=(D*F.z+W*i.z)/X}}return q>D?(e.clone(F,r.center),r.radius=D
|
||
|
case o.UNSIGNED_INT:return new Uint32Array(n);case o.FLOAT:return new Float32Array(n);case o.DOUBLE:return new Float64Array(n);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(n,a,i,u){if(!t(n))throw new r("componentDatatype is required.");if(!t(a))throw new r("buffer is required.");switch(i=e(i,0),u=e(u,(a.byteLength-i)/o.getSizeInBytes(n)),n){case o.BYTE:return new Int8Array(a,i,u);case o.UNSIGNED_BYTE:return new Uint8Array(a,i,u);case o.SHORT:return new Int16Array(a,i,u);case o.UNSIGNED_SHORT:return new Uint16Array(a,i,u);case o.INT:return new Int32Array(a,i,u);case o.UNSIGNED_INT:return new Uint32Array(a,i,u);case o.FLOAT:return new Float32Array(a,i,u);case o.DOUBLE:return new Float64Array(a,i,u);default:throw new r("componentDatatype is not a valid value.")}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE;default:throw new r("name is not a valid value.")}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN}};return e(r)}),define("Core/Geometry",["./Check","./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,a,i){"use strict";function o(r){r=t(r,t.EMPTY_OBJECT),e.typeOf.object("options.attributes",r.attributes),this.attributes=r.attributes,this.indices=r.indices,this.primitiveType=t(r.primitiveType,i.TRIANGLES),this.boundingSphere=r.boundingSphere,this.geometryType=t(r.geometryType,a.NONE),this.boundingSphereCV=r.boundingSphereCV}return o.computeNumberOfVertices=function(t){e.typeOf.object("geometry",t);var a=-1;for(var i in t.attributes)if(t.attributes.hasOwnProperty(i)&&r(t.attributes[i])&&r(t.attributes[i].values)){var o=t.attributes[i],u=o.values.length/o.componentsPerAttribute;if(a!==u&&-1!==a)throw new n("All attribute lists must have the same number of attributes.");a=u}return a},o}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(n){if(n=e(n,e.EMPTY_OBJECT),!t(n.componentDatatype))throw new r("options.componentDatatype is required.");if(!t(n.componentsPerAttribute))throw new r("options.componentsPerAttribute is required.");if(n.componentsPerAttribute<1||n.componentsPerAttribute>4)throw new r("options.componentsPerAttribute must be between 1 and 4.");if(!t(n.values))throw new r("options.values is required.");this.componentDatatype=n.componentDatatype,this.componentsPerAttribute=n.componentsPerAttribute,this.normalize=e(n.normalize,!1),this.values=n.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";function i(n,i){if(!t(n))throw new r("normal is required.");if(!a.equalsEpsilon(e.magnitude(n),1,a.EPSILON6))throw new r("normal must be normalized.");if(!t(i))throw new r("distance is required.");this.normal=e.clone(n),this.distance=i}i.fromPointNormal=function(n,o,u){if(!t(n))throw new r("point is required.");if(!t(o))throw new r("normal is required.");if(!a.equalsEpsilon(e.magnitude(o),1,a.EPSILON6))throw new r("normal must be normalized.");var s=-e.dot(o,n);return t(u)?(e.clone(
|
||
|
componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:y})});if(o(p.normal)||o(p.tangent)||o(p.bitangent)||o(p.st)){var R=o(p.normal)?new Float32Array(12*_):void 0,A=o(p.tangent)?new Float32Array(12*_):void 0,N=o(p.bitangent)?new Float32Array(12*_):void 0,w=o(p.st)?new Float32Array(8*_):void 0,I=g,b=v,S=C,M=t.negate(I,x),F=t.negate(b,P),U=t.negate(S,L);T=0,E&&(O(T,R,A,N,w,U,I,b),T+=12),O(T,R,A,N,w,S,M,b),T+=12,O(T,R,A,N,w,M,U,b),T+=12,O(T,R,A,N,w,F,U,M),T+=12,O(T,R,A,N,w,I,S,b),T+=12,O(T,R,A,N,w,b,S,M),o(R)&&(m.normal=new s({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),o(A)&&(m.tangent=new s({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:A})),o(N)&&(m.bitangent=new s({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:N})),o(w)&&(m.st=new s({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:w}))}for(var D=new Uint16Array(6*_),B=0;_>B;++B){var j=6*B,z=4*B;D[j]=z,D[j+1]=z+1,D[j+2]=z+2,D[j+3]=z,D[j+4]=z+2,D[j+5]=z+3}return new u({attributes:m,indices:D,primitiveType:h.TRIANGLES,boundingSphere:e.fromVertices(y)})},d}),define("Workers/createFrustumGeometry",["../Core/defined","../Core/FrustumGeometry"],function(e,t){"use strict";function r(r,n){return e(n)&&(r=t.unpack(r,n)),t.createGeometry(r)}return r})}();
|