61 lines
107 KiB
JavaScript
61 lines
107 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(n){t=n.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 n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),r>=n)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),r>n)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a.typeOf.number.equals=function(e,n,r,i){if(a.typeOf.number(e,r),a.typeOf.number(n,i),r!==i)throw new t(e+" must be equal to "+n+", the actual values are "+r+" 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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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,n,r){"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",r);var a=n.x,i=n.y,o=n.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 r.x=u,r.y=s,r.z=c,r},s.multiplyByScalar=function(e,n,r){return t.typeOf.object("matrix",e),t.typeOf.number("scalar",n),t.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*n,r[5]=e[5]*n,r[6]=e[6]*n,r[7]=e[7]*n,r[8]=e[8]*n,r},s.multiplyByScale=function(e,n,r){return t.typeOf.object("matrix",e),t.typeOf.object("scale",n),t.typeOf.object("result",r),r[0]=e[0]*n.x,r[1]=e[1]*n.x,r[2]=e[2]*n.x,r[3]=e[3]*n.y,r[4]=e[4]*n.y,r[5]=e[5]*n.y,r[6]=e[6]*n.z,r[7]=e[7]*n.z,r[8]=e[8]*n.z,r},s.negate=function(e,n){return t.typeOf.object("matrix",e),t.typeOf.object("result",n),n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=-e[3],n[4]=-e[4],n[5]=-e[5],n[6]=-e[6],n[7]=-e[7],n[8]=-e[8],n},s.transpose=function(e,n){t.typeOf.object("matrix",e),t.typeOf.object("result",n);var r=e[0],a=e[3],i=e[6],o=e[1],u=e[4],s=e[7],c=e[2],E=e[5],f=e[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=E,n[8]=f,n};var O=[1,0,0],T=[2,2,1],R=new s,p=new s;return s.computeEigenDecomposition=function(e,n){t.typeOf.object("matrix",e);var a=u.EPSILON20,i=10,o=0,l=0;r(n)||(n={});for(var _=n.unitary=s.clone(s.IDENTITY,n.unitary),O=n.diagonal=s.clone(e,n.diagonal),T=a*c(O);i>l&&E(O)>T;)f(O,R),s.transpose(R,p),s.multiply(O,R,O),s.multiply(p,O,O),s.multiply(_,R,_),++o>2&&(++l,o=0);return n},s.abs=function(e,n){return t.typeOf.object("matrix",e),t.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n[4]=Math.abs(e[4]),n[5]=Math.abs(e[5]),n[6]=Math.abs(e[6]),n[7]=Math.abs(e[7]),n[8]=Math.abs(e[8]),n},s.determinant=function(e){t.typeOf.object("matrix",e);var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],E=e[8];return n*(o*E-c*u)+i*(c*a-r*E)+s*(r*u-o*a)},s.inverse=function(e,n){t.typeOf.object("matrix",e),t.typeOf.object("result",n);var r=e[0],a=e[1],o=e[2],c=e[3],E=e[4],f=e[5],l=e[6],_=e[7],O=e[8],T=s.determinant(e);if(Math.abs(T)<=u.EPSILON15)throw new i("matrix is not invertible");n[0]=E*O-_*f,n[1]=_*o-a*O,n[2]=a*f-E*o,n[3]=l*f-c*O,n[4]=r*O-l*o,n[5]=c*o-r*f,n[6]=c*_-l*E,n[7]=l*a-r*_,n[8]=r*E-c*a;var R=1/T;return s.multiplyByScalar(n,R,n)},s.equals=function(e,t){return e===t||r(e)&&r(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,n,a){return t.typeOf.number("epsilon",a),e===n||r(e)&&r(n)&&Math.abs(e[0]-n[0])<=a&&Math.abs(e[1]-n[1])<=a&&Math.abs(e[2]-n[2])<=a&&Math.abs(e[3]-n[3])<=a&&Math.abs(e[4]-n[4])<=a&&Math.abs(e[5]-n[5])<=a&&Math.abs(e[6]-n[6])<=a&&Math.abs(e[7]-n[7])<=a&&Math.abs(e[8]-n[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,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+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,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(t,r){return e.typeOf.object("color",t),n(r)?(r.x=t.red,r.y=t.green,r.z=t.blue,r.w=t.alpha,r):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(e,t){return n(e)?n(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,n,a){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",n);var i=e.east,o=e.west,c=n.east,E=n.west;o>i&&c>0?i+=u.TWO_PI:E>c&&i>0&&(c+=u.TWO_PI),o>i&&0>E?E+=u.TWO_PI:E>c&&0>o&&(o+=u.TWO_PI);var f=u.negativePiToPi(Math.max(o,E)),l=u.negativePiToPi(Math.min(i,c));if(!((e.west<e.east||n.west<n.east)&&f>=l)){var _=Math.max(e.south,n.south),O=Math.min(e.north,n.north);if(!(_>=O))return r(a)?(a.west=f,a.south=_,a.east=l,a.north=O,a):new s(f,_,l,O)}},s.simpleIntersection=function(e,n,a){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",n);var i=Math.max(e.west,n.west),o=Math.max(e.south,n.south),u=Math.min(e.east,n.east),c=Math.min(e.north,n.north);return o>=c||i>=u?void 0:r(a)?(a.west=i,a.south=o,a.east=u,a.north=c,a):new s(i,o,u,c)},s.union=function(e,n,a){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",n),r(a)||(a=new s);var i=e.east,o=e.west,c=n.east,E=n.west;o>i&&c>0?i+=u.TWO_PI:E>c&&i>0&&(c+=u.TWO_PI),o>i&&0>E?E+=u.TWO_PI:E>c&&0>o&&(o+=u.TWO_PI);var f=u.convertLongitudeRange(Math.min(o,E)),l=u.convertLongitudeRange(Math.max(i,c));return a.west=f,a.south=Math.min(e.south,n.south),a.east=l,a.north=Math.max(e.north,n.north),a},s.expand=function(e,n,a){return t.typeOf.object("rectangle",e),t.typeOf.object("cartographic",n),r(a)||(a=new s),a.west=Math.min(e.west,n.longitude),a.south=Math.min(e.south,n.latitude),a.east=Math.max(e.east,n.longitude),a.north=Math.max(e.north,n.latitude),a},s.contains=function(e,n){t.typeOf.object("rectangle",e),t.typeOf.object("cartographic",n);var r=n.longitude,a=n.latitude,i=e.west,o=e.east;return i>o&&(o+=u.TWO_PI,0>r&&(r+=u.TWO_PI)),(r>i||u.equalsEpsilon(r,i,u.EPSILON14))&&(o>r||u.equalsEpsilon(r,o,u.EPSILON14))&&a>=e.south&&a<=e.north};var c=new e;return s.subsample=function(e,a,o,E){t.typeOf.object("rectangle",e),a=n(a,i.WGS84),o=n(o,0),r(E)||(E=[]);var f=0,l=e.north,_=e.south,O=e.east,T=e.west,R=c;R.height=o,R.longitude=T,R.latitude=l,E[f]=a.cartographicToCartesian(R,E[f]),f++,R.longitude=O,E[f]=a.cartographicToCartesian(R,E[f]),f++,R.latitude=_,E[f]=a.cartographicToCartesian(R,E[f]),f++,R.longitude=T,E[f]=a.cartographicToCartesian(R,E[f]),f++,0>l?R.latitude=l:_>0?R.latitude=_:R.latitude=0;for(var p=1;8>p;++p)R.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,R)&&(E[f]=a.cartographicToCartesian(R,E[f]),f++);return 0===R.latitude&&(R.longitude=T,E[f]=a.cartographicToCartesian(R,E[f]),f++,R.longitude=O,E[f]=a.cartographicToCartesian(R,E[f]),f++),E.length=f,E},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,n,r,a,i,o,u,s,c,E,f){"use strict";function l(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var _=new e,O=new e,T=new e,R=new e,p=new e,y=new e,h=new e,d=new e,m=new e,A=new e,N=new e,I=new e;l.fromPoints=function(t,n){if(a(n)||(n=new l),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r,i=e.clone(t[0],h),o=e.clone(i,_),u=e.clone(i,O),s=e.clone(i,T),c=e.clone(i,R),E=e.clone(i,p),f=e.clone(i,y),S=t.length;for(r=1;S>r;r++){e.clone(t[r],i);var M=i.x,b=i.y,w=i.z;M<o.x&&e.clone(i,o),M>c.x&&e.clone(i,c),b<u.y&&e.clone(i,u),b>E.y&&e.clone(i,E),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var g=e.magnitudeSquared(e.subtract(c,o,d)),C=e.magnitudeSquared(e.subtract(E,u,d)),L=e.magnitudeSquared(e.subtract(f,s,d)),x=o,U=c,P=g;C>P&&(P=C,x=u,U=E),L>P&&(P=L,x=s,U=f);var v=m;v.x=.5*(x.x+U.x),v.y=.5*(x.y+U.y),v.z=.5*(x.z+U.z);var F=e.magnitudeSquared(e.subtract(U,v,d)),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=E.y,j.z=f.z;var z=e.multiplyByScalar(e.add(B,j,d),.5,I),G=0;for(r=0;S>r;r++){e.clone(t[r],i);var q=e.magnitude(e.subtract(i,z,d));q>G&&(G=q);var X=e.magnitudeSquared(e.subtract(i,v,d));if(X>F){var V=Math.sqrt(X);D=.5*(D+V),F=D*D;var W=V-D;v.x=(D*v.x+W*i.x)/V,v.y=(D*v.y+W*i.y)/V,v.z=(D*v.z+W*i.z)/V}}return G>D?(e.clone(v,n.center),n.radius=D
|
||
|
case o.UNSIGNED_INT:return new Uint32Array(r);case o.FLOAT:return new Float32Array(r);case o.DOUBLE:return new Float64Array(r);default:throw new n("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(r,a,i,u){if(!t(r))throw new n("componentDatatype is required.");if(!t(a))throw new n("buffer is required.");switch(i=e(i,0),u=e(u,(a.byteLength-i)/o.getSizeInBytes(r)),r){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 n("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 n("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 n={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===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./Check","./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a,i){"use strict";function o(n){n=t(n,t.EMPTY_OBJECT),e.typeOf.object("options.attributes",n.attributes),this.attributes=n.attributes,this.indices=n.indices,this.primitiveType=t(n.primitiveType,i.TRIANGLES),this.boundingSphere=n.boundingSphere,this.geometryType=t(n.geometryType,a.NONE),this.boundingSphereCV=n.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)&&n(t.attributes[i])&&n(t.attributes[i].values)){var o=t.attributes[i],u=o.values.length/o.componentsPerAttribute;if(a!==u&&-1!==a)throw new r("All attribute lists must have the same number of attributes.");a=u}return a},o}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(r){if(r=e(r,e.EMPTY_OBJECT),!t(r.componentDatatype))throw new n("options.componentDatatype is required.");if(!t(r.componentsPerAttribute))throw new n("options.componentsPerAttribute is required.");if(r.componentsPerAttribute<1||r.componentsPerAttribute>4)throw new n("options.componentsPerAttribute must be between 1 and 4.");if(!t(r.values))throw new n("options.values is required.");this.componentDatatype=r.componentDatatype,this.componentsPerAttribute=r.componentsPerAttribute,this.normalize=e(r.normalize,!1),this.values=r.values}return r}),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/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({posi
|