232 lines
245 KiB
JavaScript
232 lines
245 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.
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
@license
|
||
|
when.js - https://github.com/cujojs/when
|
||
|
|
||
|
MIT License (c) copyright B Cavalier & J Hann
|
||
|
|
||
|
* A lightweight CommonJS Promises/A and when() implementation
|
||
|
* when is part of the cujo.js family of libraries (http://cujojs.com/)
|
||
|
*
|
||
|
* Licensed under the MIT License at:
|
||
|
* http://www.opensource.org/licenses/mit-license.php
|
||
|
*
|
||
|
* @version 1.7.1
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
@license
|
||
|
sprintf.js from the php.js project - https://github.com/kvz/phpjs
|
||
|
Directly from https://github.com/kvz/phpjs/blob/master/functions/strings/sprintf.js
|
||
|
|
||
|
php.js is copyright 2012 Kevin van Zonneveld.
|
||
|
|
||
|
Portions copyright Brett Zamir (http://brett-zamir.me), Kevin van Zonneveld
|
||
|
(http://kevin.vanzonneveld.net), Onno Marsman, Theriault, Michael White
|
||
|
(http://getsprink.com), Waldo Malqui Silva, Paulo Freitas, Jack, Jonas
|
||
|
Raoni Soares Silva (http://www.jsfromhell.com), Philip Peterson, Legaev
|
||
|
Andrey, Ates Goral (http://magnetiq.com), Alex, Ratheous, Martijn Wieringa,
|
||
|
Rafa? Kukawski (http://blog.kukawski.pl), lmeyrick
|
||
|
(https://sourceforge.net/projects/bcmath-js/), Nate, Philippe Baumann,
|
||
|
Enrique Gonzalez, Webtoolkit.info (http://www.webtoolkit.info/), Carlos R.
|
||
|
L. Rodrigues (http://www.jsfromhell.com), Ash Searle
|
||
|
(http://hexmen.com/blog/), Jani Hartikainen, travc, Ole Vrijenhoek,
|
||
|
Erkekjetter, Michael Grier, Rafa? Kukawski (http://kukawski.pl), Johnny
|
||
|
Mast (http://www.phpvrouwen.nl), T.Wild, d3x,
|
||
|
http://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript,
|
||
|
Rafa? Kukawski (http://blog.kukawski.pl/), stag019, pilus, WebDevHobo
|
||
|
(http://webdevhobo.blogspot.com/), marrtins, GeekFG
|
||
|
(http://geekfg.blogspot.com), Andrea Giammarchi
|
||
|
(http://webreflection.blogspot.com), Arpad Ray (mailto:arpad@php.net),
|
||
|
gorthaur, Paul Smith, Tim de Koning (http://www.kingsquare.nl), Joris, Oleg
|
||
|
Eremeev, Steve Hilder, majak, gettimeofday, KELAN, Josh Fraser
|
||
|
(http://onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/),
|
||
|
Marc Palau, Martin
|
||
|
(http://www.erlenwiese.de/), Breaking Par Consulting Inc
|
||
|
(http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256CFB006C45F7),
|
||
|
Chris, Mirek Slugen, saulius, Alfonso Jimenez
|
||
|
(http://www.alfonsojimenez.com), Diplom@t (http://difane.com/), felix,
|
||
|
Mailfaker (http://www.weedem.fr/), Tyler Akins (http://rumkin.com), Caio
|
||
|
Ariede (http://caioariede.com), Robin, Kankrelune
|
||
|
(http://www.webfaktory.info/), Karol Kowalski, Imgen Tata
|
||
|
(http://www.myipdf.com/), mdsjack (http://www.mdsjack.bo.it), Dreamer,
|
||
|
Felix Geisendoerfer (http://www.debuggable.com/felix), Lars Fischer, AJ,
|
||
|
David, Aman Gupta, Michael White, Public Domain
|
||
|
(http://www.json.org/json2.js), Steven Levithan
|
||
|
(http://blog.stevenlevithan.com), Sakimori, Pellentesque Malesuada,
|
||
|
Thunder.m, Dj (http://phpjs.org/functions/htmlentities:425#comment_134018),
|
||
|
Steve Clay, David James, Francois, class_exists, nobbler, T. Wild, Itsacon
|
||
|
(http://www.itsacon.net/), date, Ole Vrijenhoek (http://www.nervous.nl/),
|
||
|
Fox, Raphael (Ao RUDLER), Marco, noname, Mateusz "loonquawl" Zalega, Frank
|
||
|
Forte, Arno, ger, mktime, john (http://www.jd-tech.net), Nick Kolosov
|
||
|
(http://sammy.ru), marc andreu, Scott Cariss, Douglas Crockford
|
||
|
(http://javascript.crockford.com), madipta, Slawomir Kaniecki,
|
||
|
ReverseSyntax, Nathan, Alex Wilson, kenneth, Bayron Guevara, Adam Wallner
|
||
|
(http://web2.bitbaro.hu/), paulo kuong, jmweb, Lincoln Ramsay, djmix,
|
||
|
Pyerre, Jon Hohle, Thiago Mata (http://thiagomata.blog.com), lmeyrick
|
||
|
(https://sourceforge.net/projects/bcmath-js/this.), Linuxworld, duncan,
|
||
|
Gilbert, Sanjoy Roy, Shingo, sankai, Oskar Larsson H?gfeldt
|
||
|
(http://oskar-lh.name/), Denny Wardhana, 0m3r, Everlasto, Subhasis Deb,
|
||
|
josh, jd, Pier Paolo Ramon (http://www.mastersoup.com/), P, merabi, Soren
|
||
|
Hansen, Eugene Bulkin (http://doubleaw.com/), Der Simon
|
||
|
(http://innerdom.sourceforge.net/), echo is bad, Ozh, XoraX
|
||
|
(http://www.xorax.info), EdorFaus, JB, J A R, Marc Jansen, Francesco, LH,
|
||
|
Stoyan Kyosev (http://www.svest.org/), nord_ua, omid
|
||
|
(http://phpjs.org/functions/380:380#comment_137122), Brad Touesnard, MeEtc
|
||
|
(http://yass.meetcweb.com), Peter-Paul Koch
|
||
|
(http://www.quirksmode.org/js/beat.html), Olivier Louvignes
|
||
|
(http://mg-crea.com/), T0bsn, Tim Wiel, Bryan Elliott, Jalal Berrami,
|
||
|
Martin, JT, David Randall, Thomas Beaucourt (http://www.webapp.fr), taith,
|
||
|
vlado houba, Pierre-Luc Paour, Kristof Coomans (SCK-CEN Belgian Nucleair
|
||
|
Research Centre), Martin Pool, Kirk Strobeck, Rick Waldron, Brant Messenger
|
||
|
(http://www.brantmessenger.com/), Devan Penner-Woelk, Saulo Vallory, Wagner
|
||
|
B. Soares, Artur Tchernychev, Valentina De Rosa, Jason Wong
|
||
|
(http://carrot.org/), Christoph, Daniel Esteban, strftime, Mick@el, rezna,
|
||
|
Simon Willison (http://simonwillison.net), Anton Ongson, Gabriel Paderni,
|
||
|
Marco van Oort, penutbutterjelly, Philipp Lenssen, Bjorn Roesbeke
|
||
|
(http://www.bjornroesbeke.be/), Bug?, Eric Nagel, Tomasz Wesolowski,
|
||
|
Evertjan Garretsen, Bobby Drake, Blues (http://tech.bluesmoon.info/), Luke
|
||
|
Godfrey, Pul, uestla, Alan C, Ulrich, Rafal Kukawski, Yves Sucaet,
|
||
|
sowberry, Norman "zEh" Fuchs, hitwork, Zahlii, johnrembo, Nick Callen,
|
||
|
Steven Levithan (stevenlevithan.com), ejsanders, Scott Baker, Brian Tafoya
|
||
|
(http://www.premasolutions.com/), Philippe Jausions
|
||
|
(http://pear.php.net/user/jausions), Aidan Lister
|
||
|
(http://aidanlister.com/), Rob, e-mike, HKM, ChaosNo1, metjay, strcasecmp,
|
||
|
strcmp, Taras Bogach, jpfle, Alexander Ermolaev
|
||
|
(http://snippets.dzone.com/user/AlexanderErmolaev), DxGx, kilops, Orlando,
|
||
|
dptr1988, Le Torbi, James (http://www.james-bell.co.uk/), Pedro Tainha
|
||
|
(http://www.pedrotainha.com), James, Arnout Kazemier
|
||
|
(http://www.3rd-Eden.com), Chris McMacken, gabriel paderni, Yannoo,
|
||
|
FGFEmperor, baris ozdil, Tod Gentille, Greg Frazier, jakes, 3D-GRAF, Allan
|
||
|
Jensen (http://www.winternet.no), Howard Yeend, Benjamin Lupton, davook,
|
||
|
daniel airton wermann (http://wermann.com.br), Atli T¨®r, Maximusya, Ryan
|
||
|
W Tenney (http://ryan.10e.us), Alexander M Beedie, fearphage
|
||
|
(http://http/my.opera.com/fearphage/), Nathan Sepulveda, Victor, Matteo,
|
||
|
Billy, stensi, Cord, Manish, T.J. Leahy, Riddler
|
||
|
(http://www.frontierwebdev.com/), Rafa? Kukawski, FremyCompany, Matt
|
||
|
Bradley, Tim de Koning, Luis Salazar (http://www.freaky-media.com/), Diogo
|
||
|
Resende, Rival, Andrej Pavlovic, Garagoth, Le Torbi
|
||
|
(http://www.letorbi.de/), Dino, Josep Sanz (http://www.ws3.es/), rem,
|
||
|
Russell Walker (http://www.nbill.co.uk/), Jamie Beck
|
||
|
(http://www.terabit.ca/), setcookie, Michael, YUI Library:
|
||
|
http://developer.yahoo.com/yui/docs/YAHOO.util.DateLocale.html, Blues at
|
||
|
http://hacks.bluesmoon.info/strftime/strftime.js, Ben
|
||
|
(http://benblume.co.uk/), DtTvB
|
||
|
(http://dt.in.th/2008-09-16.string-length-in-bytes.html), Andreas, William,
|
||
|
meo, incidence, Cagri Ekin, Amirouche, Amir Habibi
|
||
|
(http://www.residence-mixte.com/), Luke Smith (http://lucassmith.name),
|
||
|
Kheang Hok Chin (http://www.distantia.ca/), Jay Klehr, Lorenzo Pisani,
|
||
|
Tony, Yen-Wei Liu, Greenseed, mk.keck, Leslie Hoare, dude, booeyOH, Ben
|
||
|
Bryan
|
||
|
|
||
|
Licensed under the MIT (MIT-LICENSE.txt) license.
|
||
|
|
||
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||
|
copy of this software and associated documentation files (the
|
||
|
"Software"), to deal in the Software without restriction, including
|
||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||
|
permit persons to whom the Software is furnished to do so, subject to
|
||
|
the following conditions:
|
||
|
|
||
|
The above copyright notice and this permission notice shall be included
|
||
|
in all copies or substantial portions of the Software.
|
||
|
|
||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||
|
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||
|
IN NO EVENT SHALL KEVIN VAN ZONNEVELD BE LIABLE FOR ANY CLAIM, DAMAGES
|
||
|
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||
|
OTHER DEALINGS IN THE SOFTWARE.
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* @license
|
||
|
*
|
||
|
* Grauw URI utilities
|
||
|
*
|
||
|
* See: http://hg.grauw.nl/grauw-lib/file/tip/src/uri.js
|
||
|
*
|
||
|
* @author Laurens Holst (http://www.grauw.nl/)
|
||
|
*
|
||
|
* Copyright 2012 Laurens Holst
|
||
|
*
|
||
|
* 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.
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
!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 i={};return i.typeOf={},i.defined=function(n,i){if(!e(i))throw new t(r(n))},i.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},i.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},i.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},i.typeOf.number.lessThan=function(e,r,n){if(i.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},i.typeOf.number.lessThanOrEquals=function(e,r,n){if(i.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},i.typeOf.number.greaterThan=function(e,r,n){if(i.typeOf.number(e,r),n>=r)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},i.typeOf.number.greaterThanOrEquals=function(e,r,n){if(i.typeOf.number(e,r),n>r)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},i.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},i.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},i.typeOf.number.equals=function(e,r,n,o){if(i.typeOf.number(e,n),i.typeOf.number(r,o),n!==o)throw new t(e+" must be equal to "+r+", the actual values are "+n+" and "+o)},i}),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","./Check","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n,i){"use strict";var o={};o.Radious=6378137,o.EPSILON1=.1,o.EPSILON2=.01,o.EPSILON3=.001,o.EPSILON4=1e-4,o.EPSILON5=1e-5,o.EPSILON6=1e-6,o.EPSILON7=1e-7,o.EPSILON8=1e-8,o.EPSILON9=1e-9,o.EPSILON10=1e-10,o.EPSILON11=1e-11,o.EPSILON12=1e-12,o.EPSILON13=1e-13
|
||
|
t.typeOf.object("result",n);var i=e[r],o=e[r+3],a=e[r+6];return n.x=i,n.y=o,n.z=a,n},u.setRow=function(e,r,n,i){return t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",r,0),t.typeOf.number.lessThanOrEquals("index",r,2),t.typeOf.object("cartesian",n),t.typeOf.object("result",i),i=u.clone(e,i),i[r]=n.x,i[r+3]=n.y,i[r+6]=n.z,i};var h=new e;u.getScale=function(r,n){return t.typeOf.object("matrix",r),t.typeOf.object("result",n),n.x=e.magnitude(e.fromElements(r[0],r[1],r[2],h)),n.y=e.magnitude(e.fromElements(r[3],r[4],r[5],h)),n.z=e.magnitude(e.fromElements(r[6],r[7],r[8],h)),n};var d=new e;u.getMaximumScale=function(t){return u.getScale(t,d),e.maximumComponent(d)},u.multiply=function(e,r,n){t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n);var i=e[0]*r[0]+e[3]*r[1]+e[6]*r[2],o=e[1]*r[0]+e[4]*r[1]+e[7]*r[2],a=e[2]*r[0]+e[5]*r[1]+e[8]*r[2],s=e[0]*r[3]+e[3]*r[4]+e[6]*r[5],u=e[1]*r[3]+e[4]*r[4]+e[7]*r[5],c=e[2]*r[3]+e[5]*r[4]+e[8]*r[5],l=e[0]*r[6]+e[3]*r[7]+e[6]*r[8],f=e[1]*r[6]+e[4]*r[7]+e[7]*r[8],h=e[2]*r[6]+e[5]*r[7]+e[8]*r[8];return n[0]=i,n[1]=o,n[2]=a,n[3]=s,n[4]=u,n[5]=c,n[6]=l,n[7]=f,n[8]=h,n},u.add=function(e,r,n){return t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n),n[0]=e[0]+r[0],n[1]=e[1]+r[1],n[2]=e[2]+r[2],n[3]=e[3]+r[3],n[4]=e[4]+r[4],n[5]=e[5]+r[5],n[6]=e[6]+r[6],n[7]=e[7]+r[7],n[8]=e[8]+r[8],n},u.subtract=function(e,r,n){return t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n),n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],n[3]=e[3]-r[3],n[4]=e[4]-r[4],n[5]=e[5]-r[5],n[6]=e[6]-r[6],n[7]=e[7]-r[7],n[8]=e[8]-r[8],n},u.multiplyByVector=function(e,r,n){t.typeOf.object("matrix",e),t.typeOf.object("cartesian",r),t.typeOf.object("result",n);var i=r.x,o=r.y,a=r.z,s=e[0]*i+e[3]*o+e[6]*a,u=e[1]*i+e[4]*o+e[7]*a,c=e[2]*i+e[5]*o+e[8]*a;return n.x=s,n.y=u,n.z=c,n},u.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},u.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},u.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},u.transpose=function(e,r){t.typeOf.object("matrix",e),t.typeOf.object("result",r);var n=e[0],i=e[3],o=e[6],a=e[1],s=e[4],u=e[7],c=e[2],l=e[5],f=e[8];return r[0]=n,r[1]=i,r[2]=o,r[3]=a,r[4]=s,r[5]=u,r[6]=c,r[7]=l,r[8]=f,r};var p=[1,0,0],y=[2,2,1],m=new u,E=new u;return u.computeEigenDecomposition=function(e,r){t.typeOf.object("matrix",e);var i=s.EPSILON20,o=10,a=0,h=0;n(r)||(r={});for(var d=r.unitary=u.clone(u.IDENTITY,r.unitary),p=r.diagonal=u.clone(e,r.diagonal),y=i*c(p);o>h&&l(p)>y;)f(p,m),u.transpose(m,E),u.multiply(p,m,p),u.multiply(E,p,p),u.multiply(d,m,d),++a>2&&(++h,a=0);return r},u.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},u.determinant=function(e){t.typeOf.object("matrix",e);var r=e[0],n=e[3],i=e[6],o=e[1],a=e[4],s=e[7],u=e[2],c=e[5],l=e[8];return r*(a*l-c*s)+o*(c*i-n*l)+u*(n*s-a*i)},u.inverse=function(e,r){t.typeOf.object("matrix",e),t.typeOf.object("result",r);var n=e[0],i=e[1],a=e[2],c=e[3],l=e[4],f=e[5],h=e[6],d=e[7],p=e[8],y=u.determinant(e);if(Math.abs(y)<=s.EPSILON15)throw new o("matrix is not invertible");r[0]=l*p-d*f,r[1]=d*a-i*p,r[2]=i*f-l*a,r[3]=h*f-c*p,r[4]=n*p-h*a,r[5]=c*a-n*f,r[6]=c*d-h*l,r[7]=h*i-n*d,r[8]=n*l-c*i;var m=1/y;return u.multiplyByScalar(r,m,r)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[
|
||
|
var p=e[h];i=Math.min(i,p.longitude),o=Math.max(o,p.longitude),l=Math.min(l,p.latitude),f=Math.max(f,p.latitude);var y=p.longitude>=0?p.longitude:p.longitude+s.TWO_PI;a=Math.min(a,y),c=Math.max(c,y)}return o-i>c-a&&(i=a,o=c,o>s.PI&&(o-=s.TWO_PI),i>s.PI&&(i-=s.TWO_PI)),n(r)?(r.west=i,r.south=l,r.east=o,r.north=f,r):new u(i,l,o,f)},u.fromCartesianArray=function(e,i,a){t.defined("cartesians",e),i=r(i,o.WGS84);for(var c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=Number.MAX_VALUE,p=-Number.MAX_VALUE,y=0,m=e.length;m>y;y++){var E=i.cartesianToCartographic(e[y]);c=Math.min(c,E.longitude),l=Math.max(l,E.longitude),d=Math.min(d,E.latitude),p=Math.max(p,E.latitude);var O=E.longitude>=0?E.longitude:E.longitude+s.TWO_PI;f=Math.min(f,O),h=Math.max(h,O)}return l-c>h-f&&(c=f,l=h,l>s.PI&&(l-=s.TWO_PI),c>s.PI&&(c-=s.TWO_PI)),n(a)?(a.west=c,a.south=d,a.east=l,a.north=p,a):new u(c,d,l,p)},u.clone=function(e,t){return n(e)?n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.equalsEpsilon=function(e,r,i){return t.typeOf.number("absoluteEpsilon",i),e===r||n(e)&&n(r)&&Math.abs(e.west-r.west)<=i&&Math.abs(e.south-r.south)<=i&&Math.abs(e.east-r.east)<=i&&Math.abs(e.north-r.north)<=i},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.prototype.equalsEpsilon=function(e,r){return t.typeOf.number("epsilon",r),u.equalsEpsilon(this,e,r)},u.validate=function(e){t.typeOf.object("rectangle",e);var r=e.north;t.typeOf.number.greaterThanOrEquals("north",r,-s.PI_OVER_TWO),t.typeOf.number.lessThanOrEquals("north",r,s.PI_OVER_TWO);var n=e.south;t.typeOf.number.greaterThanOrEquals("south",n,-s.PI_OVER_TWO),t.typeOf.number.lessThanOrEquals("south",n,s.PI_OVER_TWO);var i=e.west;t.typeOf.number.greaterThanOrEquals("west",i,-Math.PI),t.typeOf.number.lessThanOrEquals("west",i,Math.PI);var o=e.east;t.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),t.typeOf.number.lessThanOrEquals("east",o,Math.PI)},u.southwest=function(r,i){return t.typeOf.object("rectangle",r),n(i)?(i.longitude=r.west,i.latitude=r.south,i.height=0,i):new e(r.west,r.south)},u.northwest=function(r,i){return t.typeOf.object("rectangle",r),n(i)?(i.longitude=r.west,i.latitude=r.north,i.height=0,i):new e(r.west,r.north)},u.northeast=function(r,i){return t.typeOf.object("rectangle",r),n(i)?(i.longitude=r.east,i.latitude=r.north,i.height=0,i):new e(r.east,r.north)},u.southeast=function(r,i){return t.typeOf.object("rectangle",r),n(i)?(i.longitude=r.east,i.latitude=r.south,i.height=0,i):new e(r.east,r.south)},u.center=function(r,i){t.typeOf.object("rectangle",r);var o=r.east,a=r.west;a>o&&(o+=s.TWO_PI);var u=s.negativePiToPi(.5*(a+o)),c=.5*(r.south+r.north);return n(i)?(i.longitude=u,i.latitude=c,i.height=0,i):new e(u,c)},u.intersection=function(e,r,i){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",r);var o=e.east,a=e.west,c=r.east,l=r.west;a>o&&c>0?o+=s.TWO_PI:l>c&&o>0&&(c+=s.TWO_PI),a>o&&0>l?l+=s.TWO_PI:l>c&&0>a&&(a+=s.TWO_PI);var f=s.negativePiToPi(Math.max(a,l)),h=s.negativePiToPi(Math.min(o,c));if(!((e.west<e.east||r.west<r.east)&&f>=h)){var d=Math.max(e.south,r.south),p=Math.min(e.north,r.north);if(!(d>=p))return n(i)?(i.west=f,i.south=d,i.east=h,i.north=p,i):new u(f,d,h,p)}},u.simpleIntersection=function(e,r,i){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",r);var o=Math.max(e.west,r.west),a=Math.max(e.south,r.south),s=Math.min(e.east,r.east),c=Math.min(e.north,r.north);return a>=c||o>=s?void 0:n(i)?(i.west=o,i.south=a,i.east=s,i.north=c,i):new u(o,a,s,c)},u.union=function(e,r,i){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",r),n(i)||(i=new u);var o=e.east,a=e.west,c=r.east,l=r.west;a>o&&c>0?o+=s.TWO_PI:l>c&&o>0&&(c+=s.TWO_PI),a>o&&0>l?l+=s.TWO_PI:l>c&&0>a&&(a+=s.TWO_PI);var f=s.convertLongitudeRange(Math.min(a,l)),h=s.convertLongitudeRange(Math.max(o,c));return i.west
|
||
|
s.DARKMAGENTA=i(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=i(s.fromCssColorString("#556B2F")),s.DARKORANGE=i(s.fromCssColorString("#FF8C00")),s.DARKORCHID=i(s.fromCssColorString("#9932CC")),s.DARKRED=i(s.fromCssColorString("#8B0000")),s.DARKSALMON=i(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=i(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=i(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=i(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=i(s.fromCssColorString("#00CED1")),s.DARKVIOLET=i(s.fromCssColorString("#9400D3")),s.DEEPPINK=i(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=i(s.fromCssColorString("#00BFFF")),s.DIMGRAY=i(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=i(s.fromCssColorString("#1E90FF")),s.FIREBRICK=i(s.fromCssColorString("#B22222")),s.FLORALWHITE=i(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=i(s.fromCssColorString("#228B22")),s.FUCHSIA=i(s.fromCssColorString("#FF00FF")),s.GAINSBORO=i(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=i(s.fromCssColorString("#F8F8FF")),s.GOLD=i(s.fromCssColorString("#FFD700")),s.GOLDENROD=i(s.fromCssColorString("#DAA520")),s.GRAY=i(s.fromCssColorString("#808080")),s.GREEN=i(s.fromCssColorString("#008000")),s.GREENYELLOW=i(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=i(s.fromCssColorString("#F0FFF0")),s.HOTPINK=i(s.fromCssColorString("#FF69B4")),s.INDIANRED=i(s.fromCssColorString("#CD5C5C")),s.INDIGO=i(s.fromCssColorString("#4B0082")),s.IVORY=i(s.fromCssColorString("#FFFFF0")),s.KHAKI=i(s.fromCssColorString("#F0E68C")),s.LAVENDER=i(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=i(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=i(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=i(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=i(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=i(s.fromCssColorString("#F08080")),s.LIGHTCYAN=i(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=i(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=i(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=i(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=i(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=i(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=i(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=i(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=i(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=i(s.fromCssColorString("#FFFFE0")),s.LIME=i(s.fromCssColorString("#00FF00")),s.LIMEGREEN=i(s.fromCssColorString("#32CD32")),s.LINEN=i(s.fromCssColorString("#FAF0E6")),s.MAGENTA=i(s.fromCssColorString("#FF00FF")),s.MAROON=i(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=i(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=i(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=i(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=i(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=i(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=i(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=i(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=i(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=i(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=i(s.fromCssColorString("#191970")),s.MINTCREAM=i(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=i(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=i(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=i(s.fromCssColorString("#FFDEAD")),s.NAVY=i(s.fromCssColorString("#000080")),s.OLDLACE=i(s.fromCssColorString("#FDF5E6")),s.OLIVE=i(s.fromCssColorString("#808000")),s.OLIVEDRAB=i(s.fromCssColorString("#6B8E23")),s.ORANGE=i(s.fromCssColorString("#FFA500")),s.ORANGERED=i(s.fromCssColorString("#FF4500")),s.ORCHID=i(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=i(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=i(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=i(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=i(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=i(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=i(s.fromCssColorString("#FFDAB9")),s.PERU=i(s.fromCssColorString("#CD853F")),s.PINK=i(s.fromCssColorString("#FFC0CB")),s.PLUM=i(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=i
|
||
|
t.typeOf.object("result",r);var n=e[0],i=e[2],o=e[1],a=e[3];return r[0]=n,r[1]=i,r[2]=o,r[3]=a,r},a.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},a.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]},a.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]},a.equalsEpsilon=function(e,r,i){return t.typeOf.number("epsilon",i),e===r||n(e)&&n(r)&&Math.abs(e[0]-r[0])<=i&&Math.abs(e[1]-r[1])<=i&&Math.abs(e[2]-r[2])<=i&&Math.abs(e[3]-r[3])<=i},a.IDENTITY=o(new a(1,0,0,1)),a.ZERO=o(new a(0,0,0,0)),a.COLUMN0ROW0=0,a.COLUMN0ROW1=1,a.COLUMN1ROW0=2,a.COLUMN1ROW1=3,i(a.prototype,{length:{get:function(){return a.packedLength}}}),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},a}),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/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,n,i,o,a,s){"use strict";function u(e,t,n,i){this.x=r(e,0),this.y=r(t,0),this.z=r(n,0),this.w=r(i,0)}var c=new e;u.fromAxisAngle=function(r,i,o){t.typeOf.object("axis",r),t.typeOf.number("angle",i);var a=i/2,s=Math.sin(a);c=e.normalize(r,c);var l=c.x*s,f=c.y*s,h=c.z*s,d=Math.cos(a);return n(o)?(o.x=l,o.y=f,o.z=h,o.w=d,o):new u(l,f,h,d)};var l=[1,2,0],f=new Array(3);u.fromRotationMatrix=function(e,r){t.typeOf.object("matrix",e);var i,o,a,c,h,d=e[s.COLUMN0ROW0],p=e[s.COLUMN1ROW1],y=e[s.COLUMN2ROW2],m=d+p+y;if(m>0)i=Math.sqrt(m+1),h=.5*i,i=.5/i,o=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*i,a=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*i,c=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*i;else{var E=l,O=0;p>d&&(O=1),y>d&&y>p&&(O=2);var _=E[O],T=E[_];i=Math.sqrt(e[s.getElementIndex(O,O)]-e[s.getElementIndex(_,_)]-e[s.getElementIndex(T,T)]+1);var R=f;R[O]=.5*i,i=.5/i,h=(e[s.getElementIndex(T,_)]-e[s.getElementIndex(_,T)])*i,R[_]=(e[s.getElementIndex(_,O)]+e[s.getElementIndex(O,_)])*i,R[T]=(e[s.getElementIndex(T,O)]+e[s.getElementIndex(O,T)])*i,o=-R[0],a=-R[1],c=-R[2]}return n(r)?(r.x=o,r.y=a,r.z=c,r.w=h,r):new u(o,a,c,h)};var h=new u,d=new u,p=new u,y=new u;u.fromHeadingPitchRoll=function(r,n){return t.typeOf.object("headingPitchRoll",r),y=u.fromAxisAngle(e.UNIT_X,r.roll,h),p=u.fromAxisAngle(e.UNIT_Y,-r.pitch,n),n=u.multiply(p,y,p),d=u.fromAxisAngle(e.UNIT_Z,-r.heading,h),u.multiply(d,n,n)};var m=new e,E=new e,O=new u,_=new u,T=new u;u.packedLength=4,u.pack=function(e,n,i){return t.typeOf.object("value",e),t.defined("array",n),i=r(i,0),n[i++]=e.x,n[i++]=e.y,n[i++]=e.z,n[i]=e.w,n},u.unpack=function(e,i,o){return t.defined("array",e),i=r(i,0),n(o)||(o=new u),o.x=e[i],o.y=e[i+1],o.z=e[i+2],o.w=e[i+3],o},u.packedInterpolationLength=3,u.convertPackedArrayForInterpolation=function(e,t,r,n){u.unpack(e,4*r,T),u.conjugate(T,T);for(var i=0,o=r-t+1;o>i;i++){var a=3*i;u.unpack(e,4*(t+i),O),u.multiply(O,T,O),O.w<0&&u.negate(O,O),u.computeAxis(O,m);var s=u.computeAngle(O);n[a]=m.x*s,n[a+1]=m.y*s,n[a+2]=m.z*s}},u.unpackInterpolationResult=function(t,r,i,o,a){n(a)||(a=new u),e.fromArray(t,0,E);var s=e.magnitude(E);return u.unpack(r,4*o,_),0===s?u.clone(u.IDENTITY,O):u.fromAxisAngle(E,s,O),u.multiply(O,_,a)},u.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 u(e.x,e.y,e.z,e.w):void 0},u.conjugate=function(e,r){return t.typeOf.object("quaternion",e),t.typeOf.object("result",r),r.x=-e.x,r.y
|
||
|
}},maximumLength:{get:function(){return this._maximumLength},set:function(e){this._maximumLength=e,this._length>e&&e>0&&(this._length=e,this._array.length=e)}},comparator:{get:function(){return this._comparator}}}),i.prototype.reserve=function(e){e=t(e,this._length),this._array.length=e},i.prototype.heapify=function(e){e=t(e,0);for(var r=this._length,n=this._comparator,i=this._array,a=-1,s=!0;s;){var u=2*(e+1),c=u-1;a=r>c&&n(i[c],i[e])<0?c:e,r>u&&n(i[u],i[a])<0&&(a=u),a!==e?(o(i,a,e),e=a):s=!1}},i.prototype.resort=function(){for(var e=this._length,t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},i.prototype.insert=function(t){e.defined("element",t);var n=this._array,i=this._comparator,a=this._maximumLength,s=this._length++;for(s<n.length?n[s]=t:n.push(t);0!==s;){var u=Math.floor((s-1)/2);if(!(i(n[s],n[u])<0))break;o(n,s,u),s=u}var c;return r(a)&&this._length>a&&(c=n[a],this._length=a),c},i.prototype.pop=function(r){if(r=t(r,0),0!==this._length){e.typeOf.number.lessThan("index",r,this._length);var n=this._array,i=n[r];return o(n,r,--this._length),this.heapify(r),i}},i}),define("Core/RequestScheduler",["../ThirdParty/Uri","../ThirdParty/when","./Check","./defaultValue","./defined","./defineProperties","./Event","./Heap","./isBlobUri","./isDataUri","./RequestState"],function(e,t,r,n,i,o,a,s,u,c,l){"use strict";function f(e,t){return e.priority-t.priority}function h(){}function d(e){i(e.priorityFunction)&&(e.priority=e.priorityFunction())}function p(e){var t=n(h.requestsByServer[e],h.maximumRequestsPerServer);return b[e]<t}function y(e){return e.state===l.UNISSUED&&(e.state=l.ISSUED,e.deferred=t.defer()),e.deferred.promise}function m(e){return function(t){e.state!==l.CANCELLED&&(--R.numberOfActiveRequests,--b[e.serverKey],v.raiseEvent(),e.state=l.RECEIVED,e.deferred.resolve(t))}}function E(e){return function(t){e.state!==l.CANCELLED&&(++R.numberOfFailedRequests,--R.numberOfActiveRequests,--b[e.serverKey],v.raiseEvent(t),e.state=l.FAILED,e.deferred.reject(t))}}function O(e){var t=y(e);return e.state=l.ACTIVE,A.push(e),++R.numberOfActiveRequests,++R.numberOfActiveRequestsEver,++b[e.serverKey],e.requestFunction().then(m(e)).otherwise(E(e)),t}function _(e){var t=e.state===l.ACTIVE;e.state=l.CANCELLED,++R.numberOfCancelledRequests,e.deferred.reject(),t&&(--R.numberOfActiveRequests,--b[e.serverKey],++R.numberOfCancelledActiveRequests),i(e.cancelFunction)&&e.cancelFunction()}function T(){h.debugShowStatistics&&(0===R.numberOfActiveRequests&&R.lastNumberOfActiveRequests>0&&(R.numberOfAttemptedRequests>0&&(console.log("Number of attempted requests: "+R.numberOfAttemptedRequests),R.numberOfAttemptedRequests=0),R.numberOfCancelledRequests>0&&(console.log("Number of cancelled requests: "+R.numberOfCancelledRequests),R.numberOfCancelledRequests=0),R.numberOfCancelledActiveRequests>0&&(console.log("Number of cancelled active requests: "+R.numberOfCancelledActiveRequests),R.numberOfCancelledActiveRequests=0),R.numberOfFailedRequests>0&&(console.log("Number of failed requests: "+R.numberOfFailedRequests),R.numberOfFailedRequests=0)),R.lastNumberOfActiveRequests=R.numberOfActiveRequests)}var R={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},g=20,w=new s({comparator:f});w.maximumLength=g,w.reserve(g);var A=[],b={},S="undefined"!=typeof document?new e(document.location.href):new e,v=new a;return h.maximumRequests=50,h.maximumRequestsPerServer=6,h.requestsByServer={"api.cesium.com:443":18,"assets.cesium.com:443":18},h.throttleRequests=!0,h.debugShowStatistics=!1,h.requestCompletedEvent=v,o(h,{statistics:{get:function(){return R}},priorityHeapLength:{get:function(){return g},set:function(e){if(g>e)for(;w.length>e;){var t=w.pop();_(t)}g=e,w.maximumLength=e,w.reserve(e)}}}),h.update=function(){var e,t,r=0,n=A.length;for(e=0;n>e;++e)t=A[e],t.cancelled&&_(t),t.state===l.ACTIVE?r>0&&(A[e-r]=t):++r;A.length-=r;var i=w.internalArray,o=w.length;for(e=0;o>e;++e)d(i[e]);w.resort();for(var a=Math.max(h.maximumRe
|
||
|
if(!g.hasOwnProperty(e)||!g[e].hasOwnProperty(t))throw new u("firstAxis and secondAxis must be east, north, up, west, south or down.");var n,i=g[e][t],o=e+t;return s(A[o])?n=A[o]:(n=function(n,o,c){if(!s(n))throw new u("origin is required.");if(s(c)||(c=new O),m.equalsEpsilon(n.x,0,m.EPSILON14)&&m.equalsEpsilon(n.y,0,m.EPSILON14)){var l=m.sign(n.z);r.unpack(w[e],0,S),"east"!==e&&"west"!==e&&r.multiplyByScalar(S,l,S),r.unpack(w[t],0,v),"east"!==t&&"west"!==t&&r.multiplyByScalar(v,l,v),r.unpack(w[i],0,C),"east"!==i&&"west"!==i&&r.multiplyByScalar(C,l,C)}else{o=a(o,f.WGS84),o.geodeticSurfaceNormal(n,b.up);var h=b.up,d=b.east;d.x=-n.y,d.y=n.x,d.z=0,r.normalize(d,b.east),r.cross(h,d,b.north),r.multiplyByScalar(b.up,-1,b.down),r.multiplyByScalar(b.east,-1,b.west),r.multiplyByScalar(b.north,-1,b.south),S=b[e],v=b[t],C=b[i]}return c[0]=S.x,c[1]=S.y,c[2]=S.z,c[3]=0,c[4]=v.x,c[5]=v.y,c[6]=v.z,c[7]=0,c[8]=C.x,c[9]=C.y,c[10]=C.z,c[11]=0,c[12]=n.x,c[13]=n.y,c[14]=n.z,c[15]=1,c},A[o]=n),n},R.eastNorthUpToFixedFrame=R.localFrameToFixedFrameGenerator("east","north"),R.northEastDownToFixedFrame=R.localFrameToFixedFrameGenerator("north","east"),R.northUpEastToFixedFrame=R.localFrameToFixedFrameGenerator("north","up"),R.northWestUpToFixedFrame=R.localFrameToFixedFrameGenerator("north","west");var I=new _,N=new r(1,1,1),M=new O;R.headingPitchRollToFixedFrame=function(e,t,n,i,s){o.typeOf.object("HeadingPitchRoll",t),i=a(i,R.eastNorthUpToFixedFrame);var u=_.fromHeadingPitchRoll(t,I),c=O.fromTranslationQuaternionRotationScale(r.ZERO,u,N,M);return s=i(e,n,s),O.multiply(s,c,s)};var P=new O,x=new E;R.headingPitchRollQuaternion=function(e,t,r,n,i){o.typeOf.object("HeadingPitchRoll",t);var a=R.headingPitchRollToFixedFrame(e,t,r,n,P),s=O.getRotation(a,x);return _.fromRotationMatrix(s,i)};var D=new r(1,1,1),U=new r,F=new O,L=new O,q=new E,B=new _;R.fixedFrameToHeadingPitchRoll=function(e,t,n,i){o.defined("transform",e),t=a(t,f.WGS84),n=a(n,R.eastNorthUpToFixedFrame),s(i)||(i=new h);var u=O.getTranslation(e,U);if(r.equals(u,r.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;var c=O.inverseTransformation(n(u,t,F),F),l=O.setScale(e,D,L);l=O.setTranslation(l,r.ZERO,l),c=O.multiply(c,l,c);var d=_.fromRotationMatrix(O.getRotation(c,q),B);return d=_.normalize(d,d),h.fromQuaternion(d,i)};var j=24110.54841,z=8640184.812866,G=.093104,V=-62e-7,W=1.1772758384668e-19,H=72921158553e-15,X=m.TWO_PI/86400,Y=new y;R.computeTemeToPseudoFixedMatrix=function(e,t){if(!s(e))throw new u("date is required.");Y=y.addSeconds(e,-y.computeTaiMinusUtc(e),Y);var r,n=Y.dayNumber,i=Y.secondsOfDay,o=n-2451545;r=i>=43200?(o+.5)/T.DAYS_PER_JULIAN_CENTURY:(o-.5)/T.DAYS_PER_JULIAN_CENTURY;var a=j+r*(z+r*(G+r*V)),c=a*X%m.TWO_PI,l=H+W*(n-2451545.5),f=(i+.5*T.SECONDS_PER_DAY)%T.SECONDS_PER_DAY,h=c+l*f,d=Math.cos(h),p=Math.sin(h);return s(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(d,p,0,-p,d,0,0,0,1)},R.iau2006XysData=new d,R.earthOrientationParameters=c.NONE;var k=32.184,K=2451545;R.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+k,i=t.stop.dayNumber,o=t.stop.secondsOfDay+k,a=R.iau2006XysData.preload(r,n,i,o),s=R.earthOrientationParameters.getPromiseToLoad();return e.all([a,s])},R.computeIcrfToFixedMatrix=function(e,t){if(!s(e))throw new u("date is required.");s(t)||(t=new E);var r=R.computeFixedToIcrfMatrix(e,t);if(s(r))return E.transpose(r,t)};var Z=new p(0,0,0),J=new l(0,0,0,0,0,0),Q=new E,$=new E;R.computeFixedToIcrfMatrix=function(e,t){if(!s(e))throw new u("date is required.");s(t)||(t=new E);var r=R.earthOrientationParameters.compute(e,J);if(s(r)){var n=e.dayNumber,i=e.secondsOfDay+k,o=R.iau2006XysData.computeXysRadians(n,i,Z);if(s(o)){var a=o.x+r.xPoleOffset,c=o.y+r.yPoleOffset,l=1/(1+Math.sqrt(1-a*a-c*c)),f=Q;f[0]=1-l*a*a,f[3]=-l*a*c,f[6]=a,f[1]=-l*a*c,f[4]=1-l*c*c,f[7]=c,f[2]=-a,f[5]=-c,f[8]=1-l*(a*a+c*c);var h=E.fromRotationZ(-o.s,$),d=E.multiply(f,h,Q),p=e.dayNumber,O=e.secondsOfDay-y.computeTaiMinusUtc(e)+r.ut1MinusUtc,_=p-2451545,g=O/T.SECONDS_PER_DAY,w=.779057273264+g+.00273781191135448*(_+g);w=w%1*m.TWO_PI;var A=E.fr
|
||
|
e.add(l.origin,c,c))};var g={root0:0,root1:0};y.raySphere=function(e,t,r){if(!n(e))throw new i("ray is required.");if(!n(t))throw new i("sphere is required.");return r=h(e,t,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var w=new l;y.lineSegmentSphere=function(t,r,o,a){if(!n(t))throw new i("p0 is required.");if(!n(r))throw new i("p1 is required.");if(!n(o))throw new i("sphere is required.");var s=w;e.clone(t,s.origin);var u=e.subtract(r,t,s.direction),c=e.magnitude(u);return e.normalize(u,u),a=h(s,o,a),!n(a)||a.stop<0||a.start>c?void 0:(a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,c),a)};var A=new e,b=new e;y.rayEllipsoid=function(t,r){if(!n(t))throw new i("ray is required.");if(!n(r))throw new i("ellipsoid is required.");var a,s,u,c,l,f=r.oneOverRadii,h=e.multiplyComponents(f,t.origin,A),d=e.multiplyComponents(f,t.direction,b),p=e.magnitudeSquared(h),y=e.dot(h,d);if(p>1){if(y>=0)return;var m=y*y;if(a=p-1,s=e.magnitudeSquared(d),u=s*a,u>m)return;if(m>u){c=y*y-u,l=-y+Math.sqrt(c);var E=l/s,O=a/l;return O>E?new o(E,O):{start:O,stop:E}}var _=Math.sqrt(a/s);return new o(_,_)}return 1>p?(a=p-1,s=e.magnitudeSquared(d),u=s*a,c=y*y-u,l=-y+Math.sqrt(c),new o(0,l/s)):0>y?(s=e.magnitudeSquared(d),new o(0,-y/s)):void 0};var S=new e,v=new e,C=new e,I=new e,N=new e,M=new s,P=new s,x=new s,D=new s,U=new s,F=new s,L=new s,q=new e,B=new e,j=new t;y.grazingAltitudeLocation=function(t,r){if(!n(t))throw new i("ray is required.");if(!n(r))throw new i("ellipsoid is required.");var o=t.origin,u=t.direction;if(!e.equals(o,e.ZERO)){var c=r.geodeticSurfaceNormal(o,S);if(e.dot(u,c)>=0)return o}var l=n(this.rayEllipsoid(t,r)),f=r.transformPositionToScaledSpace(u,S),h=e.normalize(f,f),d=e.mostOrthogonalAxis(f,I),y=e.normalize(e.cross(d,h,v),v),m=e.normalize(e.cross(h,y,C),C),E=M;E[0]=h.x,E[1]=h.y,E[2]=h.z,E[3]=y.x,E[4]=y.y,E[5]=y.z,E[6]=m.x,E[7]=m.y,E[8]=m.z;var O=s.transpose(E,P),_=s.fromScale(r.radii,x),T=s.fromScale(r.oneOverRadii,D),R=U;R[0]=0,R[1]=-u.z,R[2]=u.y,R[3]=u.z,R[4]=0,R[5]=-u.x,R[6]=-u.y,R[7]=u.x,R[8]=0;var g,w,A=s.multiply(s.multiply(O,T,F),R,F),b=s.multiply(s.multiply(A,_,L),E,L),z=s.multiplyByVector(A,o,N),G=p(b,e.negate(z,S),0,0,1),V=G.length;if(V>0){for(var W=e.clone(e.ZERO,B),H=Number.NEGATIVE_INFINITY,X=0;V>X;++X){g=s.multiplyByVector(_,s.multiplyByVector(E,G[X],q),q);var Y=e.normalize(e.subtract(g,o,I),I),k=e.dot(Y,u);k>H&&(H=k,W=e.clone(g,W))}var K=r.cartesianToCartographic(W,j);return H=a.clamp(H,0,1),w=e.magnitude(e.subtract(W,o,I))*Math.sqrt(1-H*H),w=l?-w:w,K.height=w,r.cartographicToCartesian(K,new e)}};var z=new e;return y.lineSegmentPlane=function(t,r,o,s){if(!n(t))throw new i("endPoint0 is required.");if(!n(r))throw new i("endPoint1 is required.");if(!n(o))throw new i("plane is required.");n(s)||(s=new e);var u=e.subtract(r,t,z),c=o.normal,l=e.dot(c,u);if(!(Math.abs(l)<a.EPSILON6)){var f=e.dot(c,t),h=-(o.distance+f)/l;if(!(0>h||h>1))return e.multiplyByScalar(u,h,s),e.add(t,s,s),s}},y.trianglePlaneIntersection=function(t,r,o,a){if(!(n(t)&&n(r)&&n(o)&&n(a)))throw new i("p0, p1, p2, and plane are required.");var s=a.normal,u=a.distance,c=e.dot(s,t)+u<0,l=e.dot(s,r)+u<0,f=e.dot(s,o)+u<0,h=0;h+=c?1:0,h+=l?1:0,h+=f?1:0;var d,p;if((1===h||2===h)&&(d=new e,p=new e),1===h){if(c)return y.lineSegmentPlane(t,r,a,d),y.lineSegmentPlane(t,o,a,p),{positions:[t,r,o,d,p],indices:[0,3,4,1,2,4,1,4,3]};if(l)return y.lineSegmentPlane(r,o,a,d),y.lineSegmentPlane(r,t,a,p),{positions:[t,r,o,d,p],indices:[1,3,4,2,0,4,2,4,3]};if(f)return y.lineSegmentPlane(o,t,a,d),y.lineSegmentPlane(o,r,a,p),{positions:[t,r,o,d,p],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===h){if(!c)return y.lineSegmentPlane(r,t,a,d),y.lineSegmentPlane(o,t,a,p),{positions:[t,r,o,d,p],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return y.lineSegmentPlane(o,r,a,d),y.lineSegmentPlane(t,r,a,p),{positions:[t,r,o,d,p],indices:[2,0,4,2,4,3,1,3,4]};if(!f)return y.lineSegmentPlane(t,o,a,d),y.lineSegmentPlane(r,o,a,p),{positions:[t,r,o,d,p],indices:[0,1,4,0,4,3,2,3,4]}}},y}),define("Core/Plane",["./Cartesian3","./Check","./defined","./DeveloperError","./freezeObject","./Math","./Ma
|