/** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * * Copyright 2011-2016 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 t(t){return void 0!==t&&null!==t}return t}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/isArray",["./defined"],function(t){"use strict";var e=Array.isArray;return t(e)||(e=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),e}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(t,e,n,r){"use strict";function i(t){return t+" was required but undefined."}function a(t,e,n){return"Expected "+n+" to be typeof "+e+", got "+t}var o={};return o.typeOf={},o.numeric={},o.defined=function(t,r){if(!e(t))throw new n(i(r))},o.numeric.maximum=function(t,e){if(o.typeOf.number(t),o.typeOf.number(e),t>e)throw new n("Expected "+t+" to be at most "+e)},o.numeric.minimum=function(t,e){if(o.typeOf.number(t),o.typeOf.number(e),t>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=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>>1^e[1&t];for(;n>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(t){return t>0?1:t<0?-1:0},i.signNotZero=function(t){return t<0?-1:1},i.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*i.clamp(t,-1,1)+.5)*n)},i.fromSNorm=function(t,n){return n=e(n,255),i.clamp(t,0,n)/n*2-1},i.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},i.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},i.lerp=function(t,e,n){return(1-n)*t+n*e},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(t){return t*i.RADIANS_PER_DEGREE},i.toDegrees=function(t){return t*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(t){var e=i.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},i.clampToLatitudeRange=function(t){return i.clamp(t,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(t){return i.zeroToTwoPi(t+i.PI)-i.PI},i.zeroToTwoPi=function(t){var e=i.mod(t,i.TWO_PI);return Math.abs(e)i.EPSILON14?i.TWO_PI:e},i.mod=function(t,e){return(t%e+e)%e},i.equalsEpsilon=function(t,n,r,i){i=e(i,r);var a=Math.abs(t-n);return a<=i||a<=r*Math.max(Math.abs(t),Math.abs(n))};var a=[1];i.factorial=function(t){var e=a.length;if(t>=e)for(var n=a[e-1],r=e;r<=t;r++)a.push(n*r);return a[t]},i.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},i.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},i.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},i.clamp=function(t,e,n){return tn?n:t};var o=new t;return i.setRandomNumberSeed=function(e){o=new t(e)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(t){return Math.acos(i.clamp(t,-1,1))},i.asinClamped=function(t){return Math.asin(i.clamp(t,-1,1))},i.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},i.logBase=function(t,e){return Math.log(t)/Math.log(e)},i.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var i=t.clock,a=t.cone,u=e(t.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(t,e,r,i){return n(i)?(i.x=t,i.y=e,i.z=r,i):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var i=0;ir.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new t(c*U,_*L,T*F)}var a=new t,o=new t;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)}u.fromRadians=function(t,r,i,a){return i=e(i,0),n(a)?(a.longitude=t,a.latitude=r,a.height=i,a):new u(t,r,i)},u.fromDegrees=function(t,e,n,r){return t=a.toRadians(t),e=a.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),l=a.EPSILON1;return u.fromCartesian=function(e,r,i){var R=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:T,A=n(r)?r._centerToleranceSquared:l,N=o(e,R,f,A,s);if(n(N)){var h=t.multiplyComponents(N,f,E);h=t.normalize(h,h);var d=t.subtract(e,N,c),I=Math.atan2(h.y,h.x),S=Math.asin(h.z),m=a.sign(t.dot(d,e))*t.magnitude(d);return n(i)?(i.longitude=I,i.latitude=S,i.height=m,i):new u(I,S,m)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(e,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),e._radii=new t(r,i,a),e._radiiSquared=new t(r*r,i*i,a*a),e._radiiToTheFourth=new t(r*r*r*r,i*i*i*i,a*a*a*a),e._oneOverRadii=new t(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),e._minimumRadius=Math.min(r,i,a),e._maximumRadius=Math.max(r,i,a),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}i(c.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),c.clone=function(e,n){if(r(e)){var i=e._radii;return r(n)?(t.clone(i,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._radii,r,i),r},c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var i=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(e,i),t.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(t.dot(i,a));return t.divideByScalar(a,o,a),t.multiplyByScalar(i,e.height,i),r(n)||(n=new t),t.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var i=this._semimajorAxis,a=e.longitude*i,o=e.latitude*i,u=e.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new t(a,o,u)},u.prototype.unproject=function(t,n){var i=this._oneOverSemimajorAxis,a=t.x*i,o=t.y*i,u=t.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new e(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r,i,a,o,u,E,s){this[0]=e(t,0),this[1]=e(i,0),this[2]=e(u,0),this[3]=e(n,0),this[4]=e(a,0),this[5]=e(E,0),this[6]=e(r,0),this[7]=e(o,0),this[8]=e(s,0)}function E(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function s(t){for(var e=0,n=0;n<3;++n){var r=t[u.getElementIndex(R[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function c(t,e){for(var n=o.EPSILON15,r=0,i=1,a=0;a<3;++a){var E=Math.abs(t[u.getElementIndex(R[a],l[a])]);E>r&&(i=a,r=E)}var s=1,c=0,_=l[i],T=R[i];if(Math.abs(t[u.getElementIndex(T,_)])>n){var f,A=t[u.getElementIndex(T,T)],N=t[u.getElementIndex(_,_)],h=t[u.getElementIndex(T,_)],d=(A-N)/2/h;f=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+f*f),c=f*s}return e=u.clone(u.IDENTITY,e),e[u.getElementIndex(_,_)]=e[u.getElementIndex(T,T)]=s,e[u.getElementIndex(T,_)]=c,e[u.getElementIndex(_,T)]=-c,e}u.packedLength=9,u.pack=function(t,n,r){return r=e(r,0),n[r++]=t[0],n[r++]=t[1],n[r++]=t[2],n[r++]=t[3],n[r++]=t[4],n[r++]=t[5],n[r++]=t[6],n[r++]=t[7],n[r++]=t[8],n},u.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i[0]=t[r++],i[1]=t[r++],i[2]=t[r++],i[3]=t[r++],i[4]=t[r++],i[5]=t[r++],i[6]=t[r++],i[7]=t[r++],i[8]=t[r++],i},u.clone=function(t,e){if(n(t))return n(e)?(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],e):new u(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},u.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i[0]=t[r],i[1]=t[r+1],i[2]=t[r+2],i[3]=t[r+3],i[4]=t[r+4],i[5]=t[r+5],i[6]=t[r+6],i[7]=t[r+7],i[8]=t[r+8],i},u.fromColumnMajorArray=function(t,e){return u.clone(t,e)},u.fromRowMajorArray=function(t,e){return n(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new u(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},u.fromQuaternion=function(t,e){var r=t.x*t.x,i=t.x*t.y,a=t.x*t.z,o=t.x*t.w,E=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,l=t.w*t.w,R=r-E-_+l,f=2*(i-T),A=2*(a+c),N=2*(i+T),h=-r+E-_+l,d=2*(s-o),I=2*(a-c),S=2*(s+o),m=-r-E+_+l;return n(e)?(e[0]=R,e[1]=N,e[2]=I,e[3]=f,e[4]=h,e[5]=S,e[6]=A,e[7]=d,e[8]=m,e):new u(R,f,A,N,h,d,I,S,m)},u.fromHeadingPitchRoll=function(t,e){var r=Math.cos(-t.pitch),i=Math.cos(-t.heading),a=Math.cos(t.roll),o=Math.sin(-t.pitch),E=Math.sin(-t.heading),s=Math.sin(t.roll),c=r*i,_=-a*E+s*o*i,T=s*E+a*o*i,l=r*E,R=a*i+s*o*E,f=-o*a+a*o*E,A=-o,N=s*r,h=a*r;return n(e)?(e[0]=c,e[1]=l,e[2]=A,e[3]=_,e[4]=R,e[5]=N,e[6]=T,e[7]=f,e[8]=h,e):new u(c,_,T,l,R,f,A,N,h)},u.fromScale=function(t,e){return n(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new u(t.x,0,0,0,t.y,0,0,0,t.z)},u.fromUniformScale=function(t,e){return n(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new u(t,0,0,0,t,0,0,0,t)},u.fromCrossProduct=function(t,e){return n(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new u(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},u.fromRotationX=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=r,e[5]=i,e[6]=0,e[7]=-i,e[8]=r,e):new u(1,0,0,0,r,-i,0,i,r)},u.fromRotationY=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=r,e[1]=0,e[2]=-i,e[3]=0,e[4]=1,e[5]=0,e[6]=i,e[7]=0,e[8]=r,e):new u(r,0,i,0,1,0,-i,0,r)},u.fromRotationZ=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=r,e[1]=i,e[2]=0,e[3]=-i,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new u(r,-i,0,i,r,0,0,0,1)},u.toArray=function(t,e){return n(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},u.getElementIndex=function(t,e){return 3*t+e},u.getColumn=function(t,e,n){var r=3*e,i=t[r],a=t[r+1],o=t[r+2];return n.x=i,n.y=a,n.z=o,n},u.setColumn=function(t,e,n,r){r=u.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},u.getRow=function(t,e,n){var r=t[e],i=t[e+3],a=t[e+6];return n.x=r,n.y=i,n.z=a,n},u.setRow=function(t,e,n,r){return r=u.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var _=new t;u.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],_)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],_)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],_)),n};var T=new t;u.getMaximumScale=function(e){return u.getScale(e,T),t.maximumComponent(T)},u.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],i=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],a=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},u.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},u.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},u.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[3]*i+t[6]*a,u=t[1]*r+t[4]*i+t[7]*a,E=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=E,n},u.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},u.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},u.negate=function(t,e){return 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],e},u.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var l=[1,0,0],R=[2,2,1],f=new u,A=new u;return u.computeEigenDecomposition=function(t,e){var r=o.EPSILON20,i=10,a=0,_=0;n(e)||(e={});for(var T=e.unitary=u.clone(u.IDENTITY,e.unitary),l=e.diagonal=u.clone(t,e.diagonal),R=r*E(l);_R;)c(l,f),u.transpose(f,A),u.multiply(l,f,l),u.multiply(A,l,l),u.multiply(T,f,T),++a>2&&(++_,a=0);return e},u.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},u.determinant=function(t){var e=t[0],n=t[3],r=t[6],i=t[1],a=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},u.inverse=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=u.determinant(t);e[0]=o*_-c*E,e[1]=c*i-r*_,e[2]=r*E-o*i,e[3]=s*E-a*_,e[4]=n*_-s*i,e[5]=a*i-n*E,e[6]=a*c-s*o,e[7]=s*r-n*c,e[8]=n*o-a*r;var l=1/T;return u.multiplyByScalar(e,l,e)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&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]},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";function a(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}a.fromElements=function(t,n,r,i,o){return e(o)?(o.x=t,o.y=n,o.z=r,o.w=i,o):new a(t,n,r,i)},a.fromColor=function(t,n){return e(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new a(t.red,t.green,t.blue,t.alpha)},a.clone=function(t,n){if(e(t))return e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new a(t.x,t.y,t.z,t.w)},a.packedLength=4,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.x=n[r++],i.y=n[r++],i.z=n[r++],i.w=n[r],i},a.packArray=function(t,n){var r=t.length;e(n)?n.length=4*r:n=new Array(4*r);for(var i=0;i=0?l.longitude:l.longitude+u.TWO_PI;a=Math.min(a,R),o=Math.max(o,R)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(e)?(e.west=r,e.south=s,e.east=i,e.north=c,e):new E(r,s,i,c)},E.fromCartesianArray=function(t,e,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,l=t.length;T=0?R.longitude:R.longitude+u.TWO_PI;o=Math.min(o,f),s=Math.max(s,f)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=c,r.east=a,r.north=_,r):new E(i,c,a,_)},E.clone=function(t,e){if(n(t))return n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||n(t)&&n(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return n(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.south,r.height=0,r):new t(e.west,e.south)},E.northwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.north,r.height=0,r):new t(e.west,e.north)},E.northeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.north,r.height=0,r):new t(e.east,e.north)},E.southeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.south,r.height=0,r):new t(e.east,e.south)},E.center=function(e,r){var i=e.east,a=e.west;i0?i+=u.TWO_PI:o0&&(o+=u.TWO_PI),i=l))return n(r)?(r.west=c,r.south=T,r.east=_,r.north=l,r):new E(c,T,_,l)}},E.simpleIntersection=function(t,e,r){var i=Math.max(t.west,e.west),a=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new E(i,a,o,u)},E.union=function(t,e,r){n(r)||(r=new E);var i=t.east,a=t.west,o=e.east,s=e.west;i0?i+=u.TWO_PI:o0&&(o+=u.TWO_PI),ii||u.equalsEpsilon(n,i,u.EPSILON14))&&(n=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,r,i,o){r=e(r,a.WGS84),i=e(i,0),n(o)||(o=[]);var c=0,_=t.north,T=t.south,l=t.east,R=t.west,f=s;f.height=i,f.longitude=R,f.latitude=_,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=l,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.latitude=T,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=r.cartographicToCartesian(f,o[c]),c++,_<0?f.latitude=_:T>0?f.latitude=T:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*u.PI_OVER_TWO,E.contains(t,f)&&(o[c]=r.cartographicToCartesian(f,o[c]),c++);return 0===f.latitude&&(f.longitude=R,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=l,o[c]=r.cartographicToCartesian(f,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_){"use strict";function T(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)}var l=new t,R=new t,f=new t,A=new t,N=new t,h=new t,d=new t,I=new t,S=new t,m=new t,M=new t,O=new t;T.fromPoints=function(e,n){if(r(n)||(n=new T),!r(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var i=t.clone(e[0],d),a=t.clone(i,l),o=t.clone(i,R),u=t.clone(i,f),E=t.clone(i,A),s=t.clone(i,N),c=t.clone(i,h),_=e.length,y=1;y<_;y++){t.clone(e[y],i);var p=i.x,C=i.y,U=i.z;pE.x&&t.clone(i,E),Cs.y&&t.clone(i,s),Uc.z&&t.clone(i,c)}var L=t.magnitudeSquared(t.subtract(E,a,I)),F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),v=a,w=E,g=L;F>g&&(g=F,v=o,w=s),P>g&&(g=P,v=u,w=c);var x=S;x.x=.5*(v.x+w.x),x.y=.5*(v.y+w.y),x.z=.5*(v.z+w.z);var D=t.magnitudeSquared(t.subtract(w,x,I)),B=Math.sqrt(D),z=m;z.x=a.x,z.y=o.y,z.z=u.z;var G=M;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,O),X=0;for(y=0;y<_;y++){t.clone(e[y],i);var V=t.magnitude(t.subtract(i,b,I));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(i,x,I));if(q>D){var H=Math.sqrt(q);B=.5*(B+H),D=B*B;var W=H-B;x.x=(B*x.x+W*i.x)/H,x.y=(B*x.y+W*i.y)/H,x.z=(B*x.z+W*i.z)/H}}return B_.x&&t.clone(u,_),Fy.y&&t.clone(u,y),Pp.z&&t.clone(u,p)}var v=t.magnitudeSquared(t.subtract(_,E,I)),w=t.magnitudeSquared(t.subtract(y,s,I)),g=t.magnitudeSquared(t.subtract(p,c,I)),x=E,D=_,B=v;w>B&&(B=w,x=s,D=y),g>B&&(B=g,x=c,D=p);var z=S;z.x=.5*(x.x+D.x),z.y=.5*(x.y+D.y),z.z=.5*(x.z+D.z);var G=t.magnitudeSquared(t.subtract(D,z,I)),b=Math.sqrt(G),X=m;X.x=E.x,X.y=s.y,X.z=c.z;var V=M;V.x=_.x,V.y=y.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,I),.5,O),H=0;for(U=0;UH&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return bs.x&&t.clone(a,s),Uc.y&&t.clone(a,c),L_.z&&t.clone(a,_)}var F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),v=t.magnitudeSquared(t.subtract(_,E,I)),w=o,g=s,x=F;P>x&&(x=P,w=u,g=c),v>x&&(x=v,w=E,g=_);var D=S;D.x=.5*(w.x+g.x),D.y=.5*(w.y+g.y),D.z=.5*(w.z+g.z);var B=t.magnitudeSquared(t.subtract(g,D,I)),z=Math.sqrt(B),G=m;G.x=o.x,G.y=u.y,G.z=E.z;var b=M;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,O),V=0;for(p=0;pV&&(V=q);var H=t.magnitudeSquared(t.subtract(a,D,I));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z=c+E)return e.clone(i),i;if(E>=c+o)return n.clone(i),i;var _=.5*(o+c+E),l=t.multiplyByScalar(s,(-o+_)/c,D);return t.add(l,a,l),t.clone(l,i.center),i.radius=_,i};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(e,n){var r=e.center,i=e.radius,a=n.normal,o=t.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,n,i){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(a)}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function i(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.binormal=t(e.binormal,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return i.POSITION_ONLY=r(new i({position:!0})),i.POSITION_AND_NORMAL=r(new i({position:!0,normal:!0})),i.POSITION_NORMAL_AND_ST=r(new i({position:!0,normal:!0,st:!0})),i.POSITION_AND_ST=r(new i({position:!0,st:!0})),i.POSITION_AND_COLOR=r(new i({position:!0,color:!0})),i.ALL=r(new i({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),i.DEFAULT=i.POSITION_NORMAL_AND_ST,i.packedLength=6,i.pack=function(e,n,r){return r=t(r,0),n[r++]=e.position?1:0,n[r++]=e.normal?1:0,n[r++]=e.st?1:0,n[r++]=e.binormal?1:0,n[r++]=e.tangent?1:0,n[r++]=e.color?1:0,n},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.position=1===n[r++],a.normal=1===n[r++],a.st=1===n[r++],a.binormal=1===n[r++],a.tangent=1===n[r++],a.color=1===n[r++],a},i.clone=function(t,n){if(e(t))return e(n)||(n=new i),n.position=t.position,n.normal=t.normal,n.st=t.st,n.binormal=t.binormal,n.tangent=t.tangent,n.color=t.color,n},i}),define("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(t,e,n,r,i,a,o,u,E,s,c,_,T,l,R){"use strict";function f(t){t=i(t,i.EMPTY_OBJECT);var e=i(t.radii,S),r=i(t.stackPartitions,64),a=i(t.slicePartitions,64),o=i(t.vertexFormat,R.DEFAULT);this._radii=n.clone(e),this._stackPartitions=r,this._slicePartitions=a,this._vertexFormat=R.clone(o),this._workerName="createEllipsoidGeometry"}var A=new n,N=new n,h=new n,d=new n,I=new n,S=new n(1,1,1),m=Math.cos,M=Math.sin;f.packedLength=n.packedLength+R.packedLength+2,f.pack=function(t,e,r){return r=i(r,0),n.pack(t._radii,e,r),r+=n.packedLength,R.pack(t._vertexFormat,e,r),r+=R.packedLength,e[r++]=t._stackPartitions,e[r]=t._slicePartitions,e};var O=new n,y=new R,p={radii:O,vertexFormat:y,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(t,e,r){e=i(e,0);var o=n.unpack(t,e,O);e+=n.packedLength;var u=R.unpack(t,e,y);e+=R.packedLength;var E=t[e++],s=t[e];return a(r)?(r._radii=n.clone(o,r._radii),r._vertexFormat=R.clone(u,r._vertexFormat),r._stackPartitions=E,r._slicePartitions=s,r):(p.stackPartitions=E,p.slicePartitions=s,new f(p))},f.createGeometry=function(i){var a=i._radii;if(!(a.x<=0||a.y<=0||a.z<=0)){var o,R,f=u.fromCartesian3(a),S=i._vertexFormat,O=i._slicePartitions+1,y=i._stackPartitions+1,p=y*O,C=new Float64Array(3*p),U=6*(O-1)*(y-2),L=_.createTypedArray(p,U),F=S.normal?new Float32Array(3*p):void 0,P=S.tangent?new Float32Array(3*p):void 0,v=S.binormal?new Float32Array(3*p):void 0,w=S.st?new Float32Array(2*p):void 0,g=new Array(O),x=new Array(O),D=0;for(o=0;oC.length&&(D=3*(o-O*Math.floor(.5*y))),n.fromArray(C,D,j),f.geodeticSurfaceNormal(j,j),e.negate(j,j)),w[H++]=Math.atan2(j.y,j.x)/T.TWO_PI+.5,w[H++]=Math.asin(Z.z)/Math.PI+.5}if(S.normal&&(F[W++]=Z.x,F[W++]=Z.y,F[W++]=Z.z),S.tangent||S.binormal){var Q=h;if(op-O-1?(n.cross(n.UNIT_X,Z,Q),n.normalize(Q,Q)):(n.cross(n.UNIT_Z,Z,Q),n.normalize(Q,Q)),S.tangent&&(P[Y++]=Q.x,P[Y++]=Q.y,P[Y++]=Q.z),S.binormal){var J=n.cross(Z,Q,d);n.normalize(J,J),v[k++]=J.x,v[k++]=J.y,v[k++]=J.z}}}S.st&&(q.st=new s({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:w})),S.normal&&(q.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:F})),S.tangent&&(q.tangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:P})),S.binormal&&(q.binormal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:v}))}for(D=0,R=0;R