61 lines
126 KiB
JavaScript
61 lines
126 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
|
||
|
}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a,i,o,u,s,c){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(i,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(o,0),this[8]=r(c,0)}function c(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function f(e){for(var t=0,r=0;3>r;++r){var n=e[s.getElementIndex(h[r],p[r])];t+=2*n*n}return Math.sqrt(t)}function l(e,t){for(var r=u.EPSILON15,n=0,a=1,i=0;3>i;++i){var o=Math.abs(e[s.getElementIndex(h[i],p[i])]);o>n&&(a=i,n=o)}var c=1,f=0,l=p[a],E=h[a];if(Math.abs(e[s.getElementIndex(E,l)])>r){var y,O=e[s.getElementIndex(E,E)],_=e[s.getElementIndex(l,l)],d=e[s.getElementIndex(E,l)],T=(O-_)/2/d;y=0>T?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+y*y),f=y*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(l,l)]=t[s.getElementIndex(E,E)]=c,t[s.getElementIndex(E,l)]=f,t[s.getElementIndex(l,E)]=-f,t}s.packedLength=9,s.pack=function(e,n,a){return t.typeOf.object("value",e),t.defined("array",n),a=r(a,0),n[a++]=e[0],n[a++]=e[1],n[a++]=e[2],n[a++]=e[3],n[a++]=e[4],n[a++]=e[5],n[a++]=e[6],n[a++]=e[7],n[a++]=e[8],n},s.unpack=function(e,a,i){return t.defined("array",e),a=r(a,0),n(i)||(i=new s),i[0]=e[a++],i[1]=e[a++],i[2]=e[a++],i[3]=e[a++],i[4]=e[a++],i[5]=e[a++],i[6]=e[a++],i[7]=e[a++],i[8]=e[a++],i},s.clone=function(e,t){return n(e)?n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},s.fromArray=function(e,a,i){return t.defined("array",e),a=r(a,0),n(i)||(i=new s),i[0]=e[a],i[1]=e[a+1],i[2]=e[a+2],i[3]=e[a+3],i[4]=e[a+4],i[5]=e[a+5],i[6]=e[a+6],i[7]=e[a+7],i[8]=e[a+8],i},s.fromColumnMajorArray=function(e,r){return t.defined("values",e),s.clone(e,r)},s.fromRowMajorArray=function(e,r){return t.defined("values",e),n(r)?(r[0]=e[0],r[1]=e[3],r[2]=e[6],r[3]=e[1],r[4]=e[4],r[5]=e[7],r[6]=e[2],r[7]=e[5],r[8]=e[8],r):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,r){t.typeOf.object("quaternion",e);var a=e.x*e.x,i=e.x*e.y,o=e.x*e.z,u=e.x*e.w,c=e.y*e.y,f=e.y*e.z,l=e.y*e.w,E=e.z*e.z,y=e.z*e.w,p=e.w*e.w,h=a-c-E+p,O=2*(i-y),_=2*(o+l),d=2*(i+y),T=-a+c-E+p,R=2*(f-u),m=2*(o-l),A=2*(f+u),N=-a-c+E+p;return n(r)?(r[0]=h,r[1]=d,r[2]=m,r[3]=O,r[4]=T,r[5]=A,r[6]=_,r[7]=R,r[8]=N,r):new s(h,O,_,d,T,R,m,A,N)},s.fromHeadingPitchRoll=function(e,r){t.typeOf.object("headingPitchRoll",e);var a=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),u=Math.sin(-e.pitch),c=Math.sin(-e.heading),f=Math.sin(e.roll),l=a*i,E=-o*c+f*u*i,y=f*c+o*u*i,p=a*c,h=o*i+f*u*c,O=-f*i+o*u*c,_=-u,d=f*a,T=o*a;return n(r)?(r[0]=l,r[1]=p,r[2]=_,r[3]=E,r[4]=h,r[5]=d,r[6]=y,r[7]=O,r[8]=T,r):new s(l,E,y,p,h,O,_,d,T)},s.fromScale=function(e,r){return t.typeOf.object("scale",e),n(r)?(r[0]=e.x,r[1]=0,r[2]=0,r[3]=0,r[4]=e.y,r[5]=0,r[6]=0,r[7]=0,r[8]=e.z,r):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,r){return t.typeOf.number("scale",e),n(r)?(r[0]=e,r[1]=0,r[2]=0,r[3]=0,r[4]=e,r[5]=0,r[6]=0,r[7]=0,r[8]=e,r):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,r){return t.typeOf.object("vector",e),n(r)?(r[0]=0,r[1]=e.z,r[2]=-e.y,r[3]=-e.z,r[4]=0,r[5]=e.x,r[6]=e.y,r[7]=-e.x,r[8]=0,r):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,r){t.typeOf.number("angle",e);var a=Math.cos(e),i=Math.sin(e);return n(r)?(r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=a,r[5]=i,r[6]=0,r[7]=-i,r[8]=a,r):new s(1,0,0,0,a,-i,0,i,a)},s.fromRotationY=function(e,r){t.typeOf.number("angle",e);var a=Math.cos(e),i=Math.sin(e);return n(r)?(r[0]=a,r[1]=0,r[2]=-i,r[3]=0,r[4]=1,r[5]=0,r[6]=i,r[7]=0,r[8]=a,r):new s(a,0,i,0,1,0,-i,0,a)},s.fromRotationZ=function(e,r){t.typeOf.number("angle",e);var a=Math.cos(e),i=Math.sin(e);return n(r)?(r[0]=a,r[1]=i,r[2]=0,r[3]=-i,r[4]=a,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r):new s(a,-i,0,i,a,0,0,0,1)},s.toArray=function(e,r){return t.typeOf.object("matrix",e),n(r)?(r[0]=e[0],r[1]=e
|
||
|
n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var a=e[0],i=e[4],o=e[8],l=e[12],E=e[1],y=e[5],p=e[9],h=e[13],O=e[2],m=e[6],A=e[10],N=e[14],S=e[3],b=e[7],I=e[11],M=e[15],x=A*M,g=N*I,w=m*M,v=N*b,C=m*I,U=A*b,L=O*M,P=N*S,F=O*I,D=A*S,B=O*b,j=m*S,z=x*y+v*p+C*h-(g*y+w*p+U*h),G=g*E+L*p+D*h-(x*E+P*p+F*h),q=w*E+P*y+B*h-(v*E+L*y+j*h),X=U*E+F*y+j*p-(C*E+D*y+B*p),V=g*i+w*o+U*l-(x*i+v*o+C*l),W=x*a+P*o+F*l-(g*a+L*o+D*l),H=v*a+L*i+j*l-(w*a+P*i+B*l),Y=C*a+D*i+B*o-(U*a+F*i+j*o);x=o*h,g=l*p,w=i*h,v=l*y,C=i*p,U=o*y,L=a*h,P=l*E,F=a*p,D=o*E,B=a*y,j=i*E;var k=x*b+v*I+C*M-(g*b+w*I+U*M),Z=g*S+L*I+D*M-(x*S+P*I+F*M),K=w*S+P*b+B*M-(v*S+L*b+j*M),Q=U*S+F*b+j*I-(C*S+D*b+B*I),J=w*A+U*N+g*m-(C*N+x*m+v*A),$=F*N+x*O+P*A-(L*A+D*N+g*O),ee=L*m+j*N+v*O-(B*N+w*O+P*m),te=B*A+C*O+D*m-(F*m+j*A+U*O),re=a*z+i*G+o*q+l*X;if(Math.abs(re)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return re=1/re,n[0]=z*re,n[1]=G*re,n[2]=q*re,n[3]=X*re,n[4]=V*re,n[5]=W*re,n[6]=H*re,n[7]=Y*re,n[8]=k*re,n[9]=Z*re,n[10]=K*re,n[11]=Q*re,n[12]=J*re,n[13]=$*re,n[14]=ee*re,n[15]=te*re,n},f.inverseTransformation=function(e,t){r.typeOf.object("matrix",e),r.typeOf.object("result",t);var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],f=e[9],l=e[10],E=e[12],y=e[13],p=e[14],h=-n*E-a*y-i*p,O=-o*E-u*y-s*p,_=-c*E-f*y-l*p;return t[0]=n,t[1]=o,t[2]=c,t[3]=0,t[4]=a,t[5]=u,t[6]=f,t[7]=0,t[8]=i,t[9]=s,t[10]=l,t[11]=0,t[12]=h,t[13]=O,t[14]=_,t[15]=1,t},f.IDENTITY=o(new f(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),f.ZERO=o(new f(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),f.COLUMN0ROW0=0,f.COLUMN0ROW1=1,f.COLUMN0ROW2=2,f.COLUMN0ROW3=3,f.COLUMN1ROW0=4,f.COLUMN1ROW1=5,f.COLUMN1ROW2=6,f.COLUMN1ROW3=7,f.COLUMN2ROW0=8,f.COLUMN2ROW1=9,f.COLUMN2ROW2=10,f.COLUMN2ROW3=11,f.COLUMN3ROW0=12,f.COLUMN3ROW1=13,f.COLUMN3ROW2=14,f.COLUMN3ROW3=15,i(f.prototype,{length:{get:function(){return f.packedLength}}}),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},f.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},f}),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 y=new e,p=new e,h=new e,O=new e,_=new e,d=new e,T=new e,R=new e,m=new e,A=new e,N=new e,S=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,y),u=e.clone(i,p),s=e.clone(i,h),c=e.clone(i,O),f=e.clone(i,_),l=e.clone(i,d),b=t.length;for(n=1;b>n;n++){e.clone(t[n],i);var I=i.x,M=i.y,x=i.z;I<o.x&&e.clone(i,o),I>c.x&&e.clone(i,c),M<u.y&&e.clone(i,u),M>f.y&&e.clone(i,f),x<s.z&&e.clone(i,s),x>l.z&&e.clone(i,l)}var g=e.magnitudeSquared(e.subtract(c,o,R)),w=e.magnitudeSquared(e.subtract(f,u,R)),v=e.magnitudeSquared(e.subtract(l,s,R)),C=o,U=c,L=g;w>L&&(L=w,C=u,U=f),v>L&&(L=v,C=s,U=l);var P=m;P.x=.5*(C.x+U.x),P.y=.5*(C.y+U.y),P.z=.5*(C.z+U.z);var F=e.magnitudeSquared(e.subtract(U,P,R)),D=Math.sqrt(F),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,R),.5,S),G=0;for(n=0;b>n;n++){e.clone(t[n],i);var q=e.magnitude(e.subtract(i,z,R));q>G&&(G=q);var X=e.magnitudeSquared(e.subtract(i,P,R));if(X>F){var V=Math.sqrt(X);D=.5*(D+V),F=D*D;var W=V-D;P.x=(D*P.x+W*i.x)/V,P.y=(D*P.y+W*i.y)/V,P.z=(D*P.z+W*i.z)/V}}return
|
||
|
case o.INT:return new Int32Array(n);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/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new t("indexDatatype is required and must be a valid IndexDatatype constant.")},i.validate=function(t){return e(t)&&
|